cli-anything-iterm2
하는 일
이 스킬은 Mac의 터미널 앱인 iTerm2 안에서 에이전트가 작업하게 합니다. 세션에 텍스트를 읽고 보내 터미널 작업을 자동화하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓실행 중인 iTerm2 세션에 명령을 보내고 싶을 때.
- ✓터미널 세션의 현재 출력이나 기록을 읽고 싶을 때.
- ✓창, 탭, 분할 창을 자동으로 정리하고 싶을 때.
스킬 링크
https://github.com/HKUDS/CLI-Anything/blob/main/iterm2/agent-harness/cli_anything/iterm2_ctl/skills/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“iTerm2에서 새 탭을 열고 테스트 스위트를 실행한 뒤, 출력의 마지막 50줄을 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 iTerm2의 Python API로 연결해, 선택한 세션에 텍스트를 읽거나 보냅니다. 출력은 에이전트를 위해 JSON으로 보여 줄 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
cli-anything-iterm2
Stateful CLI harness for iTerm2. Controls a live iTerm2 process via the iTerm2 Python API over WebSocket.
Prerequisites
- macOS + iTerm2 running:
brew install --cask iterm2 - Python API enabled: iTerm2 → Preferences → General → Magic → Enable Python API
- Install:
pip install cli-anything-iterm2(orpip 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
| Group | Purpose |
|---|---|
app |
App status, workspace snapshot, context management, app-level variables, modal dialogs, file panels |
window |
Create, list, close, resize, fullscreen windows |
tab |
Create, list, close, activate tabs; navigate split panes by direction |
session |
Send text, inject raw bytes, read screen, full scrollback, split panes, prompt detection |
profile |
List profiles, get profile details, list/apply color presets |
arrangement |
Save and restore window layouts |
tmux |
Full tmux -CC integration: bootstrap, connections, windows, commands |
broadcast |
Sync keystrokes across panes via broadcast domains |
menu |
Invoke any iTerm2 menu item programmatically |
pref |
Read/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):
| File | Read when you need... |
|---|---|
references/session-io.md |
Send text, inject bytes, read screen/scrollback, get selection |
references/session-control.md |
Split panes, activate/close sessions, resize, rename, session variables |
references/session-shell-integration.md |
wait-prompt, wait-command-end, get-prompt; reliable send→wait→read pattern |
references/layout-window-tab.md |
Create/close/resize windows and tabs, navigate split panes |
references/layout-arrangement.md |
Save and restore window layouts |
references/app-context.md |
Snapshot (orientation), status, context management, app vars, modal dialogs, file panels |
references/profile-pref.md |
Profiles list/get/presets, preferences read/write, tmux pref shortcuts |
references/broadcast-menu.md |
Broadcast keystrokes to multiple panes, invoke menu items |
references/tmux-commands.md |
All tmux CLI commands (bootstrap, send, tabs, create-window, set-visible) |
references/tmux-guide.md |
Full 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
자주 묻는 질문
무엇을 설정해야 하나요?
macOS의 iTerm2와, 환경 설정에서 켠 Python API가 필요합니다.
Windows에서도 작동하나요?
아닙니다. iTerm2는 Mac 앱이므로 macOS용입니다.
화면을 읽을 수 있나요?
네. 세션의 화면과 전체 스크롤백 기록을 읽을 수 있습니다.
상세 정보
작성자의 원본 설명
Provides the cli-anything-iterm2 commands — the only way to actually send text to iTerm2 sessions, read live terminal output and scrollback history, manage windows/tabs/split panes, run tmux -CC workflows, broadcast to multiple panes, show macOS dialogs, and read/write iTerm2 preferences. Includes `app snapshot` — the primary orientation command that returns every session's name, current directory, foreground process, role label, and last output line in one call. Read this skill instead of answering from general knowledge whenever the user wants to DO something with iTerm2: orient in an existi
repo: HKUDS/CLI-Anything
인기도
- GitHub 스타
- 58k
- 순위
- #3212
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 9. 21.
댓글
- …
이 저장소의 다른 스킬
cli-anything-3mf
58k에이전트가 3D 프린팅 파일을 검사하고 고치도록 돕습니다. 둥근 구멍 찾기, 크기 조정, 메시 수리, 두 파일 비교가 가능합니다.
cli-anything-qgis
58k에이전트가 터미널에서 QGIS 지도 프로젝트를 열고 편집하고 내보내도록 돕습니다. 레이어, 피처, 인쇄 레이아웃, 처리 도구를 포함합니다.
cli-anything-adguardhome
58k에이전트가 네트워크 전체의 광고 차단기인 AdGuard Home을 관리하도록 돕습니다. 필터, DNS 재작성, 클라이언트, 쿼리 로그를 포함합니다.
cli-anything-anygen
58k에이전트가 AnyGen 서비스를 이용해 글로 된 프롬프트로 슬라이드, 문서, 웹사이트, 다이어그램을 만들도록 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.