@cotrrackpro-dev/cli
v0.1.25
Published
CoTrackPro CLI — a trauma-informed, child-centered, court-neutral documentation toolkit for developers and everyone else.
Maintainers
Readme
A trauma-informed, child-centered, court-neutral documentation toolkit for families navigating high-conflict separation — and the developers building for them. It runs in your terminal, is offline-first, and needs no account to explore.
For developers it's also a full platform CLI: authenticate with Clerk, download/publish private libraries with strict RBAC, run plugins, and launch MCP tools.
📘 New here? The How to use this repo PDF guide is a branded, five-minute walkthrough — install, the offline quickstart, authoring content, no-code apps, the community, and connecting an account. Regenerate it any time with
npm run guide:pdf(source:docs/guide/how-to-use.html).
Preview release. While the
@cotrackpronpm scope is being finalized, the CLI ships under a temporary scope: install withnpm i -g @cotrrackpro-dev/cli(the command is stillcotrackpro), or try it with no install vianpx @cotrrackpro-dev/cli. It will move to@cotrackpro/clionce the scope is available — seeCUTOVER.mdfor the scope-request draft + the one-command switch. Maintainers: seeRELEASE.mdandnode scripts/publish-dev.mjs(defaults to the@cotrrackpro-devpreview scope).
Your data stays with you. The CLI is offline-first, sends no telemetry, and keeps your credentials in your OS keychain (or an encrypted local file). See
PRIVACY.mdandSECURITY.md. The native keychain addon is an optional dependency — if your platform has no prebuild, the CLI still installs and falls back to the encrypted-file store automatically.
See it in action
No install, no sign-in — try it straight from npm (preview scope for now):
npx @cotrrackpro-dev/cli # guided menu — pick a task, no account needed
npx @cotrrackpro-dev/cli glossary token # plain-language definitions of the jargon
npx @cotrrackpro-dev/cli catalog # browse the platform catalog, fully offline
npx @cotrrackpro-dev/cli nocode examples # starter no-code apps you can build on-devicePrefer the short command? Install once and it's cotrackpro everywhere:
npm i -g @cotrrackpro-dev/cli
cotrackpro # the guided menu (welcome-back greeting + streaks)
cotrackpro community showcase # see what others built — and submit your own
cotrackpro setup # when you're ready, connect your CoTrackPro accountEverything above the setup line works offline with no account. See the
Cookbook for end-to-end recipes — connect Claude Desktop via MCP,
diagram → approve → scaffold, broker a token into a CI script, and more.
Contributing / local development
Working on the CLI itself? Run it from source with tsx:
npm install
npm run dev -- whoami # run via tsx (guided menu when run with no args)
npm run typecheck
npm test # vitest — SDK + CLI unit and integration tests
npm run test:coverage # the same, with a v8 coverage report + floorTesting. The engine and command logic (params, diagram, guide, workflow, community, scaffold, the catalog) is covered 80–100%; the rest is network/ interactive I/O shells (sign-in, keychain, transport) that aren't unit-testable. CI runs
test:coveragewith a regression floor so coverage can't crater, plus an end-to-end smoke that drives the real CLI (test/cli.integration.test.ts).
Layout
src/commands/— setup, login, whoami, org, doctor, packages, verify, scaffold, catalog, artifacts, params, diagram, guide, workflow, nocode, community, project, propose, token, mcp, plugins, tools, workspace (runcotrackpro --helpfor the full set)src/lib/— auth, output, http, credential storage, plugins, interactive UIsdk/—@cotrackpro/sdk: the typed platform client (transport, pluggable auth, typed API resources, MCP/artifact bindings). The CLI consumes it viafile:./sdk; it is built to be lifted intocotrackpro-foundationsand published.vendor/authz/— local copy of@cotrackpro/authz(the shared RBAC contract). Replace with the published@cotrackpro/authzfrom CodeArtifact when ready.
The SDK
@cotrackpro/sdk is the shared, reusable surface every cotrackpro* repo (and any
external/agent consumer) builds on instead of hand-rolling fetch + auth + errors.
See sdk/README.md. The CLI's src/lib/http.ts is now a thin
adapter over it (cliClient(cfg) / api()), and commands like whoami and org
call the SDK's typed resource methods directly.
Browse the platform's programmatic catalog from the CLI — fully offline, no auth (reads the SDK's generated registries):
cotrackpro artifacts list # all 133 typed artifacts
cotrackpro artifacts search incident # local fuzzy search
cotrackpro artifacts show incident-log
cotrackpro catalog # counts across every kind
cotrackpro catalog roles # or: artifacts | workflows | skills | knowledge | scenarios | prompt-modules | safetySpin up the whole ecosystem locally so every repo shares this CLI's SDK:
cotrackpro workspace list # the ~40 cotrackpro* repos (core | feature)
cotrackpro workspace status # which are cloned in the current dir
cotrackpro workspace clone --category core --dry-run # preview, then drop --dry-run / add --yes
cotrackpro workspace link # point each repo's @cotrackpro/sdk at ./cotrackpro-cli/sdkCreate your own parameters
Author your own parameter sets — custom typed field schemas (a small form like an
incident log or a custody-exchange checklist) — fully offline. Definitions are saved as a
standards-compliant JSON Schema in ./.cotrackpro/params/<name>.json (the same format the
portal builder produces — the same shared format
the Intervention Builder uses for its items/templates), and the
shared @cotrackpro/sdk/params logic validates, fills, and renders them everywhere.
cotrackpro params new my-set # interactive builder (or --from a JSON Schema)
cotrackpro params list # your saved sets
cotrackpro params validate my-set # check the definition
cotrackpro params fill my-set # collect values → a filled markdown document
cotrackpro params types my-set # generate a TypeScript interface
cotrackpro params prompt my-set # a prompt to paste into your AI assistant
cotrackpro scaffold my-module --params my-set # a new module pre-wired with the setDefinitions are shareable schemas (no family data). Filled documents can contain confidential information — they default to stdout,
./.cotrackpro/filled/is gitignored, and every output is educational/informational only, not legal or clinical advice.
Author from the catalog — diagrams, guides, projects, and the Studio
Compose working content from the platform catalog, fully offline. Each generator is a shared,
import-free @cotrackpro/sdk core consumed identically by the CLI and the
developer portal — so what you build in either place is the same.
# Visualize & approve: turn a document or parameter set into an approvable Mermaid diagram
cotrackpro diagram extract process.md --out docs/diagram.md
cotrackpro scaffold my-tool --diagram docs/diagram.md # builds only when Status: Approved
# Operational guides: dual-audience onboarding + feedback playbooks from the catalog
cotrackpro guide list
cotrackpro guide new school-incident-tool --out docs/onboarding.md
cotrackpro guide new school-incident-tool --prompt # a prompt to paste into your AI assistant
cotrackpro guide feedback # a GitHub "Guide feedback" issue form
# Project blueprints: scaffold an interdisciplinary starter module
cotrackpro project list
cotrackpro project new school-incident-tool
# Workflow Studio: one source → three synchronized projections
cotrackpro workflow render school-incident-tool --as playbook # the no-code markdown
cotrackpro workflow render school-incident-tool --as commands # the CLI/CloudShell sequence
cotrackpro workflow render school-incident-tool --as assets --out ./my-tool # the scaffolded filesThe Studio's three views are projections of one source, so the portal and cotrackpro workflow
produce byte-identical output — code and no-code never drift.
Build a no-code app on your device
A no-code app is a small local-first graph (.ctp.json): capture input → run simple
deterministic steps on your device → hand the heavy/AI work to an MCP tool → surface a result.
The visual, drag-and-drop authoring surface is the web builder; the CLI runs, validates,
repairs, and diagrams the app it produces — the exact same @cotrackpro/sdk/nocode core on both
sides, so definitions round-trip.
cotrackpro nocode examples # starter apps you can create
cotrackpro nocode new incident-note --out app.ctp.json # copy a starter (or `blank`)
cotrackpro nocode build # open the drag-and-drop visual builder
cotrackpro nocode fix app.ctp.json # auto-repair: derive variables + MCP allow-list
cotrackpro nocode validate app.ctp.json # schema, dangling edges, on-device ops, cycles
cotrackpro nocode run app.ctp.json --trace # run the on-device steps, show each result
cotrackpro nocode mermaid app.ctp.json # render it as a flowchart
nocode fixsaves you the toil of keepingvariablesandsettings.mcpin sync with the nodes by hand — it derives them from the graph, the same way the web builder does. Steps that call an AI/MCP tool can't run offline in the terminal, sonocode runmocks them: pass--mock <file>with sample answers keyed by"serverId/toolName"to test the whole flow.
Developer community — tiers, XP & badges
The membership-tier contract (Explorer → Builder → Scholar → Maintainer) and the recognition layer
live in @cotrackpro/sdk/community, so the Join page,
the CLI, and the cotrackpro-slack app share one source of truth. Tiers declare scopes; they
never grant them (enforcement stays server-side).
cotrackpro community tiers # capability + Slack access per tier
cotrackpro community show maintainer # one tier's cumulative scopes + channels
cotrackpro community events # the XP the community recognizes
cotrackpro community badges # the badges and how they're earned
cotrackpro community log merge-pr # track a contribution in your local ledger
cotrackpro community xp # score your local ledger (or --events / --file)
cotrackpro community card --copy # a shareable progress card, copied to your clipboard
cotrackpro community invite --copy # a referral link + message, copied to your clipboard
cotrackpro community showcase --open # submit a tool you built to the Showcase (earns Showcased)
cotrackpro feedback 👍 # tell us what's working (opens a pre-filled issue you submit)The ledger is a personal, offline tally to track your own journey — the authoritative tier/XP comes
from your CoTrackPro identity, server-side. community card turns that tally into a paste-ready
markdown snippet (XP, badges, streak + an attributable invite link) so a win can bring the next
builder in.
Gated access for developer packages (the CLI as broker)
The CLI is the single gatekeeper of your credentials. Any local package, script, or agent retrieves gated platform data through a short-lived, RBAC-scoped token the CLI mints — without ever holding credentials:
# Broker a scoped token into your shell, then run any SDK-based script:
eval "$(cotrackpro token --scopes org:packages:read --export)"
node my-script.js # uses clientFromBrokerEnv() from @cotrackpro/sdk
# Or scaffold + register a local plugin; the CLI injects a scoped token on launch:
cotrackpro scaffold reporter --plugin --scopes org:packages:read
cotrackpro plugins register ./cotrackpro-reporterIn code, a package just calls clientFromBrokerEnv() (from @cotrackpro/sdk) and gets a
client authenticated with the brokered token. The keychain and RBAC stay in the CLI.
In CI, the CLI authenticates from a COTRACKPRO_TOKEN secret (no keychain needed), so
it can broker a scoped token for the rest of a job without exposing your long-lived
credential. Drop in the bundled composite action:
- uses: dougdevitre/cotrackpro-cli/.github/actions/broker-token@main
with:
scopes: org:packages:read
token: ${{ secrets.COTRACKPRO_TOKEN }}
- run: node my-script.js # sees the masked COTRACKPRO_PLUGIN_TOKEN, not the secretSee Cookbook §5 for the raw-CLI equivalent.
Regenerate the typed registries from the CoTrackPro MCP catalog:
npm run codegen # artifacts (133) + roles/workflows/scenarios/prompt-modules
npm run codegen:check # CI drift gate — fails if generated code is staleReleases (signed binaries + installers) are added later via a separate workflow.
