Organizations

Choosing which organization cf acts on, and what your role there lets you do.

4 sections3 min read

An organization is the shared workspace for a team, and every repository, connected account, and finding belongs to one. If you belong to exactly one, you can skip this page: the CLI acts on it without being told.

The three commands

List, choose, checkbash
cf org list
cf org use acme
cf org show
cf org list
cf org list  slug       name         role> acme       Acme         owner  acme-labs  Acme Labs    member

cf org use checks the slug against your own listing before storing it, so a typo fails there with unknown_organization and nothing is written. Without that check, a mistyped slug would turn the next unrelated command into an organization_not_found that reads like the repository is missing.

What decides the organization

OrderSource
1--org <slug> on the command
2CEFENSE_ORG in the environment
3What cf org use stored for this instance
4Nothing, and the API picks

The fourth is a real answer, not a failure, but only when your account belongs to exactly one organization. Belong to several and name none, and commands answer organization_required rather than guessing. Quietly picking one would mean showing you another team's findings and saying nothing about it.

Which one is answeringbash
cf org show
cf org show --json

cf org show reports the slug and which of the three named it, as flag, CEFENSE_ORG, or stored. It reads local state only, so it works offline and without being signed in.

Your role decides what you can run

There are three roles: owner, admin, and member. A member can scan, read findings, triage them, and generate patches. A member cannot change what the team has connected, and cannot open or merge a pull request. An owner or an admin can do all of it.

CommandRole needed
cf scan, cf reproduced, cf matched, cf branches, cf commits, cf audit, cf sbomAny
cf triageAny
cf fix generate, cf fix showAny
cf proof, cf proof show, cf proof runAny
cf planAny
cf plan upgrade, cf plan portalowner or admin
cf repo connect, cf repo disconnect, cf scan --urlowner or admin
cf provider connect, cf provider disconnectowner or admin
cf settings subcommandsowner or admin
cf fix publish, cf fix merge, cf proof attestowner or admin
cf proof env set, cf proof env unsetowner or admin

A refusal is organization_forbidden with exit code 4, and billing_forbidden for the two plan commands. It is enforced by the API, not by the CLI, so it behaves the same from the workspace or from a script. Only an owner or admin of the organization can change what role you hold.

In CI

Have a correction or need help?

Email the docs team