@noalia/code-titan
v1.0.2
Published
Command-line interface for CodeTitan code analysis
Maintainers
Readme
CodeTitan CLI
Command-line interface for CodeTitan - AI-powered code analysis with TITAN MODE™ 8-level autonomy.
Installation
npm install -g @codetitan/cliQuick Start
- Login with your API key:
codetitan login- Analyze your code:
codetitan analyze ./src --level 5Global Options
These options work with all commands:
| Option | Description |
|--------|-------------|
| -q, --quiet | Suppress non-essential output (ideal for CI) |
| --no-color | Disable colored output |
| -V, --version | Display version number |
| -h, --help | Display help for command |
Commands
Authentication
codetitan login
Authenticate with your API key. Your key will be stored securely in ~/.config/codetitan/config.json.
codetitan login
# Prompts for API keycodetitan logout
Remove saved credentials from your system.
codetitan logoutcodetitan whoami
Display information about the currently authenticated user.
codetitan whoamiCode Analysis
codetitan analyze [path]
Analyze code at the specified path.
Options:
-l, --level <number>- Analysis level (1-8), default: 4-f, --format <type>- Output format (json|markdown|console), default: console-o, --output <file>- Save output to file-u, --upload- Upload report to CodeTitan Cloud--single-file- Analyze only the target file (faster)--with-context- Analyze file with full project context
Examples:
# Basic analysis
codetitan analyze
# Analyze specific path with level 8
codetitan analyze ./src --level 8
# Output as JSON and save to file
codetitan analyze --format json --output results.json
# Maximum analysis level
codetitan analyze --level 8 --format markdownProject Management
codetitan projects list
List all your projects.
codetitan projects listcodetitan projects create
Create a new project.
Options:
-n, --name <name>- Project name-d, --description <description>- Project description-r, --repo <url>- Repository URL
Examples:
# Interactive creation
codetitan projects create
# Create with options
codetitan projects create --name "My App" --description "Production app" --repo "https://github.com/user/repo"codetitan projects delete <id>
Delete a project by ID.
codetitan projects delete abc-123-defAPI Key Management
codetitan keys list
List all your API keys.
codetitan keys listcodetitan keys create
Create a new API key.
Options:
-n, --name <name>- Key name
Examples:
# Interactive creation
codetitan keys create
# Create with name
codetitan keys create --name "Production Key"⚠️ Important: API keys are shown in full only once upon creation. Save them securely!
codetitan keys revoke <id>
Revoke an API key by ID.
codetitan keys revoke abc-123-defUsage Statistics
codetitan usage
View your usage statistics for the current billing period.
Options:
-f, --format <type>- Output format (table|json), default: table
Examples:
# View usage as table
codetitan usage
# Export usage as JSON
codetitan usage --format jsonConfiguration
The CLI stores configuration in ~/.config/codetitan/config.json (or platform equivalent).
Configuration options:
apiKey- Your API keyapiEndpoint- API endpoint URL (default: https://api.codetitan.dev)defaultLevel- Default analysis level (default: 4)defaultFormat- Default output format (default: console)
TITAN MODE™ Levels
| Level | Name | Capability | |-------|------|------------| | 1 | TITAN BASELINE | Core static analysis, AST parsing, pattern matching | | 2 | TITAN ACCELERATED | Parallel processing, smart caching, incremental analysis | | 3 | TITAN COMPREHENSIVE | 5-domain analysis, cross-file analysis, dependency graphs | | 4 | TITAN DEEP ANALYSIS | Semantic analysis, data flow tracking, taint analysis | | 5 | TITAN REMEDIATION | Auto-fix generation, multi-AI verification, safe refactoring | | 6 | TITAN INTELLIGENCE | ML-powered analysis, pattern recognition, adaptive thresholds | | 7 | TITAN COLLECTIVE | Cross-project learning, industry benchmarking, trend prediction | | 8 | TITAN SENTINEL | Self-healing infrastructure, autonomous incident response |
Subscription Access:
- Free: Levels 1-3 (Baseline → Comprehensive)
- Starter ($29/mo): Levels 1-5 (+ Deep Analysis & Remediation)
- Professional ($99/mo): Levels 1-8 (Full Titan Mode™)
Output Formats
Console (default)
Human-readable output with colors and formatting.
JSON
Machine-readable JSON output for integration with tools.
codetitan analyze --format json | jq .Markdown
Formatted markdown report for documentation.
codetitan analyze --format markdown --output ANALYSIS.mdError Codes
- 401 Unauthorized: Invalid or missing API key
- 403 Forbidden: Insufficient permissions or subscription tier
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server error (please report)
Getting an API Key
- Visit codetitan.dev/dashboard/api-keys
- Click "Create API Key"
- Give it a name and copy the key
- Run
codetitan loginand paste your key
Subscription Tiers
| Tier | Price | API Calls | Analysis Levels | Projects | |------|-------|-----------|-----------------|----------| | Free | $0/mo | 100/month | 1-3 | 1 | | Starter | $29/mo | 1,000/month | 1-5 | 10 | | Professional | $99/mo | 10,000/month | 1-8 | Unlimited |
Upgrade at codetitan.dev/dashboard/billing
Examples
CI/CD Integration
# .github/workflows/code-quality.yml
name: Code Quality
on: [push, pull_request]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install -g @codetitan/cli
- run: echo "${{ secrets.CODETITAN_API_KEY }}" | codetitan login
- run: codetitan analyze --level 6 --format json --output analysis.json
- uses: actions/upload-artifact@v3
with:
name: analysis-results
path: analysis.jsonPre-commit Hook
#!/bin/bash
# .git/hooks/pre-commit
codetitan analyze --level 4 || {
echo "Code analysis failed. Fix issues before committing."
exit 1
}Scheduled Analysis
# Crontab: Run daily at 2 AM
0 2 * * * cd /path/to/project && codetitan analyze --level 5 --output daily-report.mdSupport
- Documentation: docs.codetitan.dev
- Dashboard: codetitan.dev/dashboard
- Support: codetitan.dev/contact
- GitHub: github.com/codetitan/cli
License
MIT © CodeTitan
