본문으로 건너뛰기
Skillpedia
일반 코딩260k · #444

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/autonomous-ai-agents/opencode/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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@latest or brew install anomalyco/tap/opencode
  • Auth configured: opencode auth login or set provider env vars (OPENROUTER_API_KEY, etc.)
  • Verify: opencode auth list should show at least one provider
  • Git repository for code tasks (recommended)
  • pty=true for 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

  1. Verify tool readiness:
    • terminal(command="opencode --version")
    • terminal(command="opencode auth list")
  2. For bounded tasks, use opencode run '...' (no pty needed).
  3. For iterative tasks, start opencode with background=true, pty=true.
  4. Monitor long tasks with process(action="poll"|"log").
  5. If OpenCode asks for input, respond via process(action="submit", ...).
  6. Exit with process(action="write", data="\x03") or
자주 묻는 질문

어떻게 설정하나요?

npm이나 Homebrew로 OpenCode를 설치한 뒤, opencode auth login으로 로그인하거나 제공업체 키를 설정합니다.

준비되었는지 어떻게 확인하나요?

opencode auth list를 실행하면 최소 하나의 제공업체가 연결되어 있는지 볼 수 있습니다.

어떤 바이너리가 실행되는지 왜 확인하나요?

셸이 Hermes가 쓰는 것과 다른 OpenCode 프로그램을 찾을 수 있다고 스킬은 설명합니다.

상세 정보

작성자의 원본 설명

Delegate coding to OpenCode CLI (features, PR review).

repo: NousResearch/hermes-agent

인기도

GitHub 스타
260k
순위
#444
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬