When you run commands with the CLI such as
snyk monitor and
snyk test, Snyk uses use your default organization, which was created when you first registered for an account. If you want commands to run against a different organization, you can specify that organization either globally or individually.
Note: The Snyk CLI help specifies using
--org=<ORG_ID>; this article specifies using the
ORG_ID works in both the CLI and the API. The organization slug name works in the CLI, but not in the API.
Specify an organization globally
snyk config set org=orgslugname. Note:
orgslugname must match the slug name as displayed in the URL of your org in the Snyk UI:
Specify an organization individually
To override this global configuration for individual runs, specify the org as follows:
snyk monitor --org=orgslugname or
snyk test --org=orgslugname.
$ snyk test --org=my-team