Shift CLI - AI-powered code intelligence with MCP support
npm install @latentforce/shiftbash
npm install -g @latentforce/shift
`
Quick Start
$3
`bash
cd /path/to/your/project
shift-cli init --guest # Auto-creates guest key + project, scans, and indexes
`
$3
`bash
Create a new project and index it (prompts for template selection)
shift-cli init --api-key YOUR_KEY --project-name "My App"
Fully non-interactive (CI/CD friendly)
shift-cli init --api-key YOUR_KEY --project-name "My App" --template TEMPLATE_ID
`
$3
`bash
shift-cli start # Configure API key and project interactively
shift-cli init # Index project files
`
$3
`bash
claude mcp add-json shift '{"type":"stdio","command":"shift-cli","args":["mcp"],"env":{"SHIFT_PROJECT_ID":"YOUR_PROJECT_ID"}}'
`
Or using npx:
`bash
claude mcp add-json shift '{"type":"stdio","command":"npx","args":["@latentforce/shift","mcp"],"env":{"SHIFT_PROJECT_ID":"YOUR_PROJECT_ID"}}'
`
$3
Add to your config file (%APPDATA%\Claude\claude_desktop_config.json on Windows, ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
`json
{
"mcpServers": {
"shift": {
"command": "shift-cli",
"args": ["mcp"],
"env": {
"SHIFT_PROJECT_ID": "YOUR_PROJECT_ID"
}
}
}
}
`
CLI Commands
| Command | Description |
|---------|-------------|
| shift-cli start | Start daemon and configure project |
| shift-cli init | Scan and index project files |
| shift-cli update-drg | Update the dependency relationship graph |
| shift-cli stop | Stop the daemon |
| shift-cli status | Show current status |
| shift-cli config | Manage configuration |
$3
#### shift-cli init
| Flag | Description |
|------|-------------|
| --guest | Use guest authentication (auto-creates project) |
| --api-key | Provide API key directly |
| --project-name | Create new project or match existing by name |
| --project-id | Use existing project UUID |
| --template | Migration template ID for project creation |
| -f, --force | Force re-indexing even if already indexed |
#### shift-cli start
| Flag | Description |
|------|-------------|
| --guest | Use guest authentication (auto-creates project) |
| --api-key | Provide API key directly |
| --project-name | Create new project or match existing by name |
| --project-id | Use existing project UUID |
| --template | Migration template ID for project creation |
#### shift-cli update-drg
| Flag | Description |
|------|-------------|
| -m, --mode | baseline (all files) or incremental (git-changed only, default) |
$3
After initializing your project, update the dependency graph to keep code intelligence in sync:
`bash
shift-cli update-drg # Incremental (default) — only git-changed files
shift-cli update-drg --mode baseline # Full re-scan of all JS/TS files
`
Scans .js, .jsx, .ts, .tsx, .mjs, .cjs files.
MCP Tools
| Tool | Description |
|------|-------------|
| blast_radius | Analyze what files would be affected if a file is modified or deleted |
| dependencies | Get all dependencies for a file with relationship summaries |
| file_summary | Get a summary of a file with optional parent directory context |
Each tool accepts an optional project_id parameter. If not provided, it falls back to the SHIFT_PROJECT_ID environment variable.
MCP tools return formatted markdown and include:
- Path normalization — backslashes, leading ./ and / are handled automatically
- Actionable error messages — missing graph prompts you to run update-drg`, missing files explain possible causes