You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: CLI - add zitadel invitation create, list, get and cancel - #2929
Closes#2858. Adds zitadel invitation create, list, get and cancel over the invitations contract (#2849), in a new "Project administration" group in zitadel --help (ADR 086 §8).
create asks who the invitation is for and which role it grants, confirms, and prints the link with "Whoever opens it gets the role. It expires in 72 hours." --name, --relation and --replaces skip the matching question; non-interactive runs ask nothing and need --relation.
list filters by --status and --type, paged like the other list commands.
cancel is destructive (needs --force non-interactively); without an id it offers the pending invitations.
The commands are standalone in the API coverage test; lookup, accept and reject stay exempt. The spec names each command with x-zitadel-cli.
SKILL.md, the command reference, the telemetry catalog and docs page, and a @zitadel/cli changeset are updated.
Hand-written commands over the invitations contract (#2849), in a new
Project administration help group. The link appears only in create's
output; telemetry records the role and whether it replaced one.
Refs #2858
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CLI loads commands from an explicit COMMANDS table, so the
invitation commands were unreachable and missing from the reference
and the docs. Adds the topic and its help group row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hi @mridang
I have created this PR, but will keep it as draft until the server implementation lands.
vitorbari
changed the title
feat: add zitadel invitation create, list, get and cancel
feat: CLI - add zitadel invitation create, list, get and cancel
Nov 12, 2026
A dry run now answers with the request it would send. --replaces reads
the original first: an accepted one is refused before anything is
asked, and a replacement without --name keeps the original's name, as
the server does. The name prompt asks one question, and list gains a
unit test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unescaped links and invitation-name hints allow terminal control-sequence injection, while dry-run paths incorrectly require credentials or live server calls.
- create --dry-run answers before connecting or reading the original.
- cancel --dry-run needs the id instead of reading the pending list.
- The printed link and the picker's hints are escaped for the terminal.
- --name counts characters, as the API's maxLength does.
- The API reference's CLI samples spell invitation create and list
with their flags, and fall back to the api call for team invitations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Non-interactive invitation cancellation fetches invitations before rejecting a missing ID, allowing network errors or timeouts to obscure the required-input error.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Reject missing IDs before connecting in non-interactive mode
A bare invitation cancel --non-interactive (including --json) cannot use the picker, but this first opens a connection and fetches every pending invitation before ask.select refuses the missing ID. An unavailable server therefore produces a network error or timeout instead of reporting the missing input. Reject an omitted invitation ID before connecting when this.nonInteractive is true; only interactive runs need to fetch the choices.
Regenerate the README command reference
apps/cli/src/index.ts:98
The four commands are registered here and added to command-reference.json, but the generated command section in apps/cli/README.md still contains no invitation commands. That README ships with the CLI, so package consumers receive an incomplete command reference. Please run moon run cli:readme and commit the regenerated README alongside these registrations.
A non-interactive run, like a dry run, now refuses an omitted id before
reading the pending list, so a down server cannot hide the missing
input. Regenerates the CLI README, which lacked the invitation commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups and retries are { id, flags } suggestions, refusals take no
suggester, list declares --all's exclusion through relatedFlags, and its
page carries only the token. Regenerates the CLI README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The four commands match the invitations contract, but none of their behaviour is tested beyond flag parsing, there are no integration specs for any of them, and create --replaces refuses an accepted invitation only after it has already asked the questions. The branch is also 29 commits behind main; a trial merge is conflict-free, but seven files this PR touches have changed there.
4 major issues
No test runs any command logic · New
No integration specs and no mock handlers for the four commands · New
The invitation service has no unit test · New
--replaces is validated after the prompts, and a dry run skips it · New
3 minor issues
Spec constants are hand-written although the generated schema exports them · New
The invitation id schema is defined in three files · New
Arrow functions return an object literal directly · New
- create --replaces reads the original before any question, and a dry
run reads it too, so an accepted one is refused the same way in both.
- The invitation id schema has one home (invitation/id.ts); the name
limit and the list's statuses and types come from the generated
schema; refusals are declared as const satisfies.
- Unit tests for the invitation service, and for create's and cancel's
questions, refusals and the requests they do not send.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapt the invitation commands to main: the task-based help groups put
them under Users and access, the test fixtures moved to tests/fixtures,
and the invitation contract now names the path parameter invitation_id,
reports responded_by/responded_at and takes status as a list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2983 — merge after it.
Summary
Closes #2858. Adds
zitadel invitation create,list,getandcancelover the invitations contract (#2849), in a new "Project administration" group inzitadel --help(ADR 086 §8).createasks who the invitation is for and which role it grants, confirms, and prints the link with "Whoever opens it gets the role. It expires in 72 hours."--name,--relationand--replacesskip the matching question; non-interactive runs ask nothing and need--relation.listfilters by--statusand--type, paged like the other list commands.cancelis destructive (needs--forcenon-interactively); without an id it offers the pending invitations.lookup,acceptandrejectstay exempt. The spec names each command withx-zitadel-cli.@zitadel/clichangeset are updated.Notes
createrecordsroleandis_replacedimensions on the command events; feat: CLI - send invitation analytics events from zitadel invitation create and cancel #2932, stacked on this PR, replaces them with theinvitation_createdevent ADR 086 §9 names (Analytics: invitation events #2859). The link never reaches telemetry.🤖 Generated with Claude Code