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

CommandDescriptionKey Flags
analyzeRun full static analysis on the project--fix, --strict, --json
metricsCompute code metrics (LOC, complexity, etc.)--format, --output
ai-scoreGet AI-powered quality score (0–100)--model, --verbose
x ai-reportGenerate detailed AI analysis report--output, --format

2. Code Checks

CommandDescriptionKey Flags
check-unused-codeFind unused functions, classes, and variables--fix, --exclude
check-unused-filesDetect orphaned Dart files--delete, --dry-run
check-dependenciesValidate pubspec dependencies--upgrade, --outdated
check-cyclesDetect circular dependencies--graph, --max-depth
check-unused-paramsFind unused function parameters--fix, --ignore-underscore
check-dead-codeIdentify unreachable code paths--strict
check-unused-l10nFind unused localization strings--arb-dir
check-promoted-depsCheck for promoted transitive deps--fix
x check-layersEnforce architectural layer boundaries--config
x check-importsValidate import order and rules--fix, --group
x check-widgetsFlutter widget-specific checks--const, --keys
x check-asyncAsync/await and Future best practices--strict
x check-platformPlatform-specific code validation--targets
x check-codegenVerify code generation outputs--run
x check-perfPerformance anti-pattern detection--report
x cognitive-complexityCompute cognitive complexity scores--threshold, --json

3. AI Features

CommandDescriptionKey Flags
x provenanceTrace code provenance and authorship--format, --since
x conventionsLearn and enforce project conventions--learn, --apply
x driftDetect convention drift over time--baseline, --report
x predictPredict refactoring impact--scope, --dry-run
x discover-rulesAI-discover custom rules from codebase--output, --min-confidence
refactor-simSimulate refactoring suggestions--target, --diff
test-genGenerate unit tests with AI--target, --coverage
vuln-scanScan for known vulnerabilities--fix, --advisory-db
x upgrade-checkCheck upgrade path for dependencies--major, --dry-run
x aiAI setup and status (setup, status)setup, status

4. Fix & Review

CommandDescriptionKey Flags
fixAuto-fix safe issues--dry-run, --rules
reviewReview code changes (diff-aware)--base, --head
x explainExplain why a rule fired--rule, --file
x codebase-intelQuery codebase with natural language--query, --format

5. CI/CD

CommandDescriptionKey Flags
pr-commentPost analysis as PR comment--token, --pr, --repo
x webhookRun as webhook handler for CI--port, --secret
x compareCompare Falcon vs dart analyze

6. Tracking

CommandDescriptionKey Flags
x score-trackTrack AI score over time--store, --chart
x perf-trackTrack performance metrics--baseline, --report
x self-tuneAuto-tune rule thresholds from history--dry-run, --apply
x benchmarkBenchmark analysis performance--runs, --warmup
x benchmark-dbBenchmark with persistent DB--db, --compare

7. Infrastructure

CommandDescriptionKey Flags
x initInitialize Falcon config in project--force, --preset
x validateValidate falcon.yaml and config--strict
x watchWatch mode — re-run on file changes--debounce, --command
x baselineCreate or update baselinecreate
x dep-graphGenerate dependency graph--file
x workspaceMulti-package workspace support[path]
x docsGenerate documentation[output]

8. Plugins & Presets

CommandDescriptionKey Flags
x pluginPlugin management (create, list, install, search, test)create, list, install, search, test
x presetPreset management (list, show, apply)list, show, apply
x rule-docsGenerate rule documentation--output, --format
x showcaseShowcase rule examples--rule, --interactive

9. Data & Learning

CommandDescriptionKey Flags
x learnLearn patterns from codebase--output, --min-support
x fix-trackTrack fix history and effectiveness--since, --report
x suppressManage suppressionsadd, stats, list
x communityCommunity rules and contributions--list, --install
x exportExport analysis data--format, --output

10. Platform

CommandDescriptionKey Flags
x cloudCloud platform (init, add-project, dashboard)init, add-project, dashboard
x enterpriseEnterprise features (init, check, compliance, audit)init, check, compliance, audit
x marketplaceBrowse marketplace items[query]
x certifyCertify project for standards[path]
x partnersPartner integrationsno flags
x apiAPI key and endpoint management--key, --endpoint

11. Servers

CommandDescriptionKey Flags
x mcpStart MCP (Model Context Protocol) server--port, --stdio
x apiStart 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:

FlagDescription
--fixAuto-fix safe issues where possible
--strictEnable strict mode (treat warnings as errors)
--jsonOutput results in JSON format
--rulesComma-separated list of rules to run
--excludeGlob pattern to exclude files
--no-cacheDisable 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:

FlagDescription
--modelAI model to use (e.g., gpt-4, claude)
--verboseShow detailed breakdown of score
--no-aiUse heuristic-only scoring (no API calls)
--outputWrite 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:

FlagDescription
--base-refGit ref to diff against
--strictnessReview strictness level
--semanticRun dart analyze and defer overlapping Falcon findings
--baselineOnly 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:

FlagDescription
--portPort for stdio/HTTP transport (default: 3000)
--stdioUse stdio instead of HTTP
--projectPath 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:

FlagDescription
--policyPolicy file or preset to apply
--reportGenerate compliance report
--fail-onExit non-zero on specified severity
--jsonOutput in JSON format
--licenseValidate license compliance

Example:

$ falcon x enterprise check . --report
Enterprise check complete
Compliance: PASS | Policy violations: 0
Report written to enterprise-report.md