Repository navigation
feat(cli): install the complex command; publish as complex.md - #41
Conversation
Intent: give the CLI a 1 word command that matches the project name. The only command was complex-md. The package now installs complex, complex.md and complex-md, and all 3 run bin/complex-md.js. complex-md stays because hooks and CI files from earlier versions call it. complex.md is the bin that npx picks when the package is published as complex.md, since npx runs the bin named like the package. Verify: cd cli && npm test, 840 pass, 0 fail. npm pack, then a global install into a scratch prefix: all 3 commands print 0.11.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Intent: let a release reach npm under the project's own name. npm runs `npx complex.md` only if a package has that name. The release job now publishes the same build a second time with the name set to complex.md. Trusted publishing needs the package to exist first, so the step checks the registry and skips until the first manual publish. Verify: the workflow parses; npm pack --dry-run with the name set gives complex.md-0.11.0.tgz with 47 files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jameslcowan
left a comment
There was a problem hiding this comment.
Review: merge. No tag and no publish come with it; the release stays the maintainer's decision.
What I checked.
cd cli && npm testone9f548e: exit 0, 840 pass, 0 fail, 2 todo. CI is green on all 6 legs.- The 3 bin names point at 1 entry, and
complex-mdstays. Hooks, CI files andAGENTS.mdblocks that earlier versions wrote keep working. This is a minor change under the semver rule inCONTRIBUTING.md, and the CHANGELOG entry sits under Unreleased. npxneeds a bin named like the package when a package has more than 1 bin.bin-names.test.jschecks that for both names. That test is the right one to have: without it,npx complex-mdwould fail with "could not determine executable to run".- The release step runs after both existing publishes, so a failure there cannot block
complex-mdorcomplex-md-mcp.npm pkg set name=complex.mdchanges only the runner's copy ofcli/package.json. npm view complex.mdreturns 404 today, so the step skips, as the description says.
Risks to check before the first complex.md publish. Neither blocks this merge, because no published text names complex.md yet.
- npm may refuse the name. npm rejects a new package name that matches an existing one once punctuation is removed.
complex.mdandcomplex-mdboth becomecomplexmd. npm does not document an exception for the same owner. The first hand publish will show it; if npm refuses, a scoped name or a request to npm support are the options. Find out before the README changes. complex.mdon Windows. npm writes 3 shims per bin:complex.md,complex.md.cmdandcomplex.md.ps1.cmd.exelooks for a command that has an extension under its exact name first, so it may find the extensionlesscomplex.mdshim and open it with the.mdfile association instead of running it.npx complex.mdon Windows runs the command throughcmd.exetoo. I did not test this. A global install on the Windows runner, thencomplex.md --versionincmdandpwsh, answers it.complexandcomplex-mdhave no extension and are not affected.
Small suggestion, not done here. The skip test npm view complex.md version treats any failure as "not on npm", a network error included. In that case a release would skip the complex.md publish and still show green. Matching E404 in the output would make a network error fail the step instead.
Process note. This pull request changes release.yml, so it is gated under "Maintainer agents" (#42). The maintainer approved this merge in advance. No version tag is pushed, so nothing publishes.
What changed
The only command was
complex-md, andnpx complex-mdis the only way to run it without an install. The project is named complex.md, so the command and the package name did not match the name people see.complex,complex.mdandcomplex-md.complex-mdstays, so hooks, CI files and AGENTS.md lines from earlier versions keep working.complex.md, sonpx complex.mdworks. Trusted publishing needs a package that exists, so the step skips until the first publish ofcomplex.mdis made by hand.The README, the help text and the site still say
npx complex-md. They change in a later pull request, aftercomplex.mdis on npm, so no text names a package that does not exist yet.How it was tested
cd cli && npm test: 840 pass, 0 fail, 2 todo.npm pack, then a global install into a scratch prefix:complex --version,complex.md --versionandcomplex-md --versionall print 0.11.0.npm pkg set name=complex.md && npm pack --dry-run:complex.md-0.11.0.tgz, 47 files.AI assistance
Assisted-by:or aCo-Authored-By:trailer.🤖 Generated with Claude Code