fix(publisher): document --algorithm for ECDSA login and fix validate --help - #1519
Merged
Conversation
… --help
The ECDSA P-384 login instructions could not work. Every "ECDSA P-384" tab ran the
same command as the Ed25519 tab:
mcp-publisher login dns --domain "$MY_DOMAIN" --private-key "$PRIVATE_KEY"
`--algorithm` defaults to ed25519, so a 96-hex ECDSA key is rejected:
Error: failed to get token: failed to sign timestamp:
invalid seed length: expected 32 bytes, got 48
Verified against a real P-384 key: the command above fails, and the same command
with `--algorithm ecdsap384` reaches "Expected proof record". `--algorithm` was
documented nowhere -- `grep -rn algorithm docs/` had zero hits for it -- even though
the CLI's own help text describes it correctly.
Also fixes `mcp-publisher validate --help`, which printed "Unknown command: validate"
followed by the general usage that itself says to run `<command> --help`. main.go
intercepted `--help` for every subcommand and called printCommandHelp, whose switch
had no `validate` case, making ValidateCommand's own help block unreachable.
printCommandHelp now reports whether it handled the command so the caller falls
through to normal dispatch, letting a command parse its own `--help`. This avoids a
second copy of the help text and fixes any future command with the same shape.
Unknown commands still exit 1.
Docs corrected:
- Add `--algorithm ecdsap384` to all four in-process ECDSA examples, and note that
cloud signing providers derive the algorithm from the key so the flag does not
apply to them
- `--registry` is a `login` flag, not global. `publish --registry=URL` treats the
flag as the server.json path; other commands read the URL from the login token.
Corrected in both the CLI reference and cmd/publisher/README.md
- Document `--token` (login github only), which github-actions.mdx already uses
- `init` takes no flags and is non-interactive; it writes TODO placeholders rather
than prompting for missing fields
- Refresh the `--help` transcript in quickstart.mdx, which omitted `status` and
`validate`; it now matches the real output exactly
- Add `validate` to the command list in cmd/publisher/README.md
Co-Authored-By: Claude Opus 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.
Two real defects, plus the CLI reference claims that go with them.
1. ECDSA P-384 login instructions cannot work
Every "ECDSA P-384" tab ran the identical command to the Ed25519 tab. Since
--algorithmdefaults to ed25519 (login.go:100), a 96-hex key is rejected outright. Verified against a freshly generated P-384 key:--algorithmis registered at login.go:129 and described correctly by the CLI's own help, butgrep -rn algorithm docs/had zero hits for it. Anyone following the ECDSA path in the docs hit that error with nothing to tell them why.Fixed at all four in-process ECDSA sites (2 in
authentication.mdx, 2 incli/commands.md), with a note that cloud signing providers derive the algorithm from the key itself so the flag does not apply to them.2.
mcp-publisher validate --helpwas brokenIt printed the very instruction that had just failed.
main.gointercepted--helpfor all subcommands and calledprintCommandHelp, whose switch had novalidatecase — makingValidateCommand's own help block (validate.go:120-129) unreachable.Rather than paste a third copy of the help text,
printCommandHelpnow returns whether it handled the command, and the caller falls through to normal dispatch when it did not. Commands own their own--help, and any future command with this shape works automatically.validate --helpUnknown command, exit 0publish --helpinit -hbogus --helpUnknown command, exit 0Unknown command, exit 13. CLI reference corrections
--registryis not global. It exists only onlogin; other commands read the URL from the stored token.publish --registry=URLsilently treats the flag as theserver.jsonpath.cmd/publisher/README.mdhad exactly this broken example.--tokenwas undocumented despitegithub-actions.mdx:123depending on it. Now documented, noting it islogin githubonly.inittakes no flags and does not prompt; it writesTODO:placeholders. The reference saidinit [options]and "Prompts for missing required fields".--helptranscript inquickstart.mdx, which listed only 4 of 6 commands. Now byte-for-byte identical to real output (diffed).validateto the command list incmd/publisher/README.md.Verification
go buildandgo test ./cmd/...pass. All four help paths exercised with exit codes checked. The 23goconstfindings invalidate_test.goare pre-existing — identical count on pristinemain, none inmain.go. Quickstart transcript diffed against real output.🤖 Generated with Claude Code