skills/productivity/drive/SKILL.md
Terminal automation CLI for AI agents. Use drive to create tmux sessions, execute commands, send keystrokes, read output, poll for patterns, run commands in parallel across sessions, and manage processes. Always use --json for structured output.
npx skillsauth add codewithbehnam/cc-docs driveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run from: cd apps/drive && uv run python main.py <command>
Drive gives you full programmatic control over tmux sessions — creating terminals, running commands, reading output, and orchestrating parallel workloads.
drive session create agent-1 --json # Opens a Terminal window (headed — default)
drive session create agent-1 --window build --json # Named window, headed
drive session create agent-1 --detach --json # Headless (no Terminal window)
drive session list --json # List all sessions
drive session kill agent-1 --json # Kill a session
Default is headed — a new Terminal.app window opens attached to the session so you can watch live. Only use --detach when you explicitly need a headless session.
Uses sentinel protocol (__DONE_<token>:<exit_code>) for reliable completion detection.
drive run agent-1 "npm test" --json # Run and wait
drive run agent-1 "make build" --timeout 120 --json # Custom timeout
drive run agent-1 "ls" --pane 1 --json # Target specific pane
Returns: exit code, captured output between sentinels.
For interactive tools (vim, ipython, etc.) where sentinel detection would interfere.
drive send agent-1 "vim file.txt" --json # Send command
drive send agent-1 ":wq" --json # Send vim command
drive send agent-1 "y" --no-enter --json # Send without Enter
drive logs agent-1 --json # Current pane content
drive logs agent-1 --lines 500 --json # Last 500 lines of scrollback
drive logs agent-1 --pane 1 --json # Specific pane
drive poll agent-1 --until "BUILD SUCCESS" --json # Wait for pattern
drive poll agent-1 --until "ready" --timeout 60 --json # With timeout
drive poll agent-1 --until "error|success" --interval 2.0 --json # Custom interval
Pattern is a regex. Returns matched text and full pane content.
drive fanout "npm test" --targets agent-1,agent-2,agent-3 --json # Same command, multiple sessions
drive fanout "git pull" --targets a1,a2,a3 --timeout 30 --json # With timeout
Runs command in all target sessions concurrently using ThreadPoolExecutor. Returns ordered results.
drive session create before running commands (headed by default — opens a Terminal window)run for commands that complete — It waits and gives you exit code + outputsend for interactive tools — vim, ipython, anything that doesn't "finish"poll to wait for async events — Watch for build completion, server startup, etc.logs to inspect — Check what happened in a panefanout for parallel work — Run same command across multiple sessionsproc for process management — List, kill, and inspect processes instead of raw ps/kill--json always — Structured output for reliable parsing/tmp/. Never write output files into the project directory.List, kill, inspect, and monitor processes. The agent's replacement for Activity Monitor.
drive proc list --json # All user processes
drive proc list --name claude --json # Filter by name
drive proc list --session job-abc123 --json # Processes in a tmux session
drive proc list --parent 12345 --json # Children of a PID
drive proc list --cwd /path/to/project --json # Processes running from a directory
drive proc kill 12345 --json # Kill by PID (SIGTERM → wait → SIGKILL)
drive proc kill --name "claude" --json # Kill all matching name
drive proc kill 12345 --tree --json # Kill PID and all children
drive proc kill 12345 --force --json # Force kill (SIGKILL, no grace period)
drive proc kill 12345 --signal 9 --json # Same as --force
drive proc tree 12345 --json # Show process tree from PID
drive proc top --session job-abc123 --json # Resource snapshot for session
drive proc top --pid 12345,12346 --json # Resource snapshot for specific PIDs
Each process includes cwd (working directory) in its JSON output — use this to identify processes spawned from a specific project or directory.
Kill uses a two-step pattern: sends the signal (default SIGTERM), waits up to 5 seconds for graceful exit, then SIGKILL if still alive. Use --tree to kill a process and all its children (critical for Claude Code which spawns node subprocesses).
During cleanup, cd back to your original working directory and use proc list to find processes you started that you don't need running anymore. If the task specified they should keep running, leave them alone.
1. drive proc list --session job-abc123 --json → see what's running
2. drive proc kill <pid> --tree --json → kill it and children
3. drive proc list --name <name> --json → verify nothing survived
Drive wraps commands with markers: echo "__START_<token>" ; <cmd> ; echo "__DONE_<token>:$?"
This gives:
tools
macOS GUI automation CLI. Use steer to see the screen, click elements, type text, send hotkeys, scroll, drag, manage windows and apps, run OCR on Electron apps, and wait for UI conditions.
testing
Ship workflow: merge main, run tests, review diff, bump VERSION, update CHANGELOG, commit, push, create PR.
testing
Import cookies from your real browser (Comet, Chrome, Arc, Brave, Edge) into the headless browse session. Opens an interactive picker UI where you select which cookie domains to import. Use before QA testing authenticated pages.
development
Weekly engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with persistent history and trend tracking. Team-aware: breaks down per-person contributions with praise and growth areas.