CLI Reference
Complete reference for Falcon — a Rust-powered Flutter/Dart static analysis tool with 74 commands. All commands support --help for detailed usage.
1. Core Analysis
| Command | Description | Key Flags |
|---|---|---|
analyze | Run full static analysis on the project | --fix, --strict, --json |
metrics | Compute code metrics (LOC, complexity, etc.) | --format, --output |
ai-score | Get AI-powered quality score (0–100) | --model, --verbose |
x ai-report | Generate detailed AI analysis report | --output, --format |
2. Code Checks
| Command | Description | Key Flags |
|---|---|---|
check-unused-code | Find unused functions, classes, and variables | --fix, --exclude |
check-unused-files | Detect orphaned Dart files | --delete, --dry-run |
check-dependencies | Validate pubspec dependencies | --upgrade, --outdated |
check-cycles | Detect circular dependencies | --graph, --max-depth |
check-unused-params | Find unused function parameters | --fix, --ignore-underscore |
check-dead-code | Identify unreachable code paths | --strict |
check-unused-l10n | Find unused localization strings | --arb-dir |
check-promoted-deps | Check for promoted transitive deps | --fix |
x check-layers | Enforce architectural layer boundaries | --config |
x check-imports | Validate import order and rules | --fix, --group |
x check-widgets | Flutter widget-specific checks | --const, --keys |
x check-async | Async/await and Future best practices | --strict |
x check-platform | Platform-specific code validation | --targets |
x check-codegen | Verify code generation outputs | --run |
x check-perf | Performance anti-pattern detection | --report |
x cognitive-complexity | Compute cognitive complexity scores | --threshold, --json |
3. AI Features
| Command | Description | Key Flags |
|---|---|---|
x provenance | Trace code provenance and authorship | --format, --since |
x conventions | Learn and enforce project conventions | --learn, --apply |
x drift | Detect convention drift over time | --baseline, --report |
x predict | Predict refactoring impact | --scope, --dry-run |
x discover-rules | AI-discover custom rules from codebase | --output, --min-confidence |
refactor-sim | Simulate refactoring suggestions | --target, --diff |
test-gen | Generate unit tests with AI | --target, --coverage |
vuln-scan | Scan for known vulnerabilities | --fix, --advisory-db |
x upgrade-check | Check upgrade path for dependencies | --major, --dry-run |
x ai | AI setup and status (setup, status) | setup, status |
4. Fix & Review
| Command | Description | Key Flags |
|---|---|---|
fix | Auto-fix safe issues | --dry-run, --rules |
review | Review code changes (diff-aware) | --base, --head |
x explain | Explain why a rule fired | --rule, --file |
x codebase-intel | Query codebase with natural language | --query, --format |
5. CI/CD
| Command | Description | Key Flags |
|---|---|---|
pr-comment | Post analysis as PR comment | --token, --pr, --repo |
x webhook | Run as webhook handler for CI | --port, --secret |
x compare | Compare Falcon vs dart analyze |
6. Tracking
| Command | Description | Key Flags |
|---|---|---|
x score-track | Track AI score over time | --store, --chart |
x perf-track | Track performance metrics | --baseline, --report |
x self-tune | Auto-tune rule thresholds from history | --dry-run, --apply |
x benchmark | Benchmark analysis performance | --runs, --warmup |
x benchmark-db | Benchmark with persistent DB | --db, --compare |
7. Infrastructure
| Command | Description | Key Flags |
|---|---|---|
x init | Initialize Falcon config in project | --force, --preset |
x validate | Validate falcon.yaml and config | --strict |
x watch | Watch mode — re-run on file changes | --debounce, --command |
x baseline | Create or update baseline | create |
x dep-graph | Generate dependency graph | --file |
x workspace | Multi-package workspace support | [path] |
x docs | Generate documentation | [output] |
8. Plugins & Presets
| Command | Description | Key Flags |
|---|---|---|
x plugin | Plugin management (create, list, install, search, test) | create, list, install, search, test |
x preset | Preset management (list, show, apply) | list, show, apply |
x rule-docs | Generate rule documentation | --output, --format |
x showcase | Showcase rule examples | --rule, --interactive |
9. Data & Learning
| Command | Description | Key Flags |
|---|---|---|
x learn | Learn patterns from codebase | --output, --min-support |
x fix-track | Track fix history and effectiveness | --since, --report |
x suppress | Manage suppressions | add, stats, list |
x community | Community rules and contributions | --list, --install |
x export | Export analysis data | --format, --output |
10. Platform
| Command | Description | Key Flags |
|---|---|---|
x cloud | Cloud platform (init, add-project, dashboard) | init, add-project, dashboard |
x enterprise | Enterprise features (init, check, compliance, audit) | init, check, compliance, audit |
x marketplace | Browse marketplace items | [query] |
x certify | Certify project for standards | [path] |
x partners | Partner integrations | no flags |
x api | API key and endpoint management | --key, --endpoint |
11. Servers
| Command | Description | Key Flags |
|---|---|---|
x mcp | Start MCP (Model Context Protocol) server | --port, --stdio |
x api | Start REST API server | --port, --host |
Detailed Command Reference
In-depth documentation for the five most important commands.
analyze
Run full static analysis on your Flutter/Dart project. This is the primary entry point for catching issues.
Full syntax:
falcon check [PATH] [OPTIONS]
Flags:
| Flag | Description |
|---|---|
--fix | Auto-fix safe issues where possible |
--strict | Enable strict mode (treat warnings as errors) |
--json | Output results in JSON format |
--rules | Comma-separated list of rules to run |
--exclude | Glob pattern to exclude files |
--no-cache | Disable analysis cache |
Example:
$ falcon check . --fix --json
{"issues": 12, "fixed": 3, "warnings": 9}
ai-score
Get an AI-powered quality score (0–100) for your project. Uses static analysis plus optional AI models for deeper insights.
Full syntax:
falcon score [PATH] [OPTIONS]
Flags:
| Flag | Description |
|---|---|
--model | AI model to use (e.g., gpt-4, claude) |
--verbose | Show detailed breakdown of score |
--no-ai | Use heuristic-only scoring (no API calls) |
--output | Write report to file |
Example:
$ falcon score .
Analyzing project...
AI Score: 78/100
Suggestions: 3 improvements found
review --format gh
Print PR-ready markdown for changed Dart files. Pipe the output into your GitHub CLI or CI comment step when you want to post it.
Full syntax:
falcon review [PATH] --format gh [OPTIONS]
Flags:
| Flag | Description |
|---|---|
--base-ref | Git ref to diff against |
--strictness | Review strictness level |
--semantic | Run dart analyze and defer overlapping Falcon findings |
--baseline | Only report findings not present in a baseline file |
Example:
$ falcon review . --base-ref origin/main --format gh | gh pr comment --body-file -
## Falcon Review
Changed Dart files analyzed with PR-ready markdown output.
mcp
Start the Model Context Protocol (MCP) server. Enables AI assistants like Cursor to query your codebase via Falcon.
Full syntax:
falcon x mcp [OPTIONS]
Flags:
| Flag | Description |
|---|---|
--port | Port for stdio/HTTP transport (default: 3000) |
--stdio | Use stdio instead of HTTP |
--project | Path to project to analyze |
Example:
$ falcon x mcp --stdio --project .
MCP server listening on stdio
Ready for connections
enterprise check
Run enterprise compliance and policy checks. Validates licensing, security, and organizational standards.
Full syntax:
falcon x enterprise check [PATH] [OPTIONS]
Flags:
| Flag | Description |
|---|---|
--policy | Policy file or preset to apply |
--report | Generate compliance report |
--fail-on | Exit non-zero on specified severity |
--json | Output in JSON format |
--license | Validate license compliance |
Example:
$ falcon x enterprise check . --report
Enterprise check complete
Compliance: PASS | Policy violations: 0
Report written to enterprise-report.md