CLI / QUICK START

Run. Read. Understand.

Use a small compiler-backed example to learn the CLI, then read findings and unknown observations together. Existing immutable snapshots and local source previews have separate workflows.

Experimental · owner-provided checkout · product 524fa07e

Get the documented checkout

Access is restricted in this pre-prod. Ask the owner for the documented checkout at product 524fa07e and Apple Swift 6.3.3 on macOS arm64. No public source or binary download is available.

The first-analysis documentation supplies the authored example sources and exact build and run steps. Manifest commands need an already supplied admitted bundle; an arbitrary compiler-produced Index Store is not enough.

Six commands, distinct inputs

source-scan builds only after explicit --allow-build. experimental-scan reads source text without building. The other commands inspect an existing admitted manifest snapshot.

source-scan

Analyze a bounded SwiftPM product with explicit build authorization.

experimental-scan

Preview 13 registered local source patterns; separate from compiler-backed coverage.

doctor

Validate manifest structure, the exact toolchain and build identity, compiler data, worlds, and requested capability quality.

stats

Inspect admitted fact and symbol statistics without treating an incomplete snapshot as a closed world.

scan

Build the advisory reachability view and publish human results or canonical JSON.

why

Explain one exact declaration or SCC identity from a scan against the same immutable manifest.

Run the shortest useful sequence

Use the documented first-analysis package and preserve stdout, stderr and the process result. These commands show the grammar; canonical JSON does not erase unknown or incomplete observations.

shell · documented grammar
swift-analyzer source-scan --package-path ./first-analysis/positive \
  --product FirstAnalysis --allow-build --include-stdio-rules --format json

Preserve every outcome

Automation must branch on the documented exit meaning. A produced report and a zero finding count do not override an incomplete capability or failed policy operation.

Exit 0 · complete

The command completed and every capability requested for that invocation was satisfied.

Exit 3 · incomplete

The command produced an incomplete capability result. Exit 3 is not a clean scan.

Other exits stay distinct

Gate failure, invalid input, unusable acquisition data, an invariant failure, and cancellation retain separate exit outcomes.

Explain an exact result

For an existing admitted manifest snapshot, take the exact canonical subject identity from its scan JSON and ask why against the same manifest. Source-scan does not export a reusable manifest bundle. Name, USR and source-location selectors are not substitutes for an exact subject.

shell · documented grammar
swift-analyzer why --manifest snapshot.json \
  --scope repository \
  --subject '<copy-the-exact-identifier>' \
  --dimension code --format human

Keep uncertainty explicit

The absence of known references does not prove that code is unused. A mismatched profile, incomplete source or index membership, an unclosed world, or unmodeled dynamic behavior keeps the affected conclusion unknown.

Correct the snapshot or extend the evidence before relying on a negative result. The current contract authorizes advisory review, not automatic deletion, autofix, or a default blocking findings gate.