refactor: rename package to @photon-ai/cli#18
Conversation
Aligns with industry convention (@vercel/cli, @supabase/cli, @dokploy/cli, etc.) and matches the binary's role rather than duplicating the name. The previous reasoning behind @photon-ai/photon (PR #11) was that the post-scope segment must match the bin name for unpinned `npx <pkg>` to auto-resolve. That turns out to have been an overly strict reading of PR #12's findings — the actual rule npm 11 uses is "single bin auto-resolves regardless of name match." Confirmed empirically against @dokploy/cli, which has bin `dokploy` (not `cli`) and works unpinned. Bin shape switches from string-form to single-key object: "bin": "./dist/photon.js" → "bin": { "photon": "./dist/photon.js" } This keeps the binary registered as `photon` (string form would have made it `cli`, breaking every existing user invocation). Verified locally against @photon-ai/cli@0.1.3 tarball: - bun add -g: installs `photon`, lazy `pho` symlink fires on first run - npm install (local): same - `npx --yes <tarball>` resolves to 0.1.3 via single-bin auto-resolve Existing `@photon-ai/photon` users will keep getting 0.1.3 (final version on the old name). Migration path: re-install with `bun add -g @photon-ai/cli`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (4)package.json📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{html,ts,tsx,css}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{html,ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🔍 Remote MCP LinearBased on my search of Linear, I found relevant context about similar package renaming patterns in the Photon ecosystem. Here's what I discovered: Additional Context for PR ReviewSimilar Package Renaming Pattern FoundENG-1006 completed a similar package rename for the Cosmos CLI package, changing it from a generic name to Applicable Scoped Package Publishing StandardENG-1262 demonstrates the organization's standard approach to publishing under the Package Publishing ProcessThe PR's migration strategy (keeping bin Field ConventionThe change from 🔇 Additional comments (4)
📝 WalkthroughWalkthroughThe package name is renamed from ChangesPackage Rename to
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Warning Review ran into problems🔥 ProblemsThese MCP integrations need to be re-authenticated in the Integrations settings: Linear Comment |
There was a problem hiding this comment.
Pull request overview
This PR renames the published npm package from @photon-ai/photon to @photon-ai/cli while preserving the photon binary name (and continuing to rely on the runtime-created pho alias) to maintain expected install and npx behavior.
Changes:
- Renamed the npm package to
@photon-ai/cliand changedbinto a single-key object mapping (photon→./dist/photon.js). - Updated release workflow metadata to publish under the new package name.
- Updated README install/usage snippets and the
phoalias rationale comment to reflect the new package name and bin shape.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
package.json |
Renames package to @photon-ai/cli and pins the binary name via single-key bin object. |
.github/workflows/release.yaml |
Updates release workflow service-name to match the new npm package name. |
README.md |
Updates install/usage examples to use @photon-ai/cli. |
src/lib/pho-alias.ts |
Updates documentation comment to reflect new bin shape and package name in npx examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Why
@photon-ai/photonwas redundant — the binary isphotonand the package name shouldn't repeat the binary name. Industry convention (@vercel/cli,@supabase/cli,@dokploy/cli) is@<scope>/cli, which reads more naturally and avoids the doubled-up phrasing.The npm-11-npx caveat that almost blocked this
In PR #12 we discovered that npm 11's
npx <scoped-pkg>(no version pin) only auto-resolves the binary under specific conditions, and we attributed it to "post-scope segment must match the bin name". On that reading, renaming to@photon-ai/cli(with binphoton) would break unpinned npx — so I asked before doing the rename.Researching prior art with @dokploy/cli — bin
dokploy, post-scopecli, names don't match, butnpx @dokploy/cliworks unpinned — proved that reading wrong. The actual npm 11 rule is simpler: single-bin auto-resolves regardless of name match. PR #12's bug was specifically the multi-bin shape ({ photon, pho }), not the post-scope mismatch.So this rename is safe as long as we keep
binto a single entry. Switching from string-form to single-key object:The string form would have made npm register the binary under the post-scope name (
cli) — which would break every existingphoton/phouser invocation. The explicit object pins the binary name back tophoton.Verified locally with @photon-ai/cli@0.1.3 tarball
After publish, the empirical test of unpinned npx will be
npx @photon-ai/cli --versionfrom a clean directory.Files changed
package.json—name,bin.github/workflows/release.yaml—service-nameREADME.md— install snippets (npx,bunx,bun add -gexamples)src/lib/pho-alias.ts— comment updated to reflect single-entry-object shapeMigration
@photon-ai/photon@0.1.3becomes the final version on the old name. Existing users re-install withbun add -g @photon-ai/cli. After this PR ships,npm deprecate @photon-ai/photon "moved to @photon-ai/cli"is a one-liner follow-up.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit
@photon-ai/photonto@photon-ai/cliacross release workflow, documentation, and configuration files