CLI Commands
Complete reference for all ArchiCore CLI commands.
Project Commands
/index
Index the current project for semantic search and analysis.
/index [--force]
| Option | Description |
|---|---|
--force | Re-index even if already indexed |
Example:
> /index
Indexing project...
✓ Scanned 234 files
✓ Extracted 1,847 symbols
✓ Generated embeddings
✓ Index complete in 45s
/status
Show project indexing status and statistics.
/status
Example:
> /status
Project: my-app
Status: Indexed
Files: 234
Symbols: 1,847
Last indexed: 2 hours ago
Search Commands
/search
Semantic search across the codebase.
/search <query> [--limit N]
| Option | Description |
|---|---|
--limit | Maximum results (default: 10) |
Example:
> /search user authentication flow
Found 5 results:
1. src/auth/login.ts:45
LoginService.authenticate() - Main authentication logic
2. src/middleware/auth.ts:12
authMiddleware() - JWT token validation
3. src/services/user.ts:78
UserService.validateCredentials() - Password verification
Analysis Commands
/analyze
Analyze impact of changes to a file or directory.
/analyze <path>
Example:
> /analyze src/auth/login.ts
Impact Analysis for src/auth/login.ts
Direct dependencies (5):
→ src/services/user.ts
→ src/services/session.ts
→ src/utils/crypto.ts
→ src/config/auth.ts
→ src/types/auth.ts
Affected by changes (12 files):
← src/routes/auth.ts
← src/middleware/auth.ts
← tests/auth.test.ts
...
Risk level: MEDIUM
Recommendation: Changes require testing auth flow
/metrics
Calculate code quality metrics.
/metrics [path] [--format json|table]
Example:
> /metrics src/
Code Metrics for src/
┌──────────────────┬─────────┐
│ Metric │ Value │
├──────────────────┼─────────┤
│ Total Files │ 45 │
│ Lines of Code │ 8,234 │
│ Avg Complexity │ 4.2 │
│ Max Complexity │ 18 │
│ Duplication │ 3.2% │
│ Test Coverage │ 67% │
└──────────────────┴─────────┘
/security
Scan for security vulnerabilities.
/security [--severity high|medium|low]
Example:
> /security
Security Scan Results
🔴 HIGH (2 issues)
• SQL Injection risk in src/db/query.ts:34
• Hardcoded secret in src/config/keys.ts:12
🟡 MEDIUM (5 issues)
• Missing input validation in src/api/users.ts:56
• Weak crypto algorithm in src/utils/hash.ts:23
...
🟢 LOW (8 issues)
...
/dead-code
Find unused code (dead code detection).
/dead-code [--include-tests]
Example:
> /dead-code
Dead Code Analysis
Found 12 unused exports:
src/utils/helpers.ts
• formatDate() - line 45
• parseQuery() - line 78
src/services/legacy.ts
• OldService class - entire file
src/types/deprecated.ts
• LegacyUser type - line 12
Estimated removable: 234 lines
/duplication
Find code duplication.
/duplication [--min-lines N]
| Option | Description |
|---|---|
--min-lines | Minimum lines to consider duplicate (default: 5) |
Architecture Commands
/rules
Manage architecture rules.
/rules [list|add|validate]
Examples:
> /rules list
Architecture Rules:
1. no-circular-deps
No circular dependencies between modules
2. layer-isolation
Controllers cannot import from repositories directly
3. naming-convention
Services must end with "Service"
> /rules validate
Validating architecture rules...
✓ no-circular-deps: PASSED
✗ layer-isolation: FAILED
- src/controllers/user.ts imports src/repositories/user.ts
✓ naming-convention: PASSED
1 of 3 rules failed
Export Commands
/export
Export analysis report.
/export [--format html|json|pdf] [--output path]
| Option | Description |
|---|---|
--format | Output format (default: html) |
--output | Output file path |
Example:
> /export --format html --output report.html
Generating report...
✓ Report saved to report.html
AI Commands
Natural Language Questions
Just type your question without any prefix:
> How does the authentication system work?
The authentication system in this project uses JWT tokens...
Key files:
- src/auth/login.ts - Login endpoint
- src/middleware/auth.ts - Token validation
- src/services/session.ts - Session management
> What would break if I changed UserService?
Changing UserService would affect:
1. AuthController (src/controllers/auth.ts)
2. ProfileController (src/controllers/profile.ts)
...
Utility Commands
/help
Show available commands.
/clear
Clear the screen.
/exit or /quit
Exit ArchiCore CLI.