Commands
Every devguard command, its flags, and how connection settings resolve.
The binary is installed as devguard. Every command exits with 0 on success and a non-zero code on failure.
Global flags
Global flags are read by every command.
| Flag | Meaning |
|---|---|
--url <url> | API base url. Default https://app.devguard.ch. |
--key <key> | API key (dvg_...). |
--config <path> | Path to the configuration file. Default devguard.yml. |
--org <organizationId> | Organization id. Overrides organization: in the configuration and the login default. |
--version | Print the CLI version. |
--help | Print usage for the program or a command. |
devguard login
devguard login [--org <organizationId>]Verifies an API key and stores it for the target url in ~/.devguard/config.json. The key comes from --key, then DEVGUARD_API_KEY, then a hidden prompt. Keys are stored per url, so a login for a local instance and a login for production coexist. A key that does not start with dvg_ is rejected before any request is made.
After verifying, login lists your organizations with their ids and stores a default organization for the url. The default is chosen in this order: --org (id or slug), an already stored default, the only membership when there is exactly one, otherwise an interactive picker (in a terminal only). When nothing is picked, login still succeeds; set organization: in the configuration, pass --org, or re-run login.
devguard init
devguard init [--force]Interactive wizard that writes a first configuration file. It runs only in a terminal; in CI, commit a devguard.yml instead. It writes to the path given by --config (default devguard.yml) and refuses to overwrite an existing file unless --force is set.
The wizard signs in when no key is stored for the target url, picks an organization in the same order as login, proposes an npm-audit collector when a package-lock.json is present and a uses: scan collector when a supported scanner is installed, and then accepts any number of custom command collectors. It binds only to evidence records that already exist; it never creates one. It also offers to add the .devguard/ staging folder to your .gitignore.
devguard scan
devguard scan --evidence <shortId> [--scanner <id>] [--expires <duration>] [--org <organizationId>] [--allow-secrets]Runs an installed vulnerability scanner and pushes its report into one evidence record, without a configuration file.
| Flag | Meaning |
|---|---|
--evidence <shortId> | Required. 42 or EV-42. The record must already exist. |
--scanner <id> | Force trivy, osv-scanner, grype, or npm-audit. Default: the first scanner found on the machine. |
--expires <duration> | Freshness window stamped on the file. Default 30d. |
--org <organizationId> | Organization id, when no configuration or login default names one. |
--allow-secrets | Do not block the push on secret findings. |
The report uploads under the collector name scan-<scanner> with a 30 minute timeout and replaces that collector's previous file. When a devguard.yml is present, its organization: is read; nothing else in the file is used.
devguard evidence validate
devguard evidence validateRead-only preflight. It parses the configuration, checks that every uses: scan collector has an installed scanner, verifies the key, and confirms that every referenced evidence record resolves in the organization. It prints one line per record, runs no collector commands, and uploads nothing.
devguard evidence push
devguard evidence push [--dry-run] [--allow-secrets]The whole pipeline: runs every collector, scans each artifact for secrets, uploads, and supersedes that collector's previous file. It prints one line per collector and exits non-zero when any collector fails. A failed collector uploads nothing; its previous file stays in place.
| Flag | Meaning |
|---|---|
--dry-run | Run everything, including the secret scan, and upload nothing. |
--allow-secrets | Do not block on secret findings for this run. Prefer the per-collector allowSecrets field, which stays visible in review. |
Connection and organization
Connection settings resolve highest first:
- The
--urland--keyflags. DEVGUARD_API_URLandDEVGUARD_API_KEY.- The login keystore (
~/.devguard/config.json). https://app.devguard.ch.
The organization resolves highest first:
- The
--orgflag. organization:in the configuration file.- The default stored by
devguard loginfor the resolved url.
For push, validate, and scan the value must be the organization id. The slug is accepted only by login and init. devguard login prints the id.
Environment variables
| Variable | Meaning |
|---|---|
DEVGUARD_API_URL | API base url, for example http://localhost:3000 for a local instance. |
DEVGUARD_API_KEY | API key. The usual way to authenticate in CI. |
How is this guide?