Overview
The CEMS CLI provides commands for managing memories, checking system health, running maintenance, and configuring installations. It communicates with a CEMS server via HTTP API.Installation
The CLI is installed viauv tool install:
cems- Main CLIcems-server- Server componentcems-observer- Observer daemon
Configuration
Credentials are checked in order:- CLI flags:
--api-url,--api-key - Environment:
CEMS_API_URL,CEMS_API_KEY - Credentials file:
~/.cems/credentials
Credentials File
Stored at~/.cems/credentials (chmod 600):
Environment Setup
Add to your shell profile (~/.zshrc or ~/.bashrc):
CEMS_API_KEY so the MCP server can authenticate.
Global Options
Status & Health Commands
cems status
Show CEMS status and configuration.- Server URL
- User ID
- Team ID (if configured)
- Status
- Backend type
- Vector store
- Graph store
- Query synthesis enabled
- Graph statistics
cems health
Check server health.- Server status (healthy/unhealthy)
- Service name
- Mode
- Auth status
- Database status
Memory Commands
cems add
Add a memory.-s, --scope: personal or shared (default: personal)-c, --category: Memory category (default: general)-t, --tags: Tags for the memory (multiple allowed)--source-ref: Project reference (e.g., project:org/repo)--pin: Pin memory (never auto-pruned)--pin-reason: Reason for pinning
cems search
Search memories using unified retrieval pipeline.-s, --scope: personal, shared, or both (default: both)-l, --limit: Maximum results (default: 10)-t, --max-tokens: Token budget for results (default: 4000)--no-graph: Disable graph traversal--no-synthesis: Disable LLM query expansion--raw: Debug mode - bypass filtering to see all results-v, --verbose: Show full content without truncation
- Query synthesis - LLM expands query into 2-5 search terms
- Vector + graph search - pgvector HNSW and graph traversal
- Relevance filtering - Removes results below threshold
- Temporal ranking - Time decay and priority boost
- Token budgeting - Greedy selection within token budget
cems list
List memories via summary (shows memory counts by category).-s, --scope: personal or shared (default: personal)
- Category breakdown with counts
- Total memory count
cems edit
Update a memory’s content.cems delete
Delete or archive a memory.--hard: Permanently delete instead of archive
Rule Commands
Create and load reusable rule bundles for constitution/playbook memories.cems rule add
Interactive rule wizard.--kind: constitution or playbook--scope: personal or shared
- Rule kind (constitution/playbook)
- Principle number (for constitution) or rule code (for playbook)
- Short title
- Rule statement
- Category (guidelines/project)
- Scope (personal/shared)
- Source reference
- Extra tags
- Pin memory
- Pin reason
cems rule load
Load a reusable rule bundle.--file: Path to rule bundle JSON file--kind: Load default bundle for kind (constitution/playbook)--scope: Override scope for all memories--dry-run: Preview entries without writing memories
- Constitution:
docs/constitution/foundation_memory_seed.json - Playbook:
docs/constitution/playbook_memory_seed.json
Index Commands
Index repositories to extract knowledge into CEMS.cems index repo
Index a git repository.-b, --branch: Branch to index (default: main)-s, --scope: personal or shared (default: shared)-p, --patterns: Specific patterns to use (multiple allowed)
- Clones the repository
- Extracts knowledge (docs, conventions, schemas, etc.)
- Stores as pinned memories with project reference
- Files scanned
- Knowledge extracted
- Memories created
- Patterns used
- Errors (if any)
cems index path
Index a local directory path (server-side).-s, --scope: personal or shared (default: shared)-p, --patterns: Specific patterns to use (multiple allowed)
cems index patterns
List available index patterns.- Pattern name
- Description
- File patterns
- Category
readme_docs- Extract from README filesrspec_conventions- RSpec testing patternspython_conventions- Python style patternsdatabase_schemas- Database schema definitions
Maintenance Commands
Run maintenance jobs for memory system.cems maintenance run
Run a maintenance job immediately.consolidation- Merge semantic duplicates (cosine >= 0.92)summarization- Compress old memories, prune stalereindex- Rebuild embeddings, archive dead memoriesall- Run all maintenance jobs
| Job | Schedule | Purpose |
|---|---|---|
| Consolidation | Nightly 3 AM | Merge semantic duplicates |
| Observation Reflection | Nightly 3:30 AM | Condense observations per project |
| Summarization | Weekly Sun 4 AM | Compress old memories, prune stale |
| Re-indexing | Monthly 1st 5 AM | Rebuild embeddings, archive dead |
Setup & Update Commands
cems setup
Set up CEMS hooks and credentials for your IDE.--claude: Install Claude Code hooks only--cursor: Install Cursor hooks only--codex: Install Codex commands/skills only--goose: Install Goose extension config only--api-url: CEMS server URL (non-interactive)--api-key: CEMS API key (non-interactive)
- Installs hooks, skills, and settings for selected IDE(s)
- Prompts for API credentials (if not provided)
- Saves credentials to
~/.cems/credentials(chmod 600) - Saves IDE choices to
~/.cems/install.conf - Registers MCP server in IDE config
- 6 hooks in
~/.claude/hooks/ - 6 skills in
~/.claude/skills/cems/ - 2 commands in
~/.claude/commands/ - MCP server in
~/.claude.json - Settings merged into
~/.claude/settings.json
- 3 hooks in
~/.cursor/hooks/ - 5 skills in
~/.cursor/skills/ - MCP server in
~/.cursor/mcp.json
- 3 commands in
~/.codex/commands/ - 2 skills in
~/.codex/skills/ - MCP server in
~/.codex/config.toml
- MCP extension in
~/.config/goose/config.yaml
cems update
Update CEMS to the latest version.--hooks: Only re-deploy hooks/skills (skip package upgrade)
- Pulls latest from GitHub via
uv tool install - Re-deploys hooks/skills to IDEs from
~/.cems/install.conf - Logs update to
~/.cems/update.log
cems uninstall
Remove hooks/skills.--all: Remove everything including credentials
Admin Commands
Manage users and teams (requiresCEMS_ADMIN_KEY).
cems admin users
List all users.cems admin users create
Create a new user.cems admin teams
List all teams.cems admin teams create
Create a new team.Debug Commands
cems env
Output shell commands to export CEMS environment variables.CEMS_API_URLCEMS_API_KEY
cems debug
Debug utilities (implementation varies).Exit Codes
0- Success1- Error (auth failure, API error, etc.)2- CLI usage error
Related Pages
- Skills & Commands - Skills and slash commands reference
- Memory Management - Memory lifecycle and best practices
- Observer Daemon - Background session learning