Skip to content

feat(org): run commands against an organization - #13

Merged
ciehanski merged 1 commit into
mainfrom
feat/organizations
Sep 28, 2026
Merged

ciehanski merged 1 commit into
mainfrom
feat/organizations

Conversation

@ciehanski

Copy link
Copy Markdown
Member

dpctl had no organization awareness at all: it only ever saw your personal apps, and apps belonging to an organization were simply invisible.

  • dpctl org list - marks the one in use with *
  • dpctl org use acme - saves the resolved id to the session file
  • dpctl org clear - back to your personal account

Every request carries x-org-id while an organization is set. Two overrides for a single command or job: --org <slug|name|id>, and DEPLOYPULSE_ORG_ID for CI, where there's no session file to save to. --org takes priority over the environment variable, which overrides org use, so CI can switch context without rewriting the file you logged in with.

dpctl login now asks which organization to use, once, if your account belongs to any. It asks nothing when --org already answered, when you belong to none, or when stdin isn't a terminal, so piped CI logins never block. A failure listing organizations doesn't fail the login and the access key has already been created by then.

Resolution is tiered id → slug → name and refuses an ambiguous answer. Slugs are unique server-side but names are not: two orgs called "Acme Inc" get slugs acme and acme-2, and a single find() over all three fields could match the wrong one by name and quietly persist it.

@ciehanski
ciehanski merged commit ed59ade into main Sep 28, 2026
3 checks passed
@ciehanski
ciehanski deleted the feat/organizations branch September 28, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant