Skip to main content

CLI Commands

Complete reference for all ArchiCore CLI commands.

Project Commands

/index

Index the current project for semantic search and analysis.

/index [--force]
OptionDescription
--forceRe-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

Semantic search across the codebase.

/search <query> [--limit N]
OptionDescription
--limitMaximum 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]
OptionDescription
--min-linesMinimum 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]
OptionDescription
--formatOutput format (default: html)
--outputOutput 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)
...

Enterprise Commands

For large projects with 50,000+ files.

/estimate

Analyze project size and get tier recommendations.

/estimate

Example:

> /estimate
Project Size Estimation
━━━━━━━━━━━━━━━━━━━━━━
Total Files 92,135
Total Size 927 MB
Recommended Tier QUICK
Estimated Time ~8 minutes

Language Distribution:
.rb 46,386 (50.3%)
.js 10,075 (10.9%)
.vue 4,333 (4.7%)

Available Tiers:
quick - 1,000 files - Fast overview
standard - 5,000 files - Balanced analysis
deep - 50,000 files - Full analysis (Enterprise)

/enterprise

Run enterprise analysis with tiered sampling.

/enterprise [tier] [strategy]
ArgumentOptionsDescription
tierquick, standard, deepAnalysis depth (default: standard)
strategysmart, hot-files, directory-balanced, randomSampling strategy (default: smart)

Examples:

> /enterprise quick
Starting quick analysis with smart sampling...
Selected 1,000 files
✓ Enterprise analysis complete!

Analysis Summary:
Tier: QUICK
Strategy: smart
Files Analyzed: 1,000
Symbols Found: 12,456
> /enterprise standard hot-files
Starting standard analysis with hot-files sampling...

Tier Descriptions

TierFilesBest For
quick1,000Fast exploration, architecture overview
standard5,000Day-to-day development, balanced analysis
deep50,000Comprehensive audits (Enterprise tier required)

Strategy Descriptions

StrategyDescription
smartAI-powered selection based on importance, imports, and git activity
hot-filesFiles with most commits in the last year
directory-balancedEqual representation from each directory
randomRandom sampling

Documentation Commands

/docs

Generate architecture documentation.

/docs [format] [output]
ArgumentOptionsDescription
formatmarkdown, htmlOutput format (default: markdown)
outputpathCustom output path (default: ARCHITECTURE.md in project root)

Example:

> /docs
Generating documentation...
✓ Documentation saved to /project/ARCHITECTURE.md

Session Commands

/history

View conversation history.

/history [search term]

Example:

> /history auth
Search results for "auth":

Session 2024-01-15:
Q: How does authentication work?
A: The auth system uses JWT tokens...

Session 2024-01-14:
Q: Where is the login logic?
A: src/auth/login.ts contains...

/resume

Resume a previous conversation session.

/resume [session_id]

Utility Commands

/help

Show available commands.

/clear

Clear the screen.

/status

Show connection status and project info.

/logout

Log out from ArchiCore.

/exit or /quit

Exit ArchiCore CLI.