Configuration
Updated
None. Crowsnest runs with no settings, and every API key is optional. Put keys in a file named .env in the Crowsnest folder, or hand a file to crowsnest start with --env-file. Without keys, Crowsnest uses cached data and fixed rules.
Crowsnest needs no settings to run. Every API key is optional. Put keys in a file named .env in the Crowsnest folder, or hand a file to crowsnest start with --env-file. Without keys, Crowsnest uses cached data.
Which API keys can I add?
All of these are optional.
| Key | What it adds | What is sent when you set it |
|---|---|---|
ANTHROPIC_API_KEY | AI-assisted analysis and explanations. Without it, Crowsnest uses fixed rules. Other providers work too: see Choose your AI model. | Details of your scan go to your chosen model provider (Anthropic's API by default): the project folder path, the kind of project, the time of the last scan, any recent campaign names and your GitHub organisation name. For each check that finds something, up to 20 matching results (package names, versions and related details) are sent too. |
GITHUB_TOKEN | Repository details from GitHub, with higher rate limits. | Repository and maintainer lookups go to GitHub. |
GITHUB_ORG | Your GitHub organisation name, for repository lookups. | The organisation name goes to GitHub. |
SOCKET_API_KEY | Live threat alerts from Socket. | Package names (up to 50 npm packages per scan) go to Socket. |
NPM_TOKEN | Signed-in requests to the npm registry. | Sent to the npm registry with package lookups. |
Without any key, a scan still sends package names to public services: the registries your packages come from (npm, PyPI, crates.io, Packagist, RubyGems and the Go module proxy; up to 500 packages per kind per scan), and the OSV malicious-package list, which is asked about every package name and exact version in your lockfiles. Crowsnest sends no usage data to its authors.
Which Slack keys do I need?
Only if you run the bot: SLACK_BOT_TOKEN, SLACK_APP_TOKEN, CROWSNEST_ALERT_CHANNEL (default #security) and CROWSNEST_DASHBOARD_URL (default http://localhost:3000). See the Slack bot page.
Which addresses and files can I set?
| Setting | Default | Used by |
|---|---|---|
CROWSNEST_API_URL | http://localhost:8000 | Terminal command, Slack bot |
NEXT_PUBLIC_API_URL | http://localhost:8000 | Dashboard. Fixed when the dashboard is built, so the Docker setup uses the default |
CROWSNEST_API_HOST | 127.0.0.1 | Crowsnest, when started by its own entry point. The Docker image listens on all addresses inside the container, and Docker publishes it on this machine only |
CROWSNEST_API_PORT | 8000 | Crowsnest, when started by its own entry point |
CROWSNEST_PROJECTS | none | Docker Compose. The folder on your machine that holds your projects, shared read only so the scan dialog can list them. Put it in .env |
CROWSNEST_IMAGE | ghcr.io/devampatel03/crowsnest-api | Docker Compose and crowsnest start. The backend image to run, if you want another |
CROWSNEST_CORS_ORIGINS | http://localhost:3000,http://127.0.0.1:3000 | Crowsnest. The dashboard addresses the browser may call it from. Add yours if you move the dashboard off port 3000 |
CROWSNEST_CONSOLE | off, except in the Docker Compose file | Dashboard. on lets it answer requests that do not look local, needed behind Docker Desktop |
CROWSNEST_DB_PATH | ./crowsnest.duckdb | Where Crowsnest keeps its data file (Docker: /data/crowsnest.duckdb) |
CROWSNEST_SNAPSHOT_DIR | ./snapshots | Where saved snapshots go (Docker: /data/snapshots) |
CROWSNEST_MIN_RELEASE_AGE_DAYS | 2 | Crowsnest. Days a package version must have been public before crowsnest install and crowsnest check allow it. 0 turns it off |
CROWSNEST_LIVE_LOOKUPS | true | Crowsnest. Set to false to stop install and pull request checks from calling registries and the malicious-package list, for offline use |
crowsnest.apiUrl, crowsnest.enabled, crowsnest.riskThreshold | See the VS Code page | The VS Code extension |
How do I save settings in the terminal command?
crowsnest config set apiUrl http://localhost:8000
crowsnest config getA value saved this way beats the matching environment variable. config get shows secrets as ***set*** or (not set).
Only apiUrl changes anything today. config set also accepts githubToken, npmToken, socketApiKey and anthropicApiKey, but the terminal command does not pass them to Crowsnest, so saving one has no effect. To give a backend started with crowsnest start a key, put it in a file and run crowsnest start --env-file <file>. With Docker Compose, put it in .env.
What happens when a key is missing?
Nothing breaks. Crowsnest falls back to cached data and fixed rules, so you see fewer live details and no error. Do not treat a quiet scan with no keys as a clean bill of health. It reflects only what Crowsnest could see.
What this does not do
- It does not let you change the 0.6 install stop.
- It does not store keys securely.
.envis a plain text file, and the terminal command keeps saved values in a local file. Keep both out of version control. - It does not check your keys when it starts. A wrong key shows up as missing live details.
- It does not validate other settings. A mistyped address shows up as Offline or "unreachable" messages.
If something does not behave, see Troubleshooting. To set up the pieces that use these keys, see Installation and CLI usage.
Nib's tip: start with no keys.
Related
- InstallationInstall Crowsnest with Docker or from source on macOS, Linux or Windows. Requirements, the command line tool, updating and uninstalling, step by step.
- Slack botSet up the Crowsnest Slack bot with one guided command. It posts serious calls to a channel and answers four slash commands, with no public web address needed.
- TroubleshootingFix common Crowsnest problems: a dashboard showing Offline or a 404, a port in use, the file-in-use error, Docker not starting and a scan that finds nothing.
- CLI usageUse the crowsnest command to scan a project, check one package, vet a pull request and stop risky installs. Commands, options and exit codes for your terminal.