Skip to content

Add amika-cli skill documenting the CLI for agents - #315

Merged
dbmikus merged 2 commits into
mainfrom
dylan/amika-cli-skill
Aug 9, 2026
Merged

Add amika-cli skill documenting the CLI for agents#315
dbmikus merged 2 commits into
mainfrom
dylan/amika-cli-skill

Conversation

@dbmikus

@dbmikus dbmikus commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Adds .agents/skills/amika-cli/SKILL.md, an agent-facing guide to driving the
amika CLI non-interactively. The same file is going into amika-mono (branch
dylan/amika-cli-skill) so both repos' agents share one description of the CLI —
the two copies are byte-identical.

The skill covers remote sandboxes only, which is what the CLI targets by
default.

What it covers

Aimed at what agents get wrong on the first try, rather than restating per-flag
detail:

  • Auth resolution order, with AMIKA_API_KEY called out as the headless
    path.
  • Four rules for non-interactive use: ask for JSON, pass the confirmation
    flag, don't request JSON from commands that can't emit it, and don't launch an
    interactive session you can't steer (with a tmux exception for REPLs and
    TUIs).
  • .amika/config.toml — per-repo sandbox defaults and the
    flags > UI > file > defaults resolution order.
  • sandbox create, agent-send, ssh/scp, snapshots, services, and
    environment variables.

Findings from writing it

Scoping the skill to remote surfaced a few things worth knowing independently of
the doc:

  • createRemoteSandbox returns before --mount, --volume, --port,
    --port-host-ip, --image, --provider, and --yes are read.
    On remote
    those flags are silently ignored, not merely unsupported — no error, no
    warning.
  • Remote sandbox delete never prompts, so --force is a no-op on that path
    too. The confirmation-flag table is therefore just snapshot create/snapshot delete/service delete.
  • secret push always reads [y/N] from stdin with no bypass flag, so
    scripted use needs echo y | amika secret push ….

Verification

Behavioral claims were exercised against the installed amika v0.13.0 binary,
whose CLI sources are identical to main — every rejection message, the
[]-not-null empty list, the unknown agent error, and default-remote
resolution against an empty AMIKA_STATE_DIRECTORY. Remote-path flag handling
was read from sandbox_create.go and sandbox_delete.go rather than tested,
since exercising it would create and destroy real sandboxes.

Follow-up, not fixed here

docs/cli-reference.md has drifted. I left it alone rather than widen this PR:

  • Documents amika auth extract with an --export flag; that command is gone
    (it is now amika secret extract, which has no --export).
  • No sections for amika service, amika snapshot, or secret codex.
  • Missing auth login --api-key-file, AMIKA_API_KEY, secret --scope/--force, sandbox create --size/--github-auth-mode/--agent-credential*, sandbox ssh --print,
    agent-send --session-id/--new-session.
  • --preset is documented as coder or claude; the binary accepts coder or
    coder-dind.
  • Claims the local/remote default depends on login state and that both are listed
    at once; runmode.Resolve only checks --local, and sandbox list is
    strictly either/or.
  • Documents --mount/--volume/--port/--yes on sandbox create without
    noting they apply to local sandboxes only.
  • The sandbox list column is CREATOR, not CREATED BY.

Happy to take that on in a separate PR if it's wanted.

Stack

  1. dylan/amika-cli-skill #THIS ← you are here
  2. dylan/ssh-impl-no-relay Add the amikad sandbox daemon and the no-relay WebSocket SSH path #316
  3. dylan/no-ssh-keygen-yet-fix Fix the managed sshd port, add amika scpv2, and scope SSH sessions per control plane #321
  4. dylan/ssh-websocket-code-review Resolve SSH relay review annotations and document the connect-token round trip #322

Adds `.agents/skills/amika-cli/SKILL.md`, an agent-facing guide to
driving the `amika` CLI non-interactively.

`docs/cli-reference.md` already covers per-flag detail, but reads as a
human reference: it does not explain that sandbox commands default to
`--remote`, which commands reject `-o json`, or which confirmation flags
an unattended run must pass to avoid blocking on a prompt. Agents get
those wrong first. The skill leads with the local/remote model, the
credential resolution order (`AMIKA_API_KEY` first, for headless runs),
and four rules for non-interactive use, then covers sandbox creation,
`agent-send`, `ssh`/`scp`, snapshots, services, and environment
variables.

Every claim was checked against `amika` v0.13.0, whose CLI sources match
`main`.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b6be25b99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .agents/skills/amika-cli/SKILL.md Outdated
Comment on lines +91 to +93
schema. Batch mutations (`start`/`stop`/`delete` over several names) emit an
array of `{name, status, error?}` — a per-item failure shows up there, so check
it rather than trusting the exit code alone.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe successful start/stop results as sandbox resources

sandbox start and sandbox stop do not emit {name, status, error?} for successful targets: the reviewed implementation appends each target's final RemoteSandbox, while only failed targets use ItemResult. A consumer expecting .status on every successful entry will therefore receive null; document the mixed resource/error array separately from delete results.

AGENTS.md reference: AGENTS.md:L114-L114

Useful? React with 👍 / 👎.

Comment thread .agents/skills/amika-cli/SKILL.md Outdated

| Only remote | Only local |
| ----------- | ---------- |
| `sandbox ssh`, `sandbox code`, and `scp` sandbox operands | `sandbox create --no-clean` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark ignored remote creation flags as local-only

Because remote mode is the documented default, listing only --no-clean as local-only implies that host mounts, volumes, ports, custom images, and providers work remotely. In sandbox_create.go, the local path reads --image, --mount, --volume, --port, --port-host-ip, and --provider, but createRemoteSandbox never puts any of them in CreateSandboxRequest, so these accepted flags are silently ignored and the created sandbox lacks the requested resources.

Useful? React with 👍 / 👎.

Comment on lines +250 to +251
`amika scp` forwards every argument to the system `scp`, so `-r`, `-p`, `-C`,
`-v`, `-o Option=value` all work. Path forms:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit the advertised scp flags on streamed transfers

For the common local-to-sandbox or sandbox-to-local case, runSCP uses planStreamTransfer instead of the system scp; splitOperandsAndFlags retains only -r and discards options such as -p, -C, -v, and user-supplied -o. Thus, for example, -p will not preserve modes or timestamps despite this promise, potentially leaving uploaded executables unusable; restrict this claim to transfers that actually take the scp path and document the streamed path's supported flags.

Useful? React with 👍 / 👎.

```bash
amika scp ./local.txt my-sandbox:local.txt
amika scp -r my-sandbox:/srv/out ./out
amika scp my-sandbox:/data.csv scp://user@host:22/tmp/data.csv

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the unsupported sandbox-to-external copy example

This example is exactly a sandbox-to-external transfer, which the following paragraph says is unsupported. planStreamTransfer excludes that shape and falls back to the system scp path; the implementation documents that this path can hang against the Daytona gateway after transferring the data. An agent following the example can therefore block indefinitely, contrary to this skill's non-interactive goal; show the required two-step local copy instead.

Useful? React with 👍 / 👎.

Comment thread .agents/skills/amika-cli/SKILL.md Outdated
| `AMIKA_API_URL` | Remote API base URL (default `https://app.amika.dev`) |
| `AMIKA_WORKOS_CLIENT_ID` | WorkOS client id for device login; change it alongside `AMIKA_API_URL` |
| `AMIKA_STATE_DIRECTORY` | State dir (default `$XDG_STATE_HOME/amika`, else `~/.local/state/amika`) — holds sandbox/volume/mount state, session, and API key |
| `AMIKA_SANDBOX_PROVIDER` | Override the sandbox provider |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the nonexistent provider override environment variable

Exporting AMIKA_SANDBOX_PROVIDER does not select or override a provider. A repo-wide search at the reviewed commit finds it only as an environment marker consumed by the sandbox preset's pre-setup.sh; the host CLI never reads it for provider selection, which instead uses --provider locally and server configuration remotely. Agents following this table will believe they changed providers while their commands continue using the previous/default provider.

Useful? React with 👍 / 👎.

Processes the `#amika/annotate` markers left on the skill. The skill now
covers remote sandboxes only, which is what the CLI targets by default.

Removes local-mode coverage, mounts and mount modes, the `amika volume`
family, the WorkOS name (now "browser-authed session"), the
`docs/cli-reference.md` pointer, and the instruction to run
`amika version`.

Dropping mounts exposed a wider gap: `createRemoteSandbox` returns before
`--mount`, `--volume`, `--port`, `--port-host-ip`, `--image`,
`--provider`, and `--yes` are read, so those are silently ignored on
remote rather than merely unsupported. Remote `sandbox delete` likewise
never prompts, making `--force` a no-op there. The create-flag list and
the confirmation-flag table now reflect only what the remote path
actually consumes.

Adds a `.amika/config.toml` section covering per-repo sandbox defaults
and the flags > UI > file > defaults resolution order, and notes that
`secret push` always reads `[y/N]` from stdin with no bypass flag.

Rule 4 now allows an interactive session when the caller can steer a TTY
(a tmux session or pane), which is how to reach a REPL or TUI inside a
sandbox.

Tables are pipe-aligned to match the convention in amika-mono, where
this file also lives byte-identical.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cfc32a9e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +282 to +284
`--mode` is `scrub_and_delete` (removes injected secrets) or `full`. Prefer
`scrub_and_delete` unless you have a reason to bake credentials into an image
others can fork.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge State that scrub_and_delete destroys the source sandbox

When an agent follows the non-interactive example above, scrub_and_delete removes the injected secrets and then deletes the source sandbox; runSnapshotCreate makes this explicit in its confirmation text (snapshot the sandbox, and delete it?). Describing the mode only as removing secrets, and recommending it by default, can cause an unattended run to destroy a sandbox that the caller expected to keep, so document the deletion next to the example and mode description.

Useful? React with 👍 / 👎.

| `sandbox delete` (`rm`) | Delete sandboxes; multiple names |
| `sandbox agent-send` | Send a prompt to a coding agent running inside a sandbox |
| `sandbox ssh` | SSH in, or run one command; `--print` emits the connection string; `--revoke` revokes access |
| `sandbox connect` | Interactive shell (`--shell`, default `zsh`), starting at `/home/amika` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not advertise --shell for remote connect

In the remote context assumed throughout this skill, sandbox connect --shell bash does not select bash: the remote branch of sandboxConnectCmd ignores the parsed shell value and calls ssh.ExecSSH with no command, so the server's default login shell opens instead. Although sandbox connect --help describes --shell as the “Shell to run in the sandbox container,” this behavior is only implemented by the local Docker branch; qualify the flag as local-only or omit it here.

Useful? React with 👍 / 👎.

Comment on lines +227 to +228
`--workdir` defaults to `$AMIKA_AGENT_CWD`, which `sandbox create` sets to the
checked-out repo path.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify --workdir as unsupported by synchronous remote sends

For the default synchronous remote agent-send path, runRemoteAgentSend accepts workdir but does not put it in apiclient.AgentSendRequest; only the --no-wait SSH path uses it to build the shell command. Thus an agent relying on the advertised “Working directory inside the container” flag to run a normal synchronous request in another directory will silently execute in the server-selected directory, potentially editing the wrong checkout; restrict this guidance to the paths that honor the flag.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant