Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
hkuds avatar

Cli Anything Iterm2

  • 377 installs
  • 46.6k repo stars
  • Updated August 3, 2026
  • hkuds/cli-anything

cli-anything-iterm2 is a Claude Code skill that exposes cli-anything-iterm2 CLI commands for developers who need AI agents to control iTerm2 sessions, read terminal output, and manage panes on macOS.

About

cli-anything-iterm2 is an hkuds/cli-anything skill that documents the only supported CLI for driving iTerm2 from AI agents on macOS. It covers sending text to sessions, reading live output and scrollback, managing windows tabs and split panes, tmux -CC workflows, broadcasting to multiple panes, macOS dialogs, and reading or writing iTerm2 preferences. The app snapshot command returns every session's name, current directory, foreground process, role label, and last output line in one orientation call. Developers reach for this skill when agents must execute real shell commands in existing workspaces, verify what is running, or coordinate multi-pane terminal tasks instead of simulating terminal behavior from general knowledge.

  • iTerm2 session and pane control
  • Agent-driven shell command execution
  • Terminal output capture for agents
  • Local dev environment automation
  • CLI-anything integration surface

Cli Anything Iterm2 by the numbers

  • 377 all-time installs (skills.sh)
  • +14 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #145 of 550 CLI & Terminal skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-iterm2

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs377
repo stars46.6k
Last updatedAugust 3, 2026
Repositoryhkuds/cli-anything

How do AI agents control iTerm2 terminal sessions?

Wire Claude agent workflows to iTerm2 sessions—spawn panes, stream command output, and drive terminal tasks from skills without leaving the agent loop.

Who is it for?

macOS developers using Claude or Cursor agents that must interact with real iTerm2 terminals, tmux -CC panes, and live shell output.

Skip if: Linux or Windows terminal automation or developers who only need generic shell advice without iTerm2 CLI integration on macOS.

When should I use this skill?

A developer wants an agent to send commands to iTerm2, read terminal scrollback, manage split panes, run tmux -CC, or orient via app snapshot.

What you get

iTerm2 session commands executed, live scrollback captured, pane layouts managed, and app snapshot orientation reports with cwd and process info.

  • iTerm2 session control commands
  • Terminal scrollback reads
  • App snapshot orientation reports

By the numbers

  • app snapshot returns cwd, foreground process, and last output for every iTerm2 session

Files

SKILL.mdMarkdownGitHub ↗

cli-anything-iterm2

Stateful CLI harness for iTerm2. Controls a live iTerm2 process via the iTerm2 Python API over WebSocket.

Prerequisites

1. macOS + iTerm2 running: brew install --cask iterm2 2. Python API enabled: iTerm2 → Preferences → General → Magic → Enable Python API 3. Install: pip install cli-anything-iterm2 (or pip install -e . from source)

Basic Syntax

cli-anything-iterm2 [--json] <group> <command> [OPTIONS] [ARGS]

Always use --json for machine-readable output (required for agent use).

Command Groups

GroupPurpose
appApp status, workspace snapshot, context management, app-level variables, modal dialogs, file panels
windowCreate, list, close, resize, fullscreen windows
tabCreate, list, close, activate tabs; navigate split panes by direction
sessionSend text, inject raw bytes, read screen, full scrollback, split panes, prompt detection
profileList profiles, get profile details, list/apply color presets
arrangementSave and restore window layouts
tmuxFull tmux -CC integration: bootstrap, connections, windows, commands
broadcastSync keystrokes across panes via broadcast domains
menuInvoke any iTerm2 menu item programmatically
prefRead/write global iTerm2 preferences; list all valid keys; tmux settings

Orienting in an Existing Workspace

Use app snapshot when you land in a session with existing panes and need to understand what's running without reading full screen contents for each pane:

cli-anything-iterm2 --json app snapshot

Returns name, current directory, foreground process, user.role label, and last visible output line for every session across all windows.

Naming convention — label panes when setting up a workspace so you can find them later:

cli-anything-iterm2 session set-var user.role "api-server"
cli-anything-iterm2 session set-var user.role "log-tail"
cli-anything-iterm2 session set-var user.role "editor"

app snapshot will surface these roles alongside process and path, giving you a full picture in one call.

Typical Agent Workflow

# 1. Orient — snapshot every session: name, path, process, role, last output line
cli-anything-iterm2 --json app snapshot

# 2. Establish context (saves window/tab/session IDs for subsequent commands)
cli-anything-iterm2 app current

# 3. Interact — no --session-id needed once context is set
cli-anything-iterm2 session send "git status"
cli-anything-iterm2 --json session scrollback --tail 200 --strip

# 4. Create a multi-pane workspace — label panes so snapshot identifies them later
cli-anything-iterm2 session split --vertical --use-as-context
cli-anything-iterm2 session send "python3 -m http.server 8000"
cli-anything-iterm2 session set-var user.role "http-server"

Reference Files

Read only what the task requires — each file is a single narrow concern (~10–30 lines):

FileRead when you need...
references/session-io.mdSend text, inject bytes, read screen/scrollback, get selection
references/session-control.mdSplit panes, activate/close sessions, resize, rename, session variables
references/session-shell-integration.mdwait-prompt, wait-command-end, get-prompt; reliable send→wait→read pattern
references/layout-window-tab.mdCreate/close/resize windows and tabs, navigate split panes
references/layout-arrangement.mdSave and restore window layouts
references/app-context.mdSnapshot (orientation), status, context management, app vars, modal dialogs, file panels
references/profile-pref.mdProfiles list/get/presets, preferences read/write, tmux pref shortcuts
references/broadcast-menu.mdBroadcast keystrokes to multiple panes, invoke menu items
references/tmux-commands.mdAll tmux CLI commands (bootstrap, send, tabs, create-window, set-visible)
references/tmux-guide.mdFull tmux -CC workflow, pane→session ID mapping
references/json-session.md--json schemas for session, window, tab, screen, scrollback, inject
references/json-tmux-app.md--json schemas for tmux, app dialogs, preferences, errors

REPL Mode

Run without arguments for an interactive REPL that maintains context between commands:

cli-anything-iterm2

Related skills

How it compares

Choose cli-anything-iterm2 over generic terminal skills when agents must control real iTerm2 on macOS via the documented CLI, not hypothetical shell access.

FAQ

What is the app snapshot command in cli-anything-iterm2?

cli-anything-iterm2 app snapshot is the primary orientation command. It returns every iTerm2 session's name, current directory, foreground process, role label, and last output line in a single call for agent workspace awareness.

Does cli-anything-iterm2 support tmux?

cli-anything-iterm2 documents tmux -CC workflows alongside native iTerm2 pane management. Agents can manage windows, tabs, split panes, and broadcast commands to multiple panes through the cli-anything-iterm2 command set.

CLI & Terminalintegrationsdevopsfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.