The CLI needs three things to run an organization-scoped command: a credential, an organization and a workspace. This page explains every place each can come from, in the order the CLI looks, and how to check what it resolved. wam config list shows the winning value and its source for every key, and wam auth status shows the credential and where it is stored; run those two when anything about "which account is this using" is unclear.
Precedence
For each setting, the first of these that has a value wins:
- The command-line flag:
--org,--workspace,--api-url,--profile,--token. - The environment variable:
WAM_ORG,WAM_WORKSPACE,WAM_API_URL,WAM_PROFILE,WAM_TOKEN. - The nearest
wam.json, found by walking up from the current directory and stopping after a directory that contains.git. Onlyorg,workspaceandfailUnder. - The user config file, per profile.
- The built-in default.
The credential has its own, shorter chain: --token, then WAM_TOKEN, then the credential store or file for the active profile.
wam config list
org acme ./wam.json
workspace acme-main ./wam.json
apiUrl https://whereamimentioned.com default
failUnder 55 ./wam.json
wam config get <key> prints one raw value, for scripts. wam config path prints every file that was consulted, in precedence order, so you can see which wam.json won.
The project file: wam.json
A file committed next to the code, so every checkout and every CI run agree on the organization, the workspace and the threshold.
{
"$schema": "https://whereamimentioned.com/schema/wam.config.json",
"org": "acme",
"workspace": "acme-main",
"failUnder": 55
}
| Key | Type | Meaning |
|---|---|---|
$schema |
string | Optional. Points editors at the JSON Schema for validation and completion. |
org |
string | The organization slug. |
workspace |
string | The workspace slug. |
failUnder |
integer 0 to 100 | The default threshold for --fail-under on scan run and report get. |
Three rules, each there for a reason:
- An unknown key is an error (exit 2), naming the file and the valid keys. A typo such as
workSpacethat silently did nothing is exactly how a CI job scans the wrong brand. - There is no field for a token, and a
tokenkey is refused like any unknown key. A committed file must never carry a secret. apiUrlis refused (exit 2, naming the alternatives). A repository you cloned must not get to decide where your API key is sent: onewam.jsonin a downloaded project, and the next command would post the token to a stranger's server. Set the server withWAM_API_URL,--api-urlorwam config set apiUrlinstead.
wam config set never writes wam.json. Edit it by hand and commit it.
The user config
Your own defaults, outside any repository.
| Platform | Path |
|---|---|
| Linux and macOS | ${XDG_CONFIG_HOME:-~/.config}/whereamimentioned/config.json |
| Windows | %APPDATA%\whereamimentioned\config.json |
| Anywhere | $WAM_CONFIG_DIR/config.json when WAM_CONFIG_DIR is set |
{
"version": 1,
"activeProfile": "default",
"profiles": {
"default": { "org": "acme", "workspace": "acme-main", "failUnder": 55 },
"client-b": { "org": "client-b", "apiUrl": "https://whereamimentioned.com" }
}
}
Each profile may carry org, workspace, apiUrl and failUnder. The same strictness applies: an unknown key is exit 2. Write it with the commands rather than by hand:
wam config set org acme
wam config set workspace acme-main
wam config set failUnder 55
wam config unset failUnder
wam workspace use acme/acme-main # sets org and workspace together, after checking they exist
Profiles
A profile is one credential plus one set of config defaults, named. The default profile is default. Select another with --profile <name> or WAM_PROFILE=<name>.
Two patterns both work:
- One organization key per profile.
wam auth login --profile client-bstores a second key under the profileclient-b;wam --profile client-b scan listuses it. Nothing about the first profile changes. - One account-wide key, many organizations. Sign in once with
--account-wide, then choose the organization per command with--org,WAM_ORGorwam config set org.
Environment variables
| Variable | Meaning | Default |
|---|---|---|
WAM_TOKEN |
The API key. Highest-precedence credential source after --token. What CI sets. |
none |
WAM_API_URL |
The API origin. For staging or a preview deployment. | https://whereamimentioned.com |
WAM_ORG |
The organization slug. Required with an account-wide key unless set elsewhere. | none |
WAM_WORKSPACE |
The workspace slug. | none |
WAM_PROFILE |
The credential and config profile. | default |
WAM_CONFIG_DIR |
Replaces the user config and credential directory wholesale. | platform default |
WAM_MCP_URL |
The MCP endpoint, read only by wam mcp url and wam mcp install. For staging. |
https://whereamimentioned.com/api/mcp |
WAM_NO_UPDATE_NOTIFIER |
Any non-empty value disables the once-a-day update check. | unset |
NO_COLOR |
Standard. Presence disables colour regardless of value. | unset |
CI |
Standard. Presence implies --non-interactive. |
unset |
GITHUB_RUN_ID, CI_PIPELINE_ID, CI_JOB_ID |
Read, in that order, to derive the Idempotency-Key of scan run and org create, so a retried job replays the same scan. |
none |
CLAUDE_CODE, CURSOR_AGENT, AGENT |
Presence means an AI agent is driving the CLI, which implies --non-interactive. |
unset |
Prefer WAM_TOKEN over --token: arguments leak into shell history and process listings.
Where the key is stored
wam auth login stores the key in the operating system's credential store, under the service name whereamimentioned, one entry per profile:
| Platform | Store |
|---|---|
| macOS | Keychain |
| Windows | Credential Manager |
| Linux | Secret Service (GNOME Keyring, KWallet) over D-Bus |
Where no store is available (headless Linux, a container, no D-Bus session) the CLI falls back to a file: credentials.json in the user config directory. On Linux and macOS it is written with mode 0600 inside a 0700 directory, and if it is later found with looser permissions the CLI refuses to read it and prints the chmod that fixes it.
wam auth status always says which backend holds the credential, because a silently failing keyring is the usual reason for "why does it keep asking me to sign in". The CLI never prints the token: not in wam auth status, not under --debug, not in an error.
CI never uses the store. It sets WAM_TOKEN and nothing else.
Interactive or not
The CLI prompts (for a scan confirmation, a create confirmation, a device code) only when it is sure a person is there. It switches to non-interactive, and refuses anything that would need an answer, when any of these holds:
--non-interactivewas passed;--jsonwas passed;- stdout is not a terminal (a pipe, a file);
CIis set in the environment;CLAUDE_CODE,CURSOR_AGENTorAGENTis set.
In that state a command that spends credits or creates something needs -y, --yes, or it exits 2 having done nothing. The cost of a scan is still printed before the confirmation would have been asked, so it is in the log either way.
Output
- stdout is data, stderr is chatter. Tables, JSON documents and generated files go to stdout. Progress, spinners, hints and the update notice go to stderr.
wam report get --json | jq .scoreandwam site generate-sitemap acme.com > sitemap.xmlneed no2>/dev/null. --jsonis a contract. One JSON document on stdout, exactly the API body where there is one, or NDJSON (one object per line) when following a scan with--wait. Under--jsonan error is itself the data: a{ "ok": false, "error": {...}, "exitCode": n }object on stdout with the same exit code. Fields are only added, never renamed or removed, within a major version; while the package is0.x, a breaking change lands in the minor.-q, --quietsuppresses progress and non-essential stderr. Errors still print.- Colour is on when stdout is a terminal,
NO_COLORis unset andTERMis notdumb.--colorforces it on,--no-coloroff. Never under--json. --debugadds request ids, config sources and HTTP status lines on stderr. Never the token.
Update check
Once a day at most, on stderr, never blocking, the CLI compares its version with the npm registry and prints a one-line notice when a newer one exists. It is off under --json, --quiet, in a pipe, when CI is set, when WAM_NO_UPDATE_NOTIFIER is set, and always for wam completion. The CLI never updates itself.
Telemetry
None. The CLI makes no request beyond the API calls that serve the command you ran and the update check above. No usage pings, no crash reports, no first-run beacon.