Octopus/Docs/AI Coding Agents
CLI / AI coding agents

AI coding agents

Ask your coding agent to use Octopus for code reviews. Install the Octopus CLI, then add a small skill file that teaches your agent how to use it.

Set up once

  1. 1. Install and sign in to Octopus

    Follow the CLI installation and login guide in the environment where your agent runs commands. For a remote agent, container, or sandbox, install and authenticate there too. Complete sign-in yourself; keep tokens out of prompts and skill files.

  2. 2. Check the agent can use it

    Open your project in the agent and ask it to run these commands in its own terminal. Confirm the expected Octopus account before continuing.

    Check the CLI and account
    octp --version
    octp whoami

    These checks do not start a review. Your agent needs permission to execute shell commands and reach your Octopus instance.

  3. 3. Add the Octopus skill

    Download SKILL.md or copy it below. Save it at the location shown for your tool, keeping the filename SKILL.md. The skill gives your agent instructions; the installed octp CLI performs the work.

    View and copy the skill
    SKILL.md
    ---
    name: octopus
    description: Use the Octopus CLI to check the user's Octopus connection or review a chosen staged diff, working change set, or connected pull request when the user asks for Octopus.
    ---
    
    # Octopus review
    
    Run commands in the user's intended Git checkout, using the environment where
    your terminal tool actually executes. A host login or binary may not exist in a
    remote workspace or container.
    
    1. Run `octp --version` and `octp whoami`. Confirm the intended organization.
       If the CLI is missing or authentication fails, stop and direct the user to
       https://octopus-review.ai/docs/cli/ai-agents. The user runs `octp login`.
       Never ask for a token in chat, read credential files, or put tokens in this skill.
    2. Establish the requested scope with `git status --short`. Review only the
       changes or PR the user selected. If the scope is unclear, ask before sending code.
    3. Choose the matching command:
       - Staged changes: `octp review --staged --no-index --format json`.
       - Working/branch changes: `octp review --no-index --format json`.
         This can include committed changes since the upstream branch plus unstaged
         tracked changes; it does not reliably include staged-only changes. Inspect
         the intended diff first. Untracked files are not automatically reviewed.
       - A connected PR: `octp review --pr 42` (replace 42 with the requested number),
         or pass a full GitHub, GitLab, or Bitbucket PR URL after `--pr`.
         Forgejo full PR URLs are not accepted by native CLI 0.6.0; use the PR number
         from the connected repository checkout.
    4. Explain the result accurately. Local review JSON contains findings and
       coverage information. If `truncated` is true, report that coverage is incomplete.
       A successful PR request means queued, not finished: check Octopus Review Logs
       and the PR for the final result. Never claim success after an error.
    5. Present findings before changing files. Apply fixes, commit, push, or post
       comments only when the user's request authorizes those actions. Follow the
       repository's validation instructions and preserve unrelated changes.
    
    Reviews send code/diffs and review metadata to the configured Octopus server
    and AI services and use the organization's credits or provider budget.
    `--no-index` prevents a new repository upload/indexing run; it does not make the
    review offline and may still use existing indexed context. Do not add `--index`
    or upload more repository content without the user's authorization.
    
    Use `octp --help` to inspect the installed command set. Do not substitute
    `octopus`, `npx @octp/cli`, `octp ask`, or invented `--claude`/`--codex` flags.

Reviews send selected code and context to your Octopus instance and its configured AI provider. They may use Octopus credits or incur provider charges, separately from your coding agent subscription.

Choose your agent

Paths below are relative to your project unless stated otherwise. Codex, OpenCode, Hermes, OpenClaw, and Cursor can share one .agents/skills/octopus/SKILL.md file.

Claude Code

Save the file as .claude/skills/octopus/SKILL.md.

Open Claude Code in the project, then enter /octopus or ask it to use the Octopus skill.

For the separately packaged plugin, see the Claude Code integration guide.

Claude Code skill guide ↗

Codex

Save the file as .agents/skills/octopus/SKILL.md.

Open the project in Codex, then invoke $octopus or ask it to use the Octopus skill.

The CLI and login must be available in the environment used by that Codex session.

Codex skill guide ↗

OpenCode

Save the file as .agents/skills/octopus/SKILL.md. OpenCode also supports .opencode/skills/octopus/SKILL.md.

Start OpenCode in the project and ask: “Use the octopus skill to check my Octopus connection.”

OpenCode loads the skill on demand and uses its shell tool to run the CLI.

OpenCode skill guide ↗

Hermes Agent

For Nous Research's Hermes Agent, save the file as .agents/skills/octopus/SKILL.md.

Review the skill, then run hermes skills trust from the project root. This allows Hermes to load that project's skills.

Start Hermes, use /skills to check it appears, then invoke /octopus. Install and authenticate the CLI inside your configured terminal backend if it uses Docker or SSH.

Hermes Agent skill guide ↗

OpenClaw

Save the file as .agents/skills/octopus/SKILL.md inside the configured agent workspace. The native alternative is skills/octopus/SKILL.md.

Check discovery with openclaw skills info octopus, then start a new session and invoke /octopus.

The octp binary and login must be available on the host, node, or sandbox where OpenClaw executes commands.

OpenClaw skill guide ↗

Cursor

Save the file as .agents/skills/octopus/SKILL.md, then open the project in Cursor.

Open Customize → Skills to check it appears, then invoke /octopus in Agent chat.

For a cloud or remote agent, make the CLI and login available in that agent's environment.

Cursor skill guide ↗

Run your first review

In your repository, stage the changes you want reviewed. Ask your agent to use the Octopus skill to review that staged diff, or run:

Review staged changes
octp review --staged --no-index --format json

--staged selects the staged diff. --no-index prevents starting a new index; existing indexed context may still be used. --format json gives your agent structured findings to read before suggesting fixes.

Review an existing pull request

Request a PR review
octp review --pr 42

Run this from the matching repository and replace 42 with your PR number. Use the number for Forgejo too; native CLI 0.6.0 does not accept Forgejo PR URLs. It queues a review and posts the result to the PR when finished. A queued response is not a completed review. Follow progress in Review Logs.

CLI commands checked against native octp 0.6.0. Agent setup paths follow each tool's linked documentation; confirm skill discovery and the connection in your own session before reviewing code.

The skill or CLI is not showing up
  • Check the file's location, uppercase filename, and name: octopus frontmatter. Start a new agent session after saving it.
  • Ask the agent to run octp --version in its terminal. If the command is missing, install it on that host or in that sandbox and make it available on PATH.
  • If octp whoami fails, complete octp login in the same execution environment.
  • If a command differs from this guide, inspect octp --help and update using the CLI guide. Agent skill discovery also depends on your tool's version and permissions.