Reference

CLI reference

Every atmos subcommand and flag. PATH is a file or a directory, and the files a scan picks up are listed in language support.

Commands#

CommandWhat it does
atmos scan <PATH>Code and dependencies in one run, closing with one summary. The default.
atmos sast <PATH>Code analysis only.
atmos sca <PATH>Dependency analysis only.
atmos agent setup [<PATH>]Set up a repository so Atmos checks the files an agent edits at the end of each turn and sends the findings in them back to the agent. Only you get the hook. See coding agents.
atmos agent hookWhat your agent runs after each file edit and at the end of each turn. Setup configures it for you.
atmos loginSign this machine in: a link opens in your browser, you approve, and the sign-in is stored for every later command. Once per machine. --no-browser only prints the link.
atmos logoutRevoke this machine's sign-in and forget it.
atmos whoamiShow who is signed in, to which workspace, and where the sign-in comes from. See atmos whoami.
atmos db updateDownload or refresh the local advisory database. Runs without any credential.
atmos self-updateUpdate the binary in place.
atmos licensesPrint the license you run Atmos under. --third-party prints the third-party notices instead.

atmos whoami#

Before a scan in a new terminal or CI job, atmos whoami asks Atmos who the sign-in belongs to and prints the account, the workspace and the source of the sign-in: atmos login, ATMOS_TOKEN or --token, in the order a scan uses them. Pass --token <TOKEN> to check that Workspace Token instead.

SituationWhat it printsExit code
Signed inThe account, the workspace and the source of the sign-in.0
Not signed inAn error that says how to sign in.3
Sign-in rejectedAn error that says to run atmos login again or to check the token. A revoked or expired sign-in gets this.3
Cannot scanThe account and the workspace, then why Atmos refuses scans with this sign-in: you are a viewer in the workspace, or its workspace was deleted or you are not a member of it. Run atmos login to choose a workspace.3
Atmos unreachableWhat atmos login recorded on this machine, with a note that the sign-in was not checked.0

With --format json, atmos whoami prints one object:

  • signed_in, and source: login, ATMOS_TOKEN or --token.
  • email (null for a Workspace Token) and workspace.
  • verified, false when Atmos could not be reached, and can_scan, null when not verified.
  • reason, viewer or no_active_workspace when Atmos refuses scans, with an error object whose code is scan_refused.

Without a sign-in, or with a rejected one, the output is the error object a scan prints.

Platform flags#

Shared by every scan subcommand.

FlagWhat it does
--token <TOKEN>Workspace Token (atmos_ws_...) for CI and other headless environments. Falls back to ATMOS_TOKEN, then to the sign-in stored by atmos login. A scan with none of the three does not run.
--repo <ID>Name the repository (host/owner/name) when it has no git origin remote. Every scan needs the name, and a scan adds the repository to your workspace.
--no-uploadKeep the findings on this machine and upload nothing. The scan still needs network access and still adds the repository to your workspace. Only .atmos-ignore.yaml then decides which findings fail the build. See triage on the platform.
--snippetsInclude the matched source line in the upload and in SARIF output. Off by default. See what leaves your machine.

Shared flags#

Also on scan, sast and sca.

FlagWhat it does
--baseline-commit <REF>Report and fail only on the findings the baseline commit does not have: the commit where your branch left <REF>. A GitHub Actions pull request and a GitLab merge request pipeline use their target branch without the flag. A <REF> the checkout does not have stops the scan with exit code 2. See fail only on new findings.
--fail-on <SEVERITY>The lowest severity that fails the build, from critical down to info. Findings below it stay in the report. Without the flag, every finding fails the build. See choose what fails the build.
--formathuman (default report), json, or sarif (SARIF v2.1.0). See output.
-o, --output <FILE>Write the report to a file instead of stdout.
--colorauto, always, or never.
--progress / --no-progress--progress shows the progress lines even when stderr is not a terminal, and --no-progress turns them off except the results link. Progress goes to stderr, reports to stdout.
--incrementalWarm scans. An unchanged tree replays the prior result and after an edit only what changed is rechecked, with the same result as a cold scan. For scan and sast the flag turns on by itself once this repository has a cache, and --no-incremental forces a cold scan. sca takes the flag explicitly each run.
--cache-dir <DIR>Keep the warm scan cache in <DIR>, a folder outside the repository (default repos/ in your user cache folder). For scan and sast, passing it also turns warm scans on.

SAST flags#

On scan and sast.

FlagWhat it does
--rules <RULES>A YAML rule file, or a directory of them. Optional: rules also load from .atmos/rules/ (suppress with --no-local-rules).
--no-managed-rulesScan with your own rules only, from --rules and .atmos/rules/. atmos sca does not take this flag and stops with exit code 2, JSON error code usage. See keep the Findings page complete.
-j NCap scan parallelism. 0 uses the default.
--max-file-mib <MIB>Size budget for each file, 4 MiB by default. A file over a budget is skipped with a visible reason, so anything it contains goes unreported. Raise it to scan generated or bundled files, and 0 turns the budget off.
--max-file-lines <LINES>Line budget for each file, 50,000 lines by default. Works like the size budget.

SCA flags#

On scan and sca.

FlagWhat it does
--osv-db-dir <DIR>Keep the local advisory database in <DIR>, a folder outside the repository (default osv-db/ in your user cache folder, downloaded on first use).
--online / --offlineQuery the live OSV API instead of the local database, or keep advisory resolution on the local database. Mutually exclusive. --offline governs advisory lookups only, and every scan still connects to the platform.
--skip-db-updateKeep a cached database even if the freshness check says it is stale.
--sca-rules <PATH>Your own SCA YAML rules, loaded alongside the advisory database.
--reachable-onlyDrop findings whose package your code never reaches. See keep the Findings page complete.
--no-reachabilitySkip the reachability analysis entirely (faster).
--min-severity / --min-confidenceFilter the report by severity or reachability confidence. See keep the Findings page complete.
--no-ignoreAlso scan lockfiles that .gitignore would exclude.
--error-on-no-lockfiles(scan only) Exit with code 2 when no lockfile is found. Off by default.

Keep the Findings page complete#

Atmos marks a finding Fixed when an uploaded scan that could have seen the finding no longer reports it, as when findings close describes. A scan you narrow reports less, even when the code has not changed:

  • A dependency scan with --min-severity, --reachable-only or --min-confidence drops the findings the option excludes, and Atmos marks them Fixed.
  • A scan with --no-managed-rules, --no-local-rules or fewer rules in --rules than the last scan runs fewer rules, and Atmos marks Fixed the findings of the rules that did not run.
  • A path newly listed in .atmosignore or .gitignore is no longer scanned, and Atmos marks its findings Fixed.

To keep the Findings page complete, upload scans that run your full rule set without these options, and pass --no-upload to a narrowed scan. To keep a finding from failing the build while the Findings page still lists it, add it to .atmos-ignore.yaml instead of ignoring its path.

db update and self-update#

atmos db update#

FlagWhat it does
--ecosystem <NAME>Restrict to one ecosystem, repeatable. Defaults to npm, Maven and NuGet.
--osv-db-dir <DIR>Database location (default osv-db/ in your user cache folder).

atmos self-update#

FlagWhat it does
--checkReport whether an update exists without installing it.
--version <X.Y.Z>Install this version instead of the latest, when it is the installed version or a newer one. To go back to an older release, run the install script with that version, as the quickstart shows.
--tokenSame as the platform flag. Downloads are authenticated with your sign-in, or with a Workspace Token in CI.

Output#

The report goes to stdout, or to the file -o names. Progress, warnings and errors go to stderr, each line starting with atmos:.

The human report prints once the upload is done. Each finding opens with its severity in the words the platform uses, from critical down to info. A secret in a flagged line is masked. A finding someone marked False positive, Accepted or Ignored on the Findings page carries the note triaged on the Findings page. After the summary, the report closes with one note for each kind of finding that does not fail the build:

--format json is the native report, and --format sarif is SARIF v2.1.0 with each data flow trace as codeFlows. Both keep every finding and mark the ones that do not fail the build:

  • A finding .atmos-ignore.yaml covers carries suppressed in JSON and a suppressions entry in SARIF. See what an ignored finding looks like.
  • With a baseline commit, every finding carries baseline_state in JSON and baselineState in SARIF, new or unchanged.
  • How many findings triage and the baseline commit left out goes to stderr.

Lines and columns in JSON and SARIF start at 1, and columns count characters (Unicode code points), as in the human report.

Exit codes#

CodeMeaning
0No finding fails the build, or the folder has nothing to scan.
1Findings fail the build: open findings at or above --fail-on that .atmos-ignore.yaml, triage on the platform and the baseline commit do not cover. See what fails the build.
2A scan error, a mistyped command, or --error-on-no-lockfiles without a lockfile. A path, an --output folder or a --baseline-commit that does not exist, and an .atmos-ignore.yaml that is not valid, stop the scan before anything runs or is sent.
3Atmos could not start the scan, and nothing was scanned. The error says why and what to do.
4Upload failure. The report still prints or is written to the --output file, and the code wins over 1 so CI notices the platform did not receive the report.

A file that fails to parse becomes an atmos: skip line on stderr, and so does a text file a regex rule cannot read because it is not UTF-8 or is larger than 1 MiB. A rule that fails to load becomes an atmos: warning: line. The scan continues with the rest.

JSON error codes#

When a scan cannot run or start, --format json prints one error object on stdout, also when -o names a file:

json
{"error": {"code": "path_not_found", "message": "src/api does not exist. Nothing was scanned."}}

These codes come with exit code 3, and nothing was scanned:

CodeWhen
not_signed_inNo sign-in. Run atmos login, or set ATMOS_TOKEN or pass --token.
sign_in_rejectedAtmos rejected the sign-in, for example a revoked or expired one.
networkAtmos could not be reached.

These codes come with exit code 2, before anything runs or is sent:

CodeWhen
path_not_foundThe scan path does not exist.
output_dir_not_foundThe folder --output names does not exist.
baseline_not_foundThe checkout does not have the --baseline-commit.
invalid_ignore_file.atmos-ignore.yaml is not valid, is a symbolic link or is larger than 1 MiB.
usageA mistyped command line, such as a flag the subcommand does not take.

other covers any other failure, with exit code 2 or 3, such as a scan of a repository without a name (no origin remote and no --repo). A scan refused because of the workspace's plan also exits 3, with its own code and a message that says what to do. Treat a code you do not know as other.