popoto.integrations.cli¶
popoto.integrations.cli
¶
popoto-memory -- the single console entry point for harness memory.
Four subcommands:
hook
Read a harness hook payload on stdin, write the harness's response on
stdout. One command string serves Claude Code and Codex, because both
send hook_event_name and this command dispatches on it.
mcp
Serve the discretionary memory tools over stdio MCP. Requires
pip install popoto[mcp].
doctor
Print resolved configuration, Redis reachability, effective retrieval
mode, record count, failure counters, and a measured hook round trip.
This is the user-visible error surface; a hook has no console.
demo
Seed a few memories, retrieve them, capture a turn, and report an
outcome, against local Redis with no harness and no API keys.
Startup latency is the reason this module imports almost nothing at module
scope. The read hook is synchronous and on the critical path of every turn,
so popoto itself, redis, and the mcp SDK are all imported inside
the subcommand that needs them.
build_parser()
¶
Construct the argument parser.
Returns:
| Type | Description |
|---|---|
ArgumentParser
|
The configured :class: |
Source code in src/popoto/integrations/cli.py
main(argv=None)
¶
Entry point for the popoto-memory console script.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
Optional[List[str]]
|
Argument list, defaulting to |
None
|
Returns:
| Type | Description |
|---|---|
int
|
A process exit code. |
int
|
because a memory failure must not fail the user's turn. |