Repository navigation
feat(cli): api uploads a file's bytes, signs only where the spec says, and takes no token without sign-in - #3083
Merged
Merged
Conversation
…, and takes no token without sign-in - A generated api command for an upload (application/octet-stream, as Petstore 3's uploadFile) takes --body-file <path|-> and sends the bytes with the operation's content type; a file in the CLI's own folders is refused, as for a JSON body. - Signing follows cli-base's signInRequirements/signInPlace: the operation's own security, else the document's, and nothing when neither names one. The bearer default for a manifest without schemes is gone. - serviceApiCommand and serviceApiCall take no token for a CLI without sign-in. - serviceApiOperations lists what the api group offers; a body it cannot send (a multipart form) is left out with its reason in api show. - mcp check: a test that a CLI without signedIn is healthy with signed_in null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es follow 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Task
Before cli-template's public launch, CLIs made by
new --spec-urlfor real public specs failed in the api group. This is the runtime half; the generator half is cli-base#622 (released as 0.112.0).Why
uploadFiletakesapplication/octet-stream; the api group could send only JSON.Authorization: Bearer, and a CLI made with--sign-in nonecould not call its api at all (a token was required).What
--body-file <path|->and sends the bytes with the operation's content type. A file in the CLI's own folders is refused, as for a JSON body.signInRequirements/signInPlace: the operation's own security, else the document's, nothing when neither names one. The bearer default is gone (under "Changed — may break callers").serviceApiCommand/serviceApiCalltake an optional token.serviceApiOperations(manifest)returns{ offered, left }; a body cli-core cannot send is left out with its reason.>=0.112.0; STANDARD.md tables regenerated.mcp check: a test that a CLI withoutsignedInis healthy withsigned_in: null. No code change was needed there.Testing
service-api.test.ts(no sign-in where the spec names none or the CLI has none; uploads from--body-file) failed before the fix.ci:quick, docs checks, fullpnpm test(12449 passed).cli-template new --preset generic --spec-urlfor Resend, Petstore 3 and Petstore 3 with--sign-in none, linked to packed builds of this branch and cli-base. generate, build, test (245 / 123 / 123) andmcp checkpass. No real account, no real API call.🤖 Generated with Claude Code