AgenticPlanning
Runtime, Installation & Sync
Operations for installing, running, and managing AgenticPlanning instances.
Operations for installing, running, and managing AgenticPlanning instances.
Installation
From Source
git clone https://github.com/agentra/agentic-planning
cd agentic-planning
cargo build --release
# Binary at target/release/aplanCargo Install
cargo install agentic-planning-cliThis places the aplan binary in ~/.cargo/bin/. Ensure this is on your PATH.
Verify
aplan versionRuntime Detection
The CLI determines engine mode from the --file flag:
- No
--file— In-memory mode. State exists only for the duration of the command. Each invocation starts fresh. --file project.aplan— File-backed mode. Loads existing state or creates a new file. Every mutation triggers an atomic save.
The serve command follows the same pattern:
aplan serve # In-memory MCP server
aplan serve --file project.aplan # Persistent MCP serverMCP Server Lifecycle
Stdio Mode (Default)
aplan serve --mode stdioThe server communicates over stdin/stdout using Content-Length framed JSON-RPC 2.0 — the standard MCP transport protocol. Each message is prefixed with Content-Length: <bytes>\r\n\r\n.
The server handles three phases:
- Initialize — Client sends
initializerequest. Server responds with capabilities (13 tools, resources, prompts). - Operation — Client sends
tools/callrequests. Server processes and responds. - Shutdown — Client sends
shutdownor closes stdin. Server exits cleanly.
HTTP Mode
aplan serve --mode http --port 3000HTTP transport on the specified port. Same JSON-RPC 2.0 protocol over HTTP POST requests.
Daemon Mode
Background monitoring for stale goals, at-risk commitments, and blocked progress:
# Start daemon with default 300-second interval
aplan daemon start --file project.aplan
# Custom interval
aplan daemon start --file project.aplan --interval_secs 60
# Stop daemon
aplan daemon stopThe daemon periodically:
- Checks for goals with rising neglect (no progress updates)
- Flags commitments approaching their deadlines
- Detects blocked goals that need attention
- Logs warnings to stderr
Workspace Management
Workspaces isolate planning contexts within a single engine:
# Create a workspace
aplan workspace create --name "backend-v2"
# List workspaces
aplan workspace list
# Switch active workspace
aplan workspace switch --name "backend-v2"
# Compare planning state across workspaces
aplan workspace compare --a "backend-v2" --b "frontend-v2"All goal, decision, and commitment operations apply to the active workspace.
Multi-Instance Access
Multiple CLI or MCP instances can reference the same .aplan file. The engine uses atomic writes (write to .tmp, fsync, rename) so readers never see a partially written file.
Concurrency model:
- Each engine instance loads the full file on startup
- Writes are atomic — no partial reads possible
- No file-level locking — last writer wins
- For coordinated multi-agent access, use federation instead of shared files
Best practice: Use one MCP server instance per .aplan file. Multiple agents connect to the same server via MCP rather than opening the file independently.
State Migration
The .aplan file is fully self-contained. To migrate planning state:
# Copy to another machine
scp project.aplan user@remote:/path/to/project.aplan
# Open on the remote machine
aplan --file /path/to/project.aplan goal listThe file contains all goals, decisions, commitments, dreams, federations, soul archives, and indexes. No external database or service required.
Crash Recovery
If the process crashes during a save, the engine recovers automatically on next load:
.aplan exists | .aplan.tmp exists | Action |
|---|---|---|
| No | No | Create new empty file |
| No | Yes | Recover: rename .tmp to .aplan, then load |
| Yes | No | Normal load |
| Yes | Yes | Load .aplan (complete), delete stale .tmp |
No manual intervention required. The atomic write strategy ensures the .aplan file is always either the previous valid version or the new valid version.