opencode
하는 일
여러 AI 제공업체와 작동하는 오픈소스 코딩 에이전트 OpenCode를 프로젝트 작업에 실행하도록 안내합니다. Hermes에서 외부 코딩 작업자를 관리하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓OpenCode가 코드를 구현, 리팩터링, 검토하기를 명시적으로 원할 때.
- ✓긴 코딩 작업에 중간 진행 확인이 필요할 때.
- ✓여러 코딩 작업을 각각 다른 작업 폴더에서 동시에 실행하고 싶을 때.
스킬 링크
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/autonomous-ai-agents/opencode/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“OpenCode를 사용해 제 프로젝트의 API 호출에 재시도 로직을 추가하고 테스트도 업데이트해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 범위가 정해진 작업에는 선택한 폴더에서 opencode 명령을 실행하고, 긴 세션에는 대화형 인터페이스를 씁니다. 또한 Hermes가 쓰는 OpenCode 프로그램이 무엇인지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
OpenCode CLI
Use OpenCode as an autonomous coding worker orchestrated by Hermes terminal/process tools. OpenCode is a provider-agnostic, open-source AI coding agent with a TUI and CLI.
When to Use
- User explicitly asks to use OpenCode
- You want an external coding agent to implement/refactor/review code
- You need long-running coding sessions with progress checks
- You want parallel task execution in isolated workdirs/worktrees
Prerequisites
- OpenCode installed:
npm i -g opencode-ai@latestorbrew install anomalyco/tap/opencode - Auth configured:
opencode auth loginor set provider env vars (OPENROUTER_API_KEY, etc.) - Verify:
opencode auth listshould show at least one provider - Git repository for code tasks (recommended)
pty=truefor interactive TUI sessions
Binary Resolution (Important)
Shell environments may resolve different OpenCode binaries. If behavior differs between your terminal and Hermes, check:
terminal(command="which -a opencode")
terminal(command="opencode --version")
If needed, pin an explicit binary path:
terminal(command="$HOME/.opencode/bin/opencode run '...'", workdir="~/project", pty=true)
One-Shot Tasks
Use opencode run for bounded, non-interactive tasks:
terminal(command="opencode run 'Add retry logic to API calls and update tests'", workdir="~/project")
Attach context files with -f:
terminal(command="opencode run 'Review this config for security issues' -f config.yaml -f .env.example", workdir="~/project")
Show model thinking with --thinking:
terminal(command="opencode run 'Debug why tests fail in CI' --thinking", workdir="~/project")
Force a specific model:
terminal(command="opencode run 'Refactor auth module' --model openrouter/anthropic/claude-sonnet-4", workdir="~/project")
Interactive Sessions (Background)
For iterative work requiring multiple exchanges, start the TUI in background:
terminal(command="opencode", workdir="~/project", background=true, pty=true)
# Returns session_id
# Send a prompt
process(action="submit", session_id="<id>", data="Implement OAuth refresh flow and add tests")
# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")
# Send follow-up input
process(action="submit", session_id="<id>", data="Now add error handling for token expiry")
# Exit cleanly — Ctrl+C
process(action="write", session_id="<id>", data="\x03")
# Or just kill the process
process(action="kill", session_id="<id>")
Important: Do NOT use /exit — it is not a valid OpenCode command and will open an agent selector dialog instead. Use Ctrl+C (\x03) or process(action="kill") to exit.
TUI Keybindings
| Key | Action |
|---|---|
Enter |
Submit message (press twice if needed) |
Tab |
Switch between agents (build/plan) |
Ctrl+P |
Open command palette |
Ctrl+X L |
Switch session |
Ctrl+X M |
Switch model |
Ctrl+X N |
New session |
Ctrl+X E |
Open editor |
Ctrl+C |
Exit OpenCode |
Resuming Sessions
After exiting, OpenCode prints a session ID. Resume with:
terminal(command="opencode -c", workdir="~/project", background=true, pty=true) # Continue last session
terminal(command="opencode -s ses_abc123", workdir="~/project", background=true, pty=true) # Specific session
Common Flags
| Flag | Use |
|---|---|
run 'prompt' |
One-shot execution and exit |
--continue / -c |
Continue the last OpenCode session |
--session <id> / -s |
Continue a specific session |
--agent <name> |
Choose OpenCode agent (build or plan) |
--model provider/model |
Force specific model |
--format json |
Machine-readable output/events |
--file <path> / -f |
Attach file(s) to the message |
--thinking |
Show model thinking blocks |
--variant <level> |
Reasoning effort (high, max, minimal) |
--title <name> |
Name the session |
--attach <url> |
Connect to a running opencode server |
Procedure
- Verify tool readiness:
terminal(command="opencode --version")terminal(command="opencode auth list")
- For bounded tasks, use
opencode run '...'(no pty needed). - For iterative tasks, start
opencodewithbackground=true, pty=true. - Monitor long tasks with
process(action="poll"|"log"). - If OpenCode asks for input, respond via
process(action="submit", ...). - Exit with
process(action="write", data="\x03")or
자주 묻는 질문
어떻게 설정하나요?
npm이나 Homebrew로 OpenCode를 설치한 뒤, opencode auth login으로 로그인하거나 제공업체 키를 설정합니다.
준비되었는지 어떻게 확인하나요?
opencode auth list를 실행하면 최소 하나의 제공업체가 연결되어 있는지 볼 수 있습니다.
어떤 바이너리가 실행되는지 왜 확인하나요?
셸이 Hermes가 쓰는 것과 다른 OpenCode 프로그램을 찾을 수 있다고 스킬은 설명합니다.
상세 정보
인기도
- GitHub 스타
- 260k
- 순위
- #444
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-merge-conflict-arbiter
260k병렬로 작업한 두 에이전트 브랜치 사이의 git 병합 충돌을 중립적인 제3자로서 해결하고, 저장소에 하나의 병합 결과를 만듭니다.
antigravity-cli
260kAntigravity 명령줄 도구의 설치, 업데이트, 플러그인, 로그인, 샌드박스 문제를 해결하도록 단계별로 안내합니다.
blackbox
260k에이전트가 여러 AI 모델을 실행해 최선의 결과를 고르는 Blackbox AI 명령줄 도구에 코딩 작업을 맡기도록 돕습니다.
dynamic-workflow
260k많은 비슷한 작업을 저장된 스크립트로 실행하고, 검증된 결과만 메인 대화로 돌아오도록 에이전트에게 가르칩니다.