Keyoku

CLI

The keyoku binary is both the MCP server and the command-line interface. Running it with no arguments serves MCP; the subcommands cover setup, goals, approvals, and the audit trail.

Commands

CommandDescription
keyoku [serve]Run the MCP server (the default when no command is given)
keyoku initRegister the MCP server with Claude Code and install the PostToolUse activity hook
keyoku statusShow the harness status
keyoku assess <goal>Re-check a goal's criteria
keyoku watch <goal>|--all [--interval]Watch loop — re-assess one goal or all goals on an interval
keyoku learnMine patterns from traces
keyoku recordAppend an ActivityEvent — this is what the PostToolUse hook runs
keyoku approvals [approve|deny <id>]List the pending approval queue, or decide a request
keyoku audit [n]Show the append-only audit trail (optionally the last n entries)
keyoku helpShow usage
keyoku versionPrint the version

Environment variables

VariablePurpose
KEYOKU_HOMEState directory. Default: ~/.keyoku
KEYOKU_DEBUGEnable debug logging
KEYOKU_SLM_PROVIDERRefinement provider: gemini | anthropic | none
KEYOKU_SLM_MODELOverride the refinement model
GEMINI_API_KEYEnables SLM refinement via Gemini (optional)
ANTHROPIC_API_KEYEnables SLM refinement via Anthropic (optional)

Examples

# First-time setup (then restart Claude Code)
npx keyoku init

# Check that tracing is working
keyoku status

# Watch all goals, re-assessing on an interval
keyoku watch --all --interval 60

# Review and decide pending connector approvals
keyoku approvals
keyoku approvals approve <id>

# Last 20 audit entries
keyoku audit 20

Related

  • Quickstart — what init changes on your machine
  • MCP Tools — the agent-facing counterparts to these commands