Skip to content
Open dashboard (opens in a new tab)

CLI

CLI command map

Every nightvision command, grouped by what you are trying to do. To install the CLI and sign in, see Install the CLI.

The dashboard says application. The CLI, the API and the MCP server say target for the same thing, so the commands and flags on this page use target.

Add --help to any command for its full usage.

These work on every command.

Flag What it does
-F, --format Output format: text (default), json or table. Use json in scripts.
--token API token for this command. Same as setting NIGHTVISION_TOKEN.
--org Organization (name or id) to act in, for this command only. See Pick an organization.
--api-url API base URL. Default https://api.nightviz.ai/api/v1/. To change it, set NIGHTVISION_API_URL.
--verbose Print debug messages.
--skip-tls-verify Skip TLS verification for requests to the NightVision API.
--force-private-scan Route the scan through your machine even when the application is reachable from the internet. See Private networks.
--force-proxy-transport-technology Transport for a private scan: quic or yamux. By default the CLI tries QUIC first and falls back to yamux.
--override-relay-url Relay base URL for private scans. Leave it unset unless NightVision support asks you to set it.
Command What it does
nightvision login Sign in from your browser. --port sets the local port that receives the sign-in (default 14404, or any free port when it is busy). --timeout sets how long to wait (default 10m, 0 waits indefinitely).
nightvision logout Sign out on this machine.
nightvision whoami Show your email, your role in each organization, and your permissions on the current project. -p/--project or -P/--project-id picks a project. --all reports every project you can see.
nightvision version Print the version, commit and build date.

The CLI prints a notice when a newer release is available.

Most commands take their organization from the project or application you name, so you rarely need to choose one. The organization matters for two commands: project create (where the new project goes) and export jira (which organization’s Jira settings to use).

Command What it does
nightvision org list List the organizations you belong to.
nightvision org show Show which organization new projects are created in, and why.
nightvision org use <name-or-id> Set the organization for this machine. Stored in the CLI’s configuration file.
nightvision org unset Clear this machine’s choice. New projects then go to your account’s default organization.
nightvision org set-default <name-or-id> Set the default organization on your account. This is the same setting as Set <name> as default in the dashboard’s organization switcher.

The order of precedence is --org for one command, then org use for the machine, then your account’s default.

org use does not filter other commands. project list still lists projects from every organization you belong to.

Command What it does
nightvision project list List the projects you can see.
nightvision project create <name> Create a project.
nightvision project set <name> Make a project the current project. Commands that take -p use it when you leave the flag out.
nightvision project show Show the current project. nightvision show does the same.
nightvision project unset Clear the current project.
nightvision project update <name> <new-name> Rename a project.
nightvision project delete <name> Delete a project.

Commands that work inside a project accept -p/--project (name) and, on most commands, -P/--project-id (UUID).

Terminal window
# A web application
nightvision target create my-app https://staging.example.com --type web
# An API application, with its specification
nightvision target create my-api https://api.staging.example.com --type api --spec-file openapi.yml
Command What it does
nightvision target create <name> <url> Create an application. --type is required: web or api.
nightvision target update <name> Change an application. -n/--name renames it and -u/--url changes its URL.
nightvision target list List applications in the current project. -p/--projects names other projects (repeatable). -a/--all covers every project.
nightvision target delete <name> Delete an application.

Flags for target create and target update:

Flag What it does
-f, --spec-file Path to an OpenAPI specification or a Postman collection. Makes the application an API application.
-s, --spec-url URL of an OpenAPI specification or a Postman collection. Use one of --spec-file and --spec-url, not both.
--openapi-file, --openapi-url The same, for OpenAPI specifications only. --swagger-file and --swagger-url are deprecated names for these.
--exclude-url A URL regular expression to keep out of the scan. One pattern per flag: repeat the flag for more. On update, --exclude-url "" clears the list.
--exclude-xpath An XPath expression for an element the crawler must not click. One per flag. On update, --exclude-xpath "" clears the list.
--html-parser The HTML parser the crawler uses: NEKOHTML_LEGACY, NEKOHTML_HTMLUNIT, NEKOHTML_CODELIBS or NEKOHTML_LEGACY_DISABLE_TAG_BALANCING. See Crawler settings.

After a change to the exclusions, the CLI prints the stored patterns, one per line with a count. If a value looks like a comma-separated list, the CLI warns you, because a comma-joined list is stored as one pattern.

Anywhere a command takes -t/--target, you can give the application’s name or its UUID.

For what each setting means, see Applications and Scope.

An API application can carry more than one schema.

Command What it does
nightvision api-schema upload <name> <file> -t <target> Attach a schema file. --url fetches it from a URL instead of a file. -b/--base-url sets the base URL its paths are relative to. -d/--description adds a description. --overwrite replaces an existing schema of the same name. --wait waits for validation to finish.
nightvision api-schema list <target> List the schemas attached to an application.
nightvision api-schema download <name> -t <target> Download a schema.
nightvision api-schema delete <name> -t <target> Remove a schema.

See API specifications.

Tell the scanner about other domains your application calls, such as an API on a second host.

Command What it does
nightvision target paths discover <url> -t <target> Open a browser, record the domains the page calls while you browse, then let you pick which to add. --no-upload skips the upload. -o/--output also saves the choice to a CSV file.
nightvision target paths upload <file> -t <target> Upload domain patterns from a CSV file with a path header and one pattern per line. Patterns the application already has are skipped.

An authentication tells a scan how to sign in. See Authentication for which kind to use.

Terminal window
nightvision auth playwright create my-login https://staging.example.com/login

The CLI opens a browser. Sign in the way a user would, then close the browser. NightVision saves the recording as a script.

Command What it does
nightvision auth playwright create <name> <login-url> Record a login. -d/--description adds a description. --save <path> also writes the script to a local file.
nightvision auth playwright update <name> Change a recorded login. -n/--name renames it. -d changes the description. -s/--script records the script again, and -u/--url sets the URL the recorder opens. --save <path> writes the script to a local file.
Terminal window
nightvision auth headers create my-api-key -H "Authorization: Bearer <token>"
nightvision auth cookies create my-session -H "session: <value>"
Command What it does
nightvision auth headers create <name> Create a header authentication. Pass each header with -H "Name: value". Repeat -H for more headers.
nightvision auth headers update <name> Replace the headers (-H), rename (-n) or change the description (-d).
nightvision auth cookies create <name> Create a cookie authentication. Pass each cookie with -H "name: value".
nightvision auth cookies update <name> Change a cookie authentication.
Command What it does
nightvision auth list List authentications in the current project. -p/--projects names other projects. -a/--all covers every project.
nightvision auth delete <name> Delete an authentication.
Terminal window
nightvision scan my-app --auth my-login

nightvision scan <target> starts a scan and shows its progress until it ends. When the application is not reachable from the internet, the CLI relays the scan’s requests from your machine, so keep the command running. See Private networks.

When the scan starts, the CLI prints the settings it resolved to: scan and crawl duration, HTML parser, LLM crawling, API schemas, HTTP traffic files and extra domains.

Flag What it does
-c, --auth Name of the authentication to scan with.
-C, --auth-id UUID of the authentication. Falls back to NIGHTVISION_CREDS_ID.
--no-auth Scan without signing in.

If you pass neither --auth nor --auth-id, and NIGHTVISION_CREDS_ID is not set, the CLI starts the scan with no authentication. The dashboard preselects an authentication on its New scan page. The CLI does not, so name it with --auth in every scan that needs a login.

Flag What it does
--max-duration-minutes Total time for the scan, from 30 to 480 minutes. Default 30.
--crawl-duration-minutes How much of that time the crawl may use. At least 1, and no longer than the scan.
--llm-crawling, --no-llm-crawling Turn LLM-guided crawling on or off for this scan. Leave both out to use the default for the scan’s duration.
--no-intelligent-page-load-handling Use fixed waits instead of detecting when a page has finished loading.

See Crawler settings.

Flag What it does
--no-zap Skip the ZAP checks.
--no-nuclei Skip the Nuclei checks. At least one of the two engines must stay on.
--disable-zap-active-alerts ZAP active alert IDs to skip, comma-separated.
--disable-nuclei-folders Nuclei template folders to skip, comma-separated.
--disable-nuclei-templates IDs of the application’s custom Nuclei templates to skip in this scan, comma-separated.

The alert IDs and folders are listed in Checks. For custom templates, see Nuclei templates.

A login check runs only the login, with no crawl and no checks, and tells you whether the scan can sign in.

Terminal window
nightvision scan my-app --auth my-login --login-check \
--validation-url https://staging.example.com/account \
--validation-must-contain "Sign out"
Flag What it does
--login-check Run only the login. --max-duration-minutes is ignored.
--validation-url A URL to load with the session the login captured, to prove the login worked.
--validation-must-contain Text the response must contain. Repeatable. Plain text, not case sensitive.
--validation-must-not-contain Text the response must not contain. Repeatable.
--validation-status HTTP status codes to accept. Repeatable. The default accepts only 200.
--validation-ignore-status Skip the status check and rely on the text checks. Cannot be combined with --validation-status.

Exit codes with --validation-url: 0 verified, 1 the check could not complete, 2 failed, 3 inconclusive. Without --validation-url, 0 means the login captured a session, which is weaker proof. See Login check.

Command What it does
nightvision scan list List scans in the current project. -p/--projects names other projects. -a/--all covers every project.

With -F json, each scan carries its status, its counts of findings by severity and the settings it ran with.

Recorded traffic (a HAR file) shows the scanner requests it would not find by crawling. See HTTP traffic.

Command What it does
nightvision traffic record <name> <url> -t <target> Open a browser, record the traffic while you use the application, and upload it. -o/--output also saves the HAR file. -d adds a description.
nightvision traffic upload <name> <har-file> -t <target> Upload a HAR file you already have.
nightvision traffic list <target> List an application’s traffic files.
nightvision traffic download <name> -t <target> Download a traffic file.

Every export command takes -s/--scan-id, the id of a finished scan. A scan’s Export report menu covers PDF, CSV and SARIF without the CLI. See Exports.

Command What it does
nightvision export sarif -s <scan-id> Write SARIF. Default file results.sarif. --openapi-file adds the source file and line for each finding. See Code traceback.
nightvision export csv -s <scan-id> Write CSV. Default file results.csv.
nightvision export gitlab -s <scan-id> Write a GitLab DAST report. Default file gl-dast-report.json. --openapi-file adds source locations. See GitLab.
nightvision export jira -s <scan-id> File a Jira ticket for each finding. See Jira.

Flags shared by all four:

Flag What it does
-o, --output Output file path (not on export jira).
--exclude-severity Severities to leave out, comma-separated: info, low, medium, high, critical, unknown, unspecified.
--exclude-resolution Statuses to leave out, comma-separated: open, resolved, false_positive, wont_fix.

export sarif also takes --randomize-issue-ids, which makes a code scanning tool treat the upload as new.

Flags for export jira:

Flag What it does
--jira-token Jira API token. Required.
--user-email The Jira account email that goes with the token.
--base-url Your Jira site, for example https://example.atlassian.net.
--jira-cloud-id Atlassian cloud id. Set it when you use a scoped service-account token. --base-url is then not needed.
--project-key Jira project to file tickets in.
--issue-type Issue type for new tickets. Default Task.
--openapi-file Adds each finding’s source location to the ticket.

--user-email, --base-url, --jira-cloud-id, --project-key and --issue-type fall back to the defaults saved under Settings > Integrations > Issue trackers.

Command What it does
nightvision token create Create an API token and print it once. -d/--expiry-date sets an expiry, as yyyy-mm-dd or a full ISO 8601 time. Without it the token does not expire.
nightvision token list List your tokens by digest. The token itself is never shown again.
nightvision token delete <digest> Delete a token.

See API tokens.

nightvision openapi reads your source code and writes an OpenAPI specification from it. nightvision swagger is the same command under another name, and both names work. nightvision --help lists it as swagger.

Terminal window
nightvision openapi extract . --lang python --target my-api
Command What it does
nightvision openapi extract [paths] Build a specification from code and upload it to an API application.
nightvision openapi detect List the projects in a folder that a specification can be extracted from. -p/--path sets the folder and -o/--output writes the result as JSON.
nightvision openapi diff <old> <new> Compare two specifications. --paths or --schemas narrows the output, --full-diff shows everything, and -o writes it to a file.
nightvision openapi diagnose <file> Summarize the diagnostics file an extraction wrote. Works offline and needs no sign-in. --package, --top and --all filter the summary.
nightvision openapi list-default-excludes Print the files and folders that extraction skips by default. -l/--language narrows the list.

Flags for openapi extract, by purpose:

Flag What it does
-l, --lang Language of the code: csharp, go, java, js, php, python or ruby.
-t, --target, -T, --target-id The API application to upload the specification to.
-p, --project, -P, --project-id The project that application is in.
--api-name A name for the API in your API inventory. Defaults to the repository’s name.
-o, --output Output file. Default openapi-spec.yml.
--file-format yml (default) or json.
-v, --version Version string written into the specification. Default 0.1.
-e, --extend An existing OpenAPI file to add the discovered routes to.
-c, --config Path to an nv.config file. See Configuration.
--exclude Files or folders to skip, for example --exclude=vendor/*,*.json.
--no-default-excludes Do not apply the default exclusions.
--root-path The folder that source paths in the output are relative to. Set it to the top of the repository.
-d, --dump-code Include a snippet of the code where each endpoint was found.
--no-target Run without an application, to try extraction first. The specification is still uploaded to NightVision.
--no-upload Upload nothing. Use it when files derived from your code must not leave the machine.
--weak-crypto, --no-weak-crypto Turn the weak cryptography analysis on or off. On by default. See Post-quantum readiness.
--credentials, --no-credentials Turn the hardcoded credentials analysis on or off. On by default. See Hardcoded credentials.
--credentials-key A public key file. The credentials found are sealed to it in a local file that is never uploaded.
--import-root, --import-package, --python-env, --locate-packages, --describe-package Help the analysis resolve Python packages that live outside the scanned folder.
--max-concurrency How many files to parse at once. 0 uses one per CPU.
--log-level debug, info, warn or error, for the extraction only.
--diagnostics, --break, --dump-memory Troubleshooting output. Use them when NightVision support asks.

Each run is recorded as a version of the API in your API inventory, with the repository, branch and commit it came from, unless you pass --no-upload.

The full guide is Extract an API specification.

Variable What it does
NIGHTVISION_TOKEN API token. Takes precedence over a stored sign-in. Use it in pipelines.
NIGHTVISION_API_URL API base URL. The default is https://api.nightviz.ai/api/v1/.
NIGHTVISION_APP_URL Dashboard base URL used for links in SARIF output.
NIGHTVISION_CREDS_ID UUID of the authentication scan uses when you pass neither --auth nor --auth-id.
NIGHTVISION_TARGET_API_ID UUID of the application to use when a command is given no application.
NIGHTVISION_LOGIN_PORT Local port for login. Same as --port.
NIGHTVISION_LOGIN_TIMEOUT How long login waits, for example 10m. Same as --timeout.
NIGHTVISION_DISABLE_TELEMETRY Set to any value to stop openapi extract and openapi detect from sending usage telemetry.
NIGHTVISION_DISABLE_REMOTE_LOG Set to any value to stop the CLI from sending its debug log to NightVision. Local output is unchanged.
NV_SKIP_TLS_VERIFY Set to any value to skip TLS verification. Same as --skip-tls-verify.

The CLI keeps its settings, such as the current project and the organization from org use, in ~/.nightvision/nightvision.yml.

The nightvision binary has no installer. Copy it from the download links to any host.

Two things need a network path:

  • The NightVision API. Every command except openapi diagnose calls it.
  • The browser recorder. The first time you run auth playwright create, traffic record or target paths discover, the CLI downloads a browser driver and a Node.js runtime into your user cache folder.

Point the recorder at internal mirrors with these variables:

Variable What it does
PLAYWRIGHT_GO_NPM_REGISTRY npm registry to download the driver from. Default https://registry.npmjs.org.
NODE_MIRROR Mirror for Node.js downloads. Default https://nodejs.org/dist.
PLAYWRIGHT_NODEJS_PATH Path to a Node.js binary that is already installed. The CLI then skips the Node.js download.

To extract a specification without sending anything derived from your code to NightVision, use openapi extract --no-upload.