-
-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing an Agent CLI
itsmylab edited this page Aug 4, 2026
·
1 revision
Generated from
docs/contributions/agent-cli.md. Edit the canonical source through a pull request.
Use this playbook to add a coding CLI to Canopy's launcher, lifecycle detection, session restoration, hook integration, or app-wide companion support.
flowchart TD
CLI[New agent CLI]
Launch[Launch definition]
Detect[Process identity]
Hooks{Hooks or MCP supported?}
Resume{Verified resume protocol?}
Companion{Verified structured companion transport?}
HookPath[Install and heal integration]
Restore[Enable resumable sessions]
Fallback[Terminal companion fallback]
Structured[Structured companion runner]
CLI --> Launch --> Detect --> Hooks
Hooks -- yes --> HookPath
Hooks -- no --> Resume
HookPath --> Resume
Resume -- yes --> Restore --> Companion
Resume -- no --> Companion
Companion -- yes --> Structured
Companion -- no --> Fallback
Support can land in stages. Do not claim lifecycle, resume, hook, or companion capabilities that have not been verified against the real CLI.
src/projects.ts CLI registry, launch/resume templates
src/agentModels.ts model metadata when applicable
shared/agentLife/fidelity.json lifecycle evidence capability
src-tauri/src/agentid.rs process/package identity
src-tauri/src/agents.rs hook/MCP install and healing
src-tauri/src/bin/canopy_hook.rs hook protocol and MCP server
src/companion.ts verified companion runner or fallback
docs/agent-parity.md capability audit
- Verify installation paths, executable name, launch syntax, prompt syntax, resume syntax, hook support, MCP support, session store, and model listing.
- Record the evidence in the agent parity documentation.
- Add a stable CLI ID and browser-safe display metadata.
- Add launch command construction without shell-specific assumptions.
- Add resume only if a stable session token and verified command exist.
- Extend process identity through executable, package, script, or wrapper evidence rather than tab labels.
- Declare only the lifecycle evidence the CLI can actually emit.
- Add hook/MCP configuration install and launch-time healing when supported.
- Refuse to overwrite foreign MCP registrations.
- Add model and usage adapters only when source data is reliable.
- Add a structured companion runner only for a verified protocol; otherwise retain the PTY fallback.
- Test launch, identity, profile/account behavior, resume, stale sessions, integration healing, and unsupported degradation.
flowchart LR
Process[Process tree evidence]
Hook[Hook/session digest]
Pty[Live PTY snapshot]
Usage[Usage/model data]
Fidelity[CLI fidelity manifest]
Life[Shared lifecycle ladder]
Row[Desktop and Remote agent row]
Process --> Life
Hook --> Life
Pty --> Life
Usage --> Row
Fidelity --> Life --> Row
Historical store rows without lifecycle evidence are unknown, never invented
as idle.
npm run test -- src/agentIdentity.test.ts src/agentSessions.test.ts shared/agentLife/parity.test.ts
cargo test --manifest-path src-tauri/Cargo.toml --no-default-features agentid::tests
npm run typecheck- Real CLI behavior was researched and recorded.
- Stable ID and command construction added.
- Resume is verified or deliberately absent.
- Identity does not rely on a tab title.
- Fidelity manifest claims only real signals.
- Hook/MCP integration heals safely.
- Foreign configuration is preserved.
- Companion uses structured transport only when verified.
- Unsupported features degrade honestly.
Generated from FluidWorksApp/canopy-ide. Canonical documentation changes belong in the main repository.
Canopy Architecture
- Home
- Architecture
- Core Rust System
- LLM Context
- Integration Guide
- Contribution Playbooks
- Testing and Coverage
- Publish the Wiki
Playbooks