Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,31 +287,52 @@ Structured filters available: `framework`, `language`, `componentType`, `layer`
!.codebase-context/memory.json
```

## CLI Access (Vendor-Neutral)
## CLI Reference

You can manage team memory directly from the terminal without any AI agent:
All MCP tools are available as CLI commands — no AI agent required. Useful for scripting, debugging, and CI workflows.

Set `CODEBASE_ROOT` to your project root, or run from the project directory.

```bash
# List all memories
npx codebase-context memory list
# Search the indexed codebase
npx codebase-context search --query "authentication middleware"
npx codebase-context search --query "auth" --intent edit --limit 5

# Filter by category or type
npx codebase-context memory list --category conventions --type convention
# Project structure, frameworks, and dependencies
npx codebase-context metadata

# Search memories
npx codebase-context memory list --query "auth"
# Index state and progress
npx codebase-context status

# Add a memory
npx codebase-context memory add --type convention --category tooling --memory "Use pnpm, not npm" --reason "Workspace support and speed"
# Re-index the codebase
npx codebase-context reindex
npx codebase-context reindex --incremental --reason "added new service"

# Remove a memory
npx codebase-context memory remove <id>
# Style guide rules
npx codebase-context style-guide
npx codebase-context style-guide --query "naming" --category patterns

# Team patterns (DI, state, testing, etc.)
npx codebase-context patterns
npx codebase-context patterns --category testing

# JSON output for scripting
npx codebase-context memory list --json
# Symbol references
npx codebase-context refs --symbol "UserService"
npx codebase-context refs --symbol "handleLogin" --limit 20

# Circular dependency detection
npx codebase-context cycles
npx codebase-context cycles --scope src/features

# Memory management
npx codebase-context memory list
npx codebase-context memory list --category conventions --type convention
npx codebase-context memory list --query "auth" --json
npx codebase-context memory add --type convention --category tooling --memory "Use pnpm, not npm" --reason "Workspace support and speed"
npx codebase-context memory remove <id>
```

Set `CODEBASE_ROOT` to point to your project, or run from the project directory.
All commands accept `--json` for raw JSON output suitable for piping and scripting.

## Tip: Ensuring your AI Agent recalls memory:

Expand Down
29 changes: 29 additions & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

Technical reference for what `codebase-context` ships today. For the user-facing overview, see [README.md](../README.md).

## CLI Reference

All 10 MCP tools are exposed as CLI subcommands. Set `CODEBASE_ROOT` or run from the project directory.

| Command | Flags | Maps to |
|---|---|---|
| `search --query <q>` | `--intent explore\|edit\|refactor\|migrate`, `--limit <n>`, `--lang <l>`, `--framework <f>`, `--layer <l>` | `search_codebase` |
| `metadata` | — | `get_codebase_metadata` |
| `status` | — | `get_indexing_status` |
| `reindex` | `--incremental`, `--reason <r>` | `refresh_index` |
| `style-guide` | `--query <q>`, `--category <c>` | `get_style_guide` |
| `patterns` | `--category all\|di\|state\|testing\|libraries` | `get_team_patterns` |
| `refs --symbol <name>` | `--limit <n>` | `get_symbol_references` |
| `cycles` | `--scope <path>` | `detect_circular_dependencies` |
| `memory list` | `--category`, `--type`, `--query`, `--json` | — |
| `memory add` | `--type`, `--category`, `--memory`, `--reason` | `remember` |
| `memory remove <id>` | — | — |

All commands accept `--json` for raw JSON output. Errors go to stderr with exit code 1.

```bash
# Quick examples
npx codebase-context status
npx codebase-context search --query "auth middleware" --intent edit
npx codebase-context refs --symbol "UserService" --limit 10
npx codebase-context cycles --scope src/features
npx codebase-context reindex --incremental
```

## Tool Surface

10 MCP tools + 1 optional resource (`codebase://context`). **Migration:** `get_component_usage` was removed; use `get_symbol_references` for symbol usage evidence.
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"@typescript-eslint/typescript-estree": "^7.0.0",
"fuse.js": "^7.0.0",
"glob": "^10.3.10",
"hono": "4.11.7",
"hono": "^4.11.10",
"ignore": "^5.3.1",
"typescript": "^5.3.3",
"uuid": "^9.0.1",
Expand All @@ -142,7 +142,7 @@
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^8.51.0",
"@typescript-eslint/parser": "^8.51.0",
"eslint": "^10.0.1",
"eslint": "^9.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"globals": "^17.0.0",
Expand All @@ -160,7 +160,8 @@
"sharp"
],
"overrides": {
"@modelcontextprotocol/sdk>ajv": "8.18.0"
"@modelcontextprotocol/sdk>ajv": "8.18.0",
"minimatch": ">=10.2.1"
}
}
}
Loading