Skip to content

Otter Slash Commands

The chimera otter REPL ships with twenty-five built-in slash commands, registered in chimera/otter/slash.py and merged onto the shared chimera.cli.slash_commands registry. Many delegate to existing handlers used by chimera code and chimera mink; the otter-specific ones (e.g. /share) light up otter subsystems via late-binding so a partial wave-1 build still presents a usable REPL.

CommandArgsDescriptionSource
/helpShow all registered commands.shared
/exitLeave the REPL.shared
/quitAlias for /exit.otter
/sessions[list|<id>]List or switch sessions.otter
/newStart a new session (clears context).otter
/clearClear the current context.shared
/share[--sink file|http|stdout]Share the current session.otter
/undoUndo the last turn (placeholder).otter
/redoRedo a previously undone turn (placeholder).otter
/agent[<name>]List or switch the active agent.shared
/agentsList agent presets (alias of /agent).otter
/model[next|prev|<name>]Show or cycle the active model.shared
/models[next|prev|<name>]Alias of /model.otter
/toolsList available tools.shared
/yoloToggle bypass-permissions mode.shared
/connectConnect a provider (placeholder).otter
/mcpList MCP servers and their tools.shared
/mcpsAlias of /mcp.otter
/statusOne-screen summary of the session.shared
/doctorEnvironment health checks.shared
/configPrint the effective merged settings.shared
/costShow cumulative cost.shared
/compactCompact context (HARD threshold).shared
/initSummarise the project into AGENTS.md.shared
/themesSwitch the REPL theme (placeholder).otter
/editOpen $EDITOR for the next prompt (stub).otter

The “Source” column distinguishes:

  • shared — handler defined in chimera.cli.slash_commands (or chimera.cli.code) and reused by both mink and otter.
  • otter — handler in chimera/otter/slash.py, otter-specific.

Lists persisted otter sessions under ~/.chimera/eventlog/otter-*/. /sessions list prints the table; a bare /sessions defaults to listing. Switching to a previous session mid-REPL is a wave-2 follow-up; for now use the chimera otter sessions show <id> subcommand to inspect a transcript out of band.

Starts a fresh session. The current context is cleared; agent / model / cwd are preserved. Equivalent to the upstream /new (aliased to /clear).

Packages the current session into a transcript and dispatches it via chimera/otter/share_cmd.py. Three sinks are honored:

  • file (default) — writes ~/.chimera/shares/otter-<id>.{html,json,md}.
  • http — POSTs to $OTTER_SHARE_URL.
  • stdout — prints to the REPL.

The default $OTTER_SHARE_URL points at localhost:5174; deliberately not a third-party share endpoint. Operators host their own sink.

These are placeholder stubs printed with a “not yet wired” notice pointing at the owning issue. They exist in the registry so that:

  1. Tab-completion suggests them, helping users discover what’s coming.
  2. Documentation stays stable across milestones.
  3. The first patch landing the feature only swaps out the handler, not the registry shape.

Opens the provider-connection flow, late-binding to chimera/otter/providers.py. Equivalent to the upstream’s /connect slash. When the provider chain is already authenticated via env vars (ANTHROPIC_API_KEY, etc.), /connect reports “already connected via env” rather than re-prompting.

Alias of /mcp. Both spellings are supported because the upstream agent exposes /mcps (plural) in its TUI command palette while the shared Chimera registry uses singular /mcp. The otter palette wires both onto the same handler.

The aliases are intentional, mirroring the upstream agent’s “common typo or alternate spelling” tolerance:

CanonicalAliases
/exit/quit
/clear/new
/agent/agents
/model/models
/mcp/mcps
/sessions/resume, /continue

Slash commands defined in .opencode/command/<name>.md are loaded by chimera/otter/commands.py and merged onto the same registry (after the built-ins). They use the description frontmatter field as their help text. See docs/otter/commands.md for the file schema.

/help walks the registry and prints each command name with its help text. Custom commands are sorted alphabetically after the built-ins. The output is stable across runs so it’s safe to grep for a command in CI.

chimera/otter/slash.py exports two symbols:

  • OTTER_SLASH_COMMANDS{name: handler} dict.
  • register_otter_slash(repl_state) — installer.

The REPL’s _resolve_slash_registry() helper imports both, calls register_otter_slash() against the shared registry, and falls back to attribute-style registration for tests that pass a tiny SimpleNamespace-shaped fake.

Each handler follows the standard (session, env, args, out) signature and writes its output through out (a Callable[[str], None]). Handlers never raise; they catch unexpected exceptions and print failed: <reason> so the REPL stays usable.

tests/otter/test_slash.py covers:

  • All twenty-five commands resolvable through OTTER_SLASH_COMMANDS.
  • Each placeholder stub prints its “not yet wired” message and doesn’t raise.
  • Shared-registry passthroughs (/help, /cost, /agent, …) delegate to the canonical handlers.
  • register_otter_slash() against three REPL state shapes: register(...) method, commands mapping, plain object with setattr fallback.
  • chimera/otter/slash.py — implementation.
  • docs/otter/commands.md — custom commands ingest.
  • docs/otter/agents.md — agent presets (/agent).
  • docs/mink/slash-commands.md — the mink twin (most handlers shared).