The keyoku binary is both the MCP server and the command-line interface. Running it with no arguments serves MCP; the subcommands cover setup, import and export, privacy, goals, approvals, and the audit trail.
Commands
Command
Description
keyoku [serve]
Run the MCP server (the default when no command is given)
keyoku init [--codex]
Register the MCP server (Claude Code, plus Codex if ~/.codex exists or --codex is passed) and install the three hooks: PostToolUse, SessionStart, UserPromptSubmit
keyoku status
Show the harness status
keyoku assess <goal>
Re-check a goal's criteria
keyoku watch <goal>|--all [--interval s]
Watch loop — re-assess one goal or all goals on an interval
keyoku learn
Mine reusable patterns from your goals + traces (richer with an SLM key; a heuristic floor runs without one)
keyoku backfill [--dry-run]
Repopulate hollow learned workflows — lifts the steps from your activity log for goals that converged without recording them
keyoku refine <slug> [--apply]
Turn a workflow's raw captured steps into a clean, {{parameterized}} template; --apply saves it runnable via workflow_execute
keyoku inspect [--secrets]
Show exactly what's stored in ~/.keyoku (counts, file sizes + permissions, recording state); --secrets scans the activity log for leaks
keyoku record
Append an ActivityEvent — this is what the PostToolUse hook runs
keyoku brief
Print the session brief — what the SessionStart hook injects (workflows available, unsaved patterns)
keyoku context
Print prompt-time context — what the UserPromptSubmit hook injects (matching workflows, house patterns)