Skip to content

fix(cli): restore api-keys create flags; release note for 1.4 - #243

Merged
duharry0915 merged 2 commits into
mainfrom
claude/cli-api-keys-create-flags
Sep 14, 2026
Merged

duharry0915 merged 2 commits into
mainfrom
claude/cli-api-keys-create-flags

Conversation

@duharry0915

@duharry0915 duharry0915 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

The 1.4.0 regen (agentmail-cli#52) dropped the per-field flags from three commands that work against prod today:

command 1.3.0 #52 (1.4.0) this PR
api-keys create --name --permissions + 36 --permissions.* --json only --name --permissions --public-key --client-id --expires-at + 38 --permissions.*
inboxes api-keys create same --json only same as above
pods api-keys create same --json only same as above

Cause: #231 turned CreateApiKeyRequest into a oneOf (bearer key or public key), and fern-cli-generator 0.38.10 emits only --json for a union body.

Fix (CLI overrides only, SDKs untouched): the three create operations now point at a flattened CliCreateApiKeyRequest with both variants' fields. I tried two narrower versions first and both failed:

  • Listing PublicJwk's members made --public-key.x and .y required flags, which blocked bearer creation.
  • A bearer-only body made the CLI's local schema check reject public_key passed via --json.

So public_key is a free-form object here, and the server validates the JWK.

Release note

Also adds an Upgrading to 1.4 section to integrations/cli.mdx (folded in from #244), above the 1.2 note and in the same style:

Test plan

Local generation (temporary local-file-system group, not committed) + cargo build + --dry-run:

  • api-keys create --name ci-test --permissions.inbox-read true{"name":"ci-test","permissions":{"inbox_read":true}}, the same body as 1.3.0 and with no null variant fields. Same result on the inbox and pod routes.
  • --public-key '{…}' --client-id cid --expires-at … → correct public-key body
  • --json '{"public_key":{…},"name":"pk","client_id":"cid"}' passes the local check
  • Generated output differs from adding four fields into the sdk #52 only in the three api-keys resources, the new type, and the embedded spec. reference.md is identical.
  • gen-cli-overrides.py --check passes
  • fern check: 0 errors; every flag and value in the release note matches --help on the local 1.4.0 build

After merge: re-dispatch release-cli.yml at 1.4.0 and close #52.

🤖 Generated with Claude Code

CreateApiKeyRequest became a oneOf (bearer key | public key) in #231. The
CLI generator emits only --json for a union body, so the 1.4.0 regen
dropped --name, --permissions and the --permissions.* flags from
`api-keys create`, `inboxes api-keys create` and `pods api-keys create`,
all of which work against prod on 1.3.0.

The CLI overrides now point those three operations at a flattened
CliCreateApiKeyRequest carrying both variants' fields. public_key is a
free-form object: with PublicJwk's members listed, generator 0.38.10
turns x/y into required top-level flags and blocks bearer creation; a
bearer-only body instead makes the local schema check reject public_key
passed via --json. Verified with a local generation and --dry-run: bearer
flags send the same body as 1.3.0, and public keys work via
--public-key/--client-id/--expires-at or --json.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@duharry0915 duharry0915 mentioned this pull request Sep 14, 2026
2 tasks
1.4 drops the twelve public-key and browser-credential commands whose API
routes were removed in #231/#237, renames providers connect --authorize to
--accept-disclosure, and adds inbox search and api-keys get/update. Maps
each removed 1.3 command to its api-keys replacement.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@duharry0915 duharry0915 changed the title fix(cli): restore api-keys create flags lost to the oneOf request body fix(cli): restore api-keys create flags; release note for 1.4 Sep 14, 2026
@github-actions

Copy link
Copy Markdown

@duharry0915
duharry0915 merged commit 415ecd4 into main Sep 14, 2026
3 checks passed
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.

2 participants