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
Command
Description
keyoku [serve]
Run the MCP server (the default when no command is given)
keyoku init
Register the MCP server with Claude Code and install the PostToolUse activity hook
keyoku status
Show 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 learn
Mine patterns from traces
keyoku record
Append 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 help
Show usage
keyoku version
Print the version
Environment variables
Variable
Purpose
KEYOKU_HOME
State directory. Default: ~/.keyoku
KEYOKU_DEBUG
Enable debug logging
KEYOKU_SLM_PROVIDER
Refinement provider: gemini | anthropic | none
KEYOKU_SLM_MODEL
Override the refinement model
GEMINI_API_KEY
Enables SLM refinement via Gemini (optional)
ANTHROPIC_API_KEY
Enables 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