A comprehensive CLI interface for the Monica CRM API, optimized for AI agents and developers.
Monica CLI provides complete access to all Monica CRM features through a command-line interface. It supports five output formats:
- toon (default): Hierarchical, human-readable format optimized for agents
- json: Standard JSON output for programmatic processing
- yaml: Structured text output for CI/CD, config-style workflows, and LLM-friendly snapshots
- table: ASCII table format for quick scanning
- md: Markdown table format for reports, documentation, and CI/CD pipelines
| Document | Description |
|---|---|
| Installation | How to install and set up Monica CLI |
| Configuration | Environment variables and configuration options |
| Commands | Complete command reference |
| API Reference | TypeScript API documentation |
| Development | Guide for contributors |
| Output Schemas | Machine-readable output contracts for automation |
| Security Audit | Secret hygiene and pre-push safety checks |
| Instance Compatibility | Endpoint support detection across Monica installs |
| Release Management | CI/CD pipelines, branch protection, and release checklist |
| First Public Release Checklist | Final go-live checklist for first npm/GitHub release |
| Changelog | Release notes history (Unreleased until first public release) |
- Broad API Coverage: Monica CRM resources are implemented with capability detection for instance/version differences
- Capability Discovery: Detect endpoint availability on your Monica instance with
monica info capabilities - Agent Planning Assist: Derive an executable command allow-list with
monica info supported-commands - Agent Context Export: Generate sanitized planning context with
monica info agent-context - Deterministic Versioning: Enforced semver-safe
YYYY.M.D(first release of day) /YYYY.M.D-<daily-release-number>versioning via bun scripts and release tags (no zero-padding; release-count-based) - Release Quality Gate:
bun run verify:releasevalidates typecheck/build/tests, packednpx/bunxexecution, and history secret scanning - Command Graph Export: Emit a machine-readable CLI command graph with
monica info command-catalog - Output Schema Registry: Discover machine contracts with
monica schemas listandmonica schemas get <id> - Secret Hygiene Audit: Run
monica --json auditbefore pushing to detect tracked secrets and unsafe config perms - Config Diagnostics: Run
monica --json config doctorfor read-only safety, settings permissions, cache freshness, and connectivity checks - API Coverage Research: Emit endpoint/resource inventory with
monica --json api-research summary --instance-aware(source select with--source auto|api|monica|<path>) - Coverage Scorecard: Use
monica --json api-research coverage --instance-awarefor compact mapped/support percentages, embeddedreadOnlyActionPlan, and deterministic next-command recommendations - Coverage CI Gates: Use
api-research coverage --fail-on-unmappedand--fail-on-unsupportedto enforce machine-checkable readiness in CI/agent pipelines (non-zero exit2withgatepayload context) - Instance Filtered API Planning: Use
--supported-only/--unsupported-onlywithapi-research summary --instance-awareto build deterministic allow/deny plans for agents - CLI Mapping Gap Detection: Use
api-research summarycliCoverage+ per-resourcecliMappingto identify Monica API resources not yet mapped to a CLI command - Backlog Extraction Filters: Use
api-research summary --mapped-only/--unmapped-onlyfor deterministic CLI parity backlogs in CI/agent workflows - Scoped Backlog/Snapshot Filters: Use the same filters directly on
api-research backlogandapi-research snapshot(--resource,--mapped-only,--unmapped-only, and instance support filters with--instance-aware) - Deterministic Backlog Output: Use
monica --json api-research backlogto emit prioritized parity tasks (missing-cli-mapping, optionalinstance-unsupported, including capability-only command gaps with--instance-aware) - Actionable Backlog Hints:
api-research backlognow includes per-itemrecommendedActionplusagentActions[]with safe fallback/planning commands for autonomous workflows - Flattened Agent Action Plan: Use
monica --json api-research actionsfor a direct, schema-backed command queue plus deduplicatedcommands[]for orchestration pipelines - Endpoint Probe Matrix: Validate documented
GETendpoint support withmonica --json api-research probefor capability-aware agent planning - One-Shot Research Snapshot: Use
monica --json api-research snapshotto combine summary, backlog, and probe data in one schema-backed payload - Type-Safe: Written in TypeScript with comprehensive type definitions
- Agent-Optimized: Default output format designed for AI agent consumption
- Help UX Quality Gates: Automated tests and full command-tree sweeps ensure every command supports detailed
--helpwith inherited global flag guidance - Help E2E Audit: Run
bun run test:e2e:helpto executemonica [command] --helpacross the full command catalog and fail on missing usage/global-option guidance - Pagination Support: Automatic pagination with
--allflag - Multiple Output Formats: toon, json, yaml, table, and md formats
- Search & Filter: Built-in search and filtering capabilities
# Install
bun install -g monica-cli
# Configure (interactive wizard)
monica setup
# Use
monica contacts list
monica contacts get 1
monica --json activities list --limit 5monica-cli/
├── src/
│ ├── index.ts # CLI entry point (boot + parse only)
│ ├── program.ts # Reusable CLI program builder
│ ├── api/ # API client modules
│ │ ├── client.ts # HTTP client
│ │ ├── contacts.ts # Contacts API
│ │ └── ... # Other resource APIs
│ ├── commands/ # CLI commands
│ │ ├── contacts.ts # Contact commands
│ │ └── ... # Other commands
│ ├── types/ # TypeScript definitions
│ ├── utils/ # Utility functions
│ │ └── settings.ts # Configuration management
│ └── formatters/ # Output formatters
│ └── toon.ts # Toon format implementation
├── tests/ # Test files
└── docs/ # Documentation
- Issues: Report bugs and request features on GitHub
- Monica API Docs: https://www.monicahq.com/api
MIT