Skip to content

Repository files navigation

iCommand

Claude Code plugin for the LambdaTest iOS team — slash commands, knowledge base, and MCP servers.

One repo. One install. Every team member gets all workflows globally.

Quick Start

git clone [email protected]:LambdatestIncPrivate/iCommand.git
cd iCommand
./install.sh

Open Claude Code in any repo and type / to see all available commands.

All Commands

Command Description
/feature Full 8-phase feature development workflow (RFC → TDD → PR)
/fix-bug Fix a Jira bug with TDD, create PR, transition ticket
/commit-push-pr Quick commit + push + PR creation
/review-pr Language-aware code review with Go/Swift checklists
/deploy-check Deployment readiness check for a service
/read-prd Analyze a PRD/Confluence page — extract requirements, gaps
/write-rfc Generate an RFC from a topic or Jira ticket
/debug-host Debug a host via logtail MCP — tail logs, grep errors
/check-health Health dashboard for one or all hosts (logtail MCP)
/incident Create incident report from logs, post to Slack
/standup Generate standup update from git activity
/slack-update Post formatted status update to Slack
/transition-jira Transition a Jira ticket through workflow states
/changelog Generate user-friendly changelog from git history
/doctor Self-diagnosis — verify iCommand installation health
/host-inspect Quick host overview — devices, services, health, errors
/host-diag Full system diagnostic — CPU, memory, disk, Xcode, USB
/host-rca Root cause analysis with source code correlation
/device-manage Device operations — list, info, apps, screenshot, reboot, syslog
/service-manage Service lifecycle — status, health, restart, stop, logs
/host-exec Run arbitrary commands on a remote host
/clean-host Clean Xcode caches/DerivedData, show disk freed

hostctl Commands (detailed)

Requires the hostctl binary. See Setup below.

/host-inspect — Quick host overview

Get a snapshot of a remote host: system stats, connected devices, service health, and recent errors.

/host-inspect <host_ip> [environment]
/host-inspect 10.151.1.211
/host-inspect 10.151.1.211 prod

What it runs: hostctl inspect, hostctl stats, hostctl health, hostctl devices (in parallel)

Output:

  • System table — hostname, OS, uptime, CPU, memory, disk
  • Connected devices — UDID, model, iOS version, battery
  • Service health — LRR/MB running status, PID, health check result
  • Anomaly flags — disk > 80% suggests /clean-host, stopped service suggests /service-manage restart

/host-diag — Full system diagnostic

Comprehensive diagnostic covering every aspect of the host.

/host-diag <host_ip> [environment]
/host-diag 10.151.1.211
/host-diag 10.151.1.213 prod

What it runs (all in parallel):

hostctl command Data collected
hostctl diag Full diagnostic report
hostctl stats CPU, memory, disk, load average
hostctl disk Disk usage by path
hostctl top --sort cpu Top 10 CPU consumers
hostctl top --sort mem Top 10 memory consumers
hostctl xcode Xcode version, xcodebuild, swift
hostctl usb USB device tree
hostctl simulators Simulator inventory
hostctl network Interfaces and connections

Anomaly detection:

  • Disk > 80% → suggests /clean-host
  • Memory pressure critical → shows top memory consumers
  • CPU > 90% → shows top CPU consumers
  • Unavailable simulators → suggests cleanup

/host-rca — Root cause analysis

Intelligent RCA combining log pattern matching with source code correlation. Maps errors to exact file:line references in your local source code.

/host-rca <host_ip> <udid> [environment]
/host-rca 10.151.1.211 00008110-001E04C10C8A801E
/host-rca 10.151.1.211 00008110-001E04C10C8A801E prod

Two-layer analysis:

Layer hostctl command What it does
Pattern-based hostctl rca Scans logs for ERROR, FATAL, PANIC, wda_status, tunnel drops
Source-aware hostctl analyze Correlates log errors with local source code (requires source_path in config)

Known failure signatures cross-referenced:

Log pattern Root cause
IPv6 header EOF + usbmuxd broken pipe go-ios tunnel drop (upstream)
wda_status=failed + manual=0 WDA unreachable, tunnel instability
USB reset on iOS 17+ Bug — must be gated to iOS 12-16
health 400 LRR returning unhealthy status
context deadline exceeded Operation timeout

Output: Findings with severity (P1-P4), frequency, source file:line, error timeline, service status. Offers to post to Slack or create /incident.


/device-manage — Device operations

Manage iOS devices connected to a remote host.

/device-manage <action> <host_ip> [udid] [environment]

Actions

list — Show all connected devices

/device-manage list 10.151.1.211
/device-manage list 10.151.1.211 prod

Output: UDID, name, model, iOS version, battery %

info — Detailed device metadata

/device-manage info 10.151.1.211 00008110-001E04C10C8A801E

Output: Serial, WiFi MAC, Bluetooth, storage, all device properties

apps — List installed applications

/device-manage apps 10.151.1.211 00008110-001E04C10C8A801E

Supports filtering: user, system, or all (default: user)

screenshot — Capture and download screenshot

/device-manage screenshot 10.151.1.211 00008110-001E04C10C8A801E

Saves to /tmp/screenshot-<last8_udid>.png

reboot — Reboot device (requires confirmation)

/device-manage reboot 10.151.1.211 00008110-001E04C10C8A801E

syslog — Stream iOS system logs

/device-manage syslog 10.151.1.211 00008110-001E04C10C8A801E

Shows last 200 lines. Use --follow for live streaming.


/service-manage — Service lifecycle

Manage LRR (Lambda Remote Runner) and MB (Mobile Binary) services on remote hosts.

/service-manage <action> <host_ip> [service] [environment]

Actions

status — Show service process info

/service-manage status 10.151.1.211

Output: Service name, status (RUNNING/STOPPED), PID, CPU%, MEM%

health — Run health checks

/service-manage health 10.151.1.211
/service-manage health 10.151.1.211 prod

Output: Process check + custom health command result (OK/FAIL)

restart — Restart a service (requires confirmation)

/service-manage restart 10.151.1.211 lrr
/service-manage restart 10.151.1.211 mb prod

Sends SIGTERM, waits 2s, verifies auto-restart. Reports new PID.

stop — Stop a service (requires confirmation)

/service-manage stop 10.151.1.211 mb

Add --force for SIGKILL.

logs — Tail or stream service logs

/service-manage logs 10.151.1.211 lrr 00008110-001E04C10C8A801E
/service-manage logs 10.151.1.211 mb 00008110-001E04C10C8A801E

Shows last 200 lines. Supports --follow for live streaming.


/host-exec — Run remote command

Execute arbitrary shell commands on a remote host through the bastion SSH tunnel.

/host-exec <host_ip> "<command>" [environment]
/host-exec 10.151.1.211 "ps aux | grep mobile"
/host-exec 10.151.1.211 "df -h" prod
/host-exec 10.151.1.213 "ls -la ~/Documents/Mobile_Binary/"
/host-exec 10.151.1.211 "cat /etc/os-release"

Safety checks:

  • Blocked: rm -rf /, shutdown, dd on disks, SSH key modifications
  • Requires confirmation: rm, kill, sudo, file modifications
  • No confirmation needed: Read-only commands (ls, ps, df, cat, uptime)

/clean-host — Clean Xcode caches

Clean DerivedData, Xcode caches, and unavailable simulators. Shows before/after disk usage.

/clean-host <host_ip> [environment]
/clean-host 10.151.1.211
/clean-host 10.151.1.211 prod

Workflow:

  1. Shows current disk usage (root, DerivedData, caches)
  2. Asks what to clean:
    • DerivedData only (safest, usually largest gain)
    • Xcode caches
    • Unavailable simulators
    • All of the above
  3. Runs cleanup
  4. Shows before/after comparison with space freed

hostctl Setup

  1. Get the hostctl binary from your team lead and place it in your PATH:

    cp hostctl ~/bin/hostctl
    chmod +x ~/bin/hostctl
  2. Create config templates:

    hostctl config init
  3. Edit ~/.hostctl/{dev,stage,prod}.yaml with your bastion username and credentials.

  4. Verify:

    hostctl --version

Config structure (~/.hostctl/prod.yaml)

environment: prod
bastion:
    host: bastion-prod.lambdatest.com
    user: <your_username>
    password: "<your_password>"
host:
    user: ltadmin
    password: "<host_password>"
services:
    lrr:
        name: Lambda Remote Runner
        log_path: ~/Documents/LambdaRemoteRunner/lamda-remote-runner-{{udid}}.log
        source_path: /path/to/lambda-remote-runner  # optional, enables /host-rca source analysis
    mb:
        name: Mobile Binary
        log_path: ~/Documents/Mobile_Binary/lt-{{udid}}.log
        source_path: /path/to/mobile-automation      # optional

Credentials Setup (logtail MCP)

The logtail MCP server (used by /debug-host, /check-health, /incident) reads credentials from macOS Keychain:

# Bastion passwords (replace with your username)
security add-generic-password -s 'logtail-bastion-prod' -a '<username>' -w '<password>'
security add-generic-password -s 'logtail-bastion-stage' -a '<username>' -w '<password>'

# Host passwords
security add-generic-password -s 'logtail-host-prod' -a 'ltadmin' -w '<password>'
security add-generic-password -s 'logtail-host-stage' -a 'ltadmin' -w '<password>'

How It Works

install.sh symlinks every commands/*.md to ~/.claude/commands/, making them available as global slash commands in Claude Code from any directory. The repo path is stored in ~/.claude/icommand-path so commands can find docs/.

# Update (no reinstall needed)
cd iCommand && git pull

# Uninstall
cd iCommand && ./uninstall.sh

# Verify installation
/doctor

Structure

iCommand/
├── install.sh                         # One-command setup
├── uninstall.sh                       # Clean removal
├── commands/                          # 22 slash commands
│   ├── host-inspect.md                #   hostctl-powered
│   ├── host-diag.md
│   ├── host-rca.md
│   ├── device-manage.md
│   ├── service-manage.md
│   ├── host-exec.md
│   ├── clean-host.md
│   ├── debug-host.md                  #   logtail MCP-powered
│   ├── check-health.md
│   ├── incident.md
│   ├── feature.md                     #   dev workflow
│   ├── fix-bug.md
│   ├── commit-push-pr.md
│   ├── review-pr.md
│   ├── deploy-check.md
│   ├── read-prd.md
│   ├── write-rfc.md
│   ├── standup.md
│   ├── slack-update.md
│   ├── transition-jira.md
│   ├── changelog.md
│   └── doctor.md
├── skills/                            # 4 auto-triggered skills
├── docs/                              # Knowledge base
├── mcp-servers/logtail/               # SSH log access MCP server
└── templates/                         # CLAUDE.md templates

About

Claude Code plugin for LambdaTest iOS team — 22 commands, 4 skills, logtail MCP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages