Skip to content

feat: prepare for npm publish + binary releases (Phase 10)#11

Merged
citron (lcandy2) merged 3 commits into
mainfrom
feat/publish-prep
Apr 29, 2026
Merged

feat: prepare for npm publish + binary releases (Phase 10)#11
citron (lcandy2) merged 3 commits into
mainfrom
feat/publish-prep

Conversation

@lcandy2
Copy link
Copy Markdown
Member

@lcandy2 citron (lcandy2) commented Apr 29, 2026

Phase 10 — distribution. After this lands, adding the release label to a PR runs the full pipeline: AI-generated release notes, version bump, GitHub Release, npm publish to @photon-ai/photon, and cross-platform binary uploads.

What's new

package.json

  • name: dashboard-cli@photon-ai/photon. Post-scope segment matches the photon binary, so npx @photon-ai/photon … and bunx @photon-ai/photon … resolve directly without --package. Unscoped photon and photon-cli are both taken on npm.
  • Drop private: true → publishable.
  • bin: { photon, pho } points at dist/photon.js (built artifact). The Bun bundle preserves #!/usr/bin/env bun so it's directly executable.
  • Added: repository, homepage, bugs, keywords, author, files: ["dist", "README.md"], publishConfig.access: public, engines.bun: ">=1.3.0".
  • build now chmod +x's the output.
  • prepublishOnly runs typecheck + build so a stale dist/ never ships.
  • typescript lives in devDependencies (not peerDeps) — avoids peer-dep noise for consumers.

README.md

Full end-user rewrite: quickstart, npx/bunx one-off usage, environments + per-env creds ($PHOTON_CONFIG_DIR-aware), project linking, CI/scripting via PHOTON_TOKEN, full command tree, flag-scope table (program-level vs per-cmd), dev workflow, release process.

.github/workflows/release.yaml (new)

Thin caller of photon-hq/buildspace's typescript-service-release.yaml@main — matches the photon-hq convention used by spectrum-ts and uri. Triggers on push to main; buildspace's release PR-label gate decides whether to actually publish. workflow_dispatch for manual force-release / dry-run. Uses secrets: inherit so org-level OPENAI_API_KEY + NPM_TOKEN flow through automatically.

.github/workflows/release-binaries.yaml (new)

Triggers on release: created (after release.yaml's GitHub Release is published). Decoupled from the npm publish — npm consumers get the Bun bundle, Release-page downloaders get a self-contained executable.

Matrix: macos-latest (arm64), macos-15-intel (x64), ubuntu-latest (x64 + arm64). bun-version pinned to 1.3.13 (tracks package.json#engines.bun lower bound). Uses bun build --compile --target=bun-<os>-<arch> per platform. Smoke-tests native targets. Computes SHA256 alongside each binary. workflow_dispatch for re-attaching to an existing tag.

Required secrets

Both are org-level at photon-hq and pass through via secrets: inherit — nothing to configure on this repo.

  • OPENAI_API_KEY — buildspace's generate-release-info block uses it for AI-generated release notes.
  • NPM_TOKEN — npm automation token (publishes to @photon-ai).

Test plan

  • bun run build produces dist/photon.js (~381 KB) and it's executable.
  • ./dist/photon.js --version prints 0.0.1.
  • ./dist/photon.js --help shows all 13 top-level commands.
  • bunx tsc --noEmit clean.
  • After merge: add release label to a test PR to dry-run the publish.
  • Verify bun add -g @photon-ai/photon works on a fresh machine.
  • Verify npx @photon-ai/photon --version resolves the binary directly.
  • Verify standalone binary from a Release runs without Bun installed.

How to actually publish (after this PR merges)

  1. Open a PR. Add the release label. Merge.
  2. Watch the workflows: release.yaml publishes to npm + creates the Release; release-binaries.yaml attaches photon-darwin-arm64 / photon-darwin-x64 / photon-linux-x64 / photon-linux-arm64 (+ .sha256s).

Phase status

Phase What Status
5 Foundations + linking
6 Project mutations + profile init/update
7 Spectrum (users/lines/platforms/profile/avatar)
8 Billing
9 auth status / config show / update-notifier
10 Publish prep 🟡 this PR

After this merges, every command in the build plan is shipped; the CLI is publish-ready.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Automated release pipeline to produce and publish standalone executables for macOS and Linux
    • CLI now supports structured JSON output, per-environment targeting, persisted default env, and project-resolution precedence
  • Documentation

    • Complete Photon CLI guide: installation, authentication (login), command reference, flags semantics, CI/scripting guidance, and release instructions
  • Chores

    • Package rebranded and prepared for publication with updated publish settings and build/publish hooks; CLI entrypoints updated to use built build artifact

Phase 10 — distribution. After this lands, adding the `release` label
to a PR runs the full pipeline: AI-generated release notes, version
bump, GitHub Release, npm publish (@photon-ai/cli), and cross-platform
binary uploads.

package.json
- name: dashboard-cli → @photon-ai/cli (matches the existing
  @photon-ai npm scope; binary stays bare as `photon`).
- private: true → dropped (now publishable).
- bin: { photon, pho } now point at dist/photon.js (built artifact)
  rather than src/index.ts. Bun build preserves the #!/usr/bin/env bun
  shebang so the bundled file is directly executable.
- Added: license: MIT, repository, homepage, bugs, keywords, author,
  files: ["dist", "README.md", "LICENSE"], publishConfig.access: public,
  engines.bun: ">=1.3.0".
- build script now `chmod +x` the output.
- prepublishOnly runs typecheck + build so a stale dist/ never ships.

Verified: `bun run build` produces dist/photon.js (381 KB), running
it directly prints the version.

LICENSE
- MIT, 2026 Photon.

README.md
- Full end-user rewrite: quickstart, environments + per-env creds,
  project linking, CI/scripting via $PHOTON_TOKEN, full command tree,
  global flags table, dev workflow, release process.
- Replaces the bun-init placeholder.

.github/workflows/release.yaml (NEW)
- Thin caller of photon-hq/buildspace's typescript-service-release.yaml.
- Triggers on PR merge (closed + merged=true) — `release` label on the
  PR drives the actual publish via buildspace's PR-label gate.
- workflow_dispatch input for manual force-release / dry-run.
- Wires through OPENAI_API_KEY (release notes) and NPM_TOKEN secrets.

.github/workflows/release-binaries.yaml (NEW)
- Triggers on `release: created` (after release.yaml's GitHub Release
  is published). Decoupled from the npm publish flow — npm consumers
  get the Bun bundle, Release-page downloaders get a self-contained
  executable.
- Matrix: macOS arm64 / macOS x64 / linux x64 / linux arm64. Uses
  `bun build --compile --target=bun-<os>-<arch>` for each.
- Smoke-tests native targets (we can run macOS-arm64 on macos-latest
  and linux-x64 on ubuntu-latest; cross targets ship without run-test).
- Computes SHA256 alongside each binary for verification.
- workflow_dispatch input for re-attaching binaries to an existing tag.

Required secrets (must be set on the repo before the first release):
- OPENAI_API_KEY (release notes generation)
- NPM_TOKEN (npm publish — automation token from npmjs.com)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
Copilot AI review requested due to automatic review settings April 29, 2026 18:37
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

Adds two release workflows (binary build + reusable release), rebrands/publishes the package as @photon-ai/photon with CLI entrypoint pointing to built dist, and replaces README with full Photon CLI documentation and release/publishing guidance. (50 words)

Changes

Cohort / File(s) Summary
Release binaries workflow
.github/workflows/release-binaries.yaml
New GitHub Actions workflow that triggers on release/create and manual dispatch; builds platform-specific standalone binaries via bun build --compile (matrix macOS/Ubuntu), runs smoke tests for select targets, computes SHA256 sidecars, resolves the release tag, and uploads binaries + checksums to the GitHub Release with gh release upload (permissions: contents: write).
Reusable Release trigger
.github/workflows/release.yaml
New workflow that triggers on pushes to main and manual dispatch; invokes reusable workflow photon-hq/buildspace/.../typescript-service-release.yaml@main, forwards release/dry-run inputs conditionally, grants contents: write and pull-requests: read, and inherits secrets.
Package manifest / CLI
package.json
Renames package to @photon-ai/photon, removes private, sets publishConfig.access: public, adds metadata and files whitelist (dist, README.md), changes bin entries to ./dist/photon.js, adds prepublishOnly (typecheck→build) and makes build output executable, moves TypeScript to devDependencies.
Documentation
README.md
Replaces placeholder README with full Photon CLI docs: installation (global bun bundle, npx/bunx), auth flow (photon login), environment/project resolution, credential persistence, command/flags reference (global vs per-command), scripting/CI guidance (--token, --json), development and release instructions including binary upload details.

Sequence Diagram(s)

sequenceDiagram
  participant User as Release Event / Manual Trigger
  participant GA as GitHub Actions Runner (matrix)
  participant Bun as bun build
  participant Smoke as Smoke Test (--version)
  participant Shasum as shasum/sha256sum
  participant GH as GitHub Releases (gh CLI / API)

  User->>GA: release.created or workflow_dispatch(tag)
  GA->>Bun: bun build --compile (per-target, outputs to dist/)
  Bun-->>GA: compiled binary artifact
  GA->>Smoke: run binary --version (selected targets)
  Smoke-->>GA: smoke test result
  GA->>Shasum: compute SHA256 .sha256
  Shasum-->>GA: checksum file
  GA->>GH: resolve release tag (event vs input) & gh release upload (binary + .sha256)
  GH-->>User: release assets updated
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A tiny rabbit hops and sings with glee,
Built binaries bundled, checksums all agree.
From src to dist the little bytes take flight,
Uploaded to releases in the soft moonlight.
🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: prepare for npm publish + binary releases (Phase 10)' directly and accurately summarizes the main changeset—enabling npm publishing and cross-platform binary releases through package.json updates, CI workflows, and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

These MCP integrations need to be re-authenticated in the Integrations settings: Linear


Review rate limit: 3/5 reviews remaining, refill in 18 minutes and 6 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

After researching how spectrum-ts and uri consume buildspace:

release.yaml
- Switch trigger from `pull_request: closed` to `push: branches: [main]`
  (matches both reference repos). Buildspace's PR-label gate looks back
  at the merge commit's PR for the `release` label, so the trigger
  doesn't need its own filter.
- Replace explicit `secrets:` block with `secrets: inherit`. Both
  reference workflows use this pattern — org-level OPENAI_API_KEY +
  NPM_TOKEN are configured at photon-hq and inherit automatically.
  No need for the calling workflow to forward them by name.
- service-name now uses the full scoped npm name "@photon-ai/cli"
  (matches uri's "@photon-ai/uri").

License
- Removed LICENSE file and dropped the `license` field from
  package.json + the README section (per user direction). Removed
  "LICENSE" from package.json `files`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release-binaries.yaml:
- Line 31: Replace the deprecated runner label by updating the YAML key "os:
macos-13" to a supported macOS runner label (e.g., "os: macos-15-intel") in the
workflow; locate the occurrence of the string "os: macos-13" in the workflow
step and change it to the chosen supported label so the GitHub Actions runner is
valid.

In `@README.md`:
- Around line 59-60: Update the README examples and flags section so non-global
flags appear after the subcommand: change examples like "photon --env staging
projects ls" and "photon --token XYZ ..." to the correct form "photon projects
ls --env staging" (or keep "PHOTON_ENV=staging photon projects ls" for env var
usage) and ensure only "--debug" is described as a global flag; rename or reword
the "Global flags" heading (and move flag descriptions) to indicate which flags
are per-command vs truly global (e.g., mark "--token", "--env", etc. as
per-command flags and keep "--debug" as the lone global flag).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 35d2f51c-69e8-42fd-b66a-0fc0ecd82cf4

📥 Commits

Reviewing files that changed from the base of the PR and between 1835911 and 1826460.

📒 Files selected for processing (5)
  • .github/workflows/release-binaries.yaml
  • .github/workflows/release.yaml
  • LICENSE
  • README.md
  • package.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
package.json

📄 CodeRabbit inference engine (CLAUDE.md)

package.json: Use bun install instead of npm install, yarn install, or pnpm install in package.json
Use bun run <script> instead of npm run <script>, yarn run <script>, or pnpm run <script>

Files:

  • package.json
🧠 Learnings (8)
📚 Learning: 2026-04-05T00:07:13.859Z
Learnt from: qwerzl
Repo: photon-hq/buildspace PR: 62
File: .github/workflows/update-docs.yaml:164-167
Timestamp: 2026-04-05T00:07:13.859Z
Learning: In photon-hq/buildspace, all reusable workflow blocks are intentionally referenced using `main` (e.g., `photon-hq/buildspace/.github/blocks/check-pr-labelmain`, `photon-hq/buildspace/.github/blocks/update-docsmain`). This is by design: the blocks and workflows ship together in the same repo and stay in sync. Do not flag these as version-pinning issues; pinning to a release tag would add unnecessary maintenance burden on every buildspace release.

Applied to files:

  • .github/workflows/release-binaries.yaml
  • README.md
  • .github/workflows/release.yaml
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>`

Applied to files:

  • README.md
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install`

Applied to files:

  • README.md
📚 Learning: 2026-04-21T18:03:17.985Z
Learnt from: lcandy2
Repo: photon-hq/dashboard PR: 40
File: apps/web/next.config.ts:6-8
Timestamp: 2026-04-21T18:03:17.985Z
Learning: In the photon-hq/dashboard repo (`apps/web/next.config.ts`), `typescript.ignoreBuildErrors: true` is intentional. Eden's `import type { App }` (cross-workspace type import from `photon-dashboard/api`) triggers unresolvable type resolution issues during `next build` in the Turborepo monorepo. Runtime behavior is correct and types resolve at dev time via the separate `typecheck` turbo task. Do not flag this as an issue.

Applied to files:

  • README.md
  • package.json
📚 Learning: 2026-03-10T22:49:19.048Z
Learnt from: CR
Repo: photon-hq/advanced-imessage-kit PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-10T22:49:19.048Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>` for running TypeScript and JavaScript files

Applied to files:

  • README.md
📚 Learning: 2026-04-28T03:08:36.661Z
Learnt from: CR
Repo: photon-hq/cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-28T03:08:36.661Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json

Applied to files:

  • README.md
📚 Learning: 2026-04-16T22:15:43.439Z
Learnt from: CR
Repo: photon-hq/spectrum-cloud PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-16T22:15:43.439Z
Learning: Applies to **/*.ts?(x) : Use `Bun.$` for shell commands instead of `execa`

Applied to files:

  • README.md
📚 Learning: 2026-03-10T22:49:19.048Z
Learnt from: CR
Repo: photon-hq/advanced-imessage-kit PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-10T22:49:19.048Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json scripts

Applied to files:

  • README.md
🪛 actionlint (1.7.12)
.github/workflows/release-binaries.yaml

[error] 31-31: label "macos-13" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2025-vs2026", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xlarge", "macos-latest-large", "macos-26-intel", "macos-26-xlarge", "macos-26-large", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xlarge", "macos-14-large", "macos-14", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🪛 LanguageTool
README.md

[uncategorized] ~189-~189: The official name of this software platform is spelled with a capital “H”.
Context: ... any PR; on merge, the Release workflow (a thin caller ...

(GITHUB)


[uncategorized] ~189-~189: The official name of this software platform is spelled with a capital “H”.
Context: ...pm. Standalone binaries are uploaded by release-binaries.yaml on eac...

(GITHUB)

🔍 Remote MCP Linear

Based on my search results, I have gathered sufficient context. Let me provide a summary of the relevant findings:

Summary of Additional Context for PR Review

Related Issue Structure & Publishing Pattern

The Linear workspace shows a consistent pattern for npm publishing workflows across multiple repositories in the photon-hq organization. Relevant precedent issues include:

  • ENG-1262 (uri project): Package renamed to @photon-ai/uri, configured with publishConfig.access: "public", using the buildspace reusable workflow
  • ENG-1263 (uri project): CI/CD setup using photon-hq/buildspace reusable workflows with bun run typecheck, bun run lint, bun test, and bun run build steps

Buildspace Integration Pattern

The reusable workflow delegation pattern (.github/workflows/release.yaml invoking photon-hq/buildspace/.github/workflows/typescript-service-release.yaml@main) is established and documented in multiple completed projects, indicating this is a standardized organizational practice. The workflow accepts configuration for:

  • Service name (photon-cli)
  • Build command (bun run build)
  • Secret forwarding (OPENAI_API_KEY, NPM_TOKEN)

Binary Release Workflow Precedent

  • ENG-837 (BuildSpace project): "Build block for publishing binary to public homebrew" indicates there is organizational experience with binary distribution, though homebrew publishing appears to be a separate future task from the current GitHub Release asset attachment approach

Critical Assumptions for Review

The PR assumes the following are already in place or will be configured post-merge:

  1. Repository Secrets: OPENAI_API_KEY and NPM_TOKEN must be set before triggering the first release
  2. Buildspace Workflow Access: The photon-hq/buildspace repository must be accessible and the typescript-service-release workflow must exist
  3. Bun Compilation Targets: The bun version (>=1.3.0 as specified in engines) must support --target=bun-darwin-arm64, bun-darwin-x64, bun-linux-x64, and bun-linux-arm64 for cross-platform binary builds

Key Publishing Configuration Details

From the related ENG-1262 issue pattern:

  • Scoped packages under @photon-ai npm org default to private, requiring explicit publishConfig.access: "public"
  • Binary names should align across bin entries and dist/ output names for consistency
  • prepublishOnly scripts ensure built artifacts are typecheck + build verified before publishing
🔇 Additional comments (3)
LICENSE (1)

1-22: MIT license addition looks good.

The license text is complete and correctly included for public distribution.

.github/workflows/release.yaml (1)

21-33: Release workflow wiring is solid.

Merge gating, manual overrides, and secret forwarding are set up cleanly.

Based on learnings, referencing photon-hq/buildspace reusable workflows on @main is intentional and should not be flagged as a pinning issue.

package.json (1)

41-47: Publish/build scripts are aligned for Bun-first release flow.

prepublishOnly guard plus Bun-based scripts look correct for npm publish readiness.

As per coding guidelines, package.json should use Bun commands (bun install / bun run <script>), and this segment complies.

Comment thread .github/workflows/release-binaries.yaml Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prepares the Photon CLI for public distribution via npm (@photon-ai/cli) and GitHub Releases, including automated release workflows and end-user documentation updates.

Changes:

  • Updates package.json for npm publishing (scoped name, publish metadata, bin points to built artifact, prepublish build/typecheck).
  • Replaces the placeholder README with end-user docs (install, concepts, command reference, dev + release process).
  • Adds GitHub Actions workflows to automate releases and attach compiled standalone binaries to GitHub Releases.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
package.json Makes the package publishable and points bin to dist/photon.js; adds publish metadata and prepublish script.
README.md New user-facing documentation covering install, environments, linking, CI usage, commands, and release process.
LICENSE Adds MIT license text for distribution.
.github/workflows/release.yaml Adds a reusable-workflow-based release pipeline on merge / manual dispatch.
.github/workflows/release-binaries.yaml Builds and uploads platform binaries + SHA256 to GitHub Releases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread .github/workflows/release.yaml
Comment thread .github/workflows/release-binaries.yaml Outdated
Comment thread .github/workflows/release.yaml Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
README.md (1)

59-60: ⚠️ Potential issue | 🟠 Major

Non-global flags are documented in an invalid CLI position.

--env and --token are shown before subcommands (Line 59, Line 84), and the Global flags section title (Line 141) overstates scope for per-command flags.

✏️ Proposed README fix
-photon --env staging projects ls             # one-off override
+photon projects ls --env staging             # one-off override
 PHOTON_ENV=staging photon projects ls        # same, via env var
@@
-photon --token "$PHOTON_TOKEN" projects ls
+photon projects ls --token "$PHOTON_TOKEN"
 # or
 PHOTON_TOKEN=… photon projects ls
@@
-## Global flags
+## Common command flags

Also applies to: 84-87, 141-153

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 59 - 60, The README incorrectly documents non-global
flags (--env, --token) as if they are global and shows them before subcommands;
update examples and sections so that --env and --token are documented in the
per-command examples where they apply (e.g., under the "projects" command
examples and any other affected command blocks around the examples at lines
showing 'photon --env staging projects ls' and 'PHOTON_ENV=staging photon
projects ls'), and change the "Global flags" section title/content (referenced
as 'Global flags') to only list truly global options; move any per-command flags
out of that global section and into the specific command documentation or
examples.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 63: Wording implies a fixed config directory; update the three README
occurrences that show "~/.config/photon/..." (the lines containing
"~/.config/photon/credentials/<env>.json", "~/.config/photon/..." and similar)
to present these as default locations rather than hardcoded paths and mention
that they can be overridden via PHOTON_CONFIG_DIR (refer to the existing
PHOTON_CONFIG_DIR note at Line 154), e.g. replace absolute-path phrasing with
"by default" or "defaults to" and add a short parenthetical pointing to
PHOTON_CONFIG_DIR as the override.

---

Duplicate comments:
In `@README.md`:
- Around line 59-60: The README incorrectly documents non-global flags (--env,
--token) as if they are global and shows them before subcommands; update
examples and sections so that --env and --token are documented in the
per-command examples where they apply (e.g., under the "projects" command
examples and any other affected command blocks around the examples at lines
showing 'photon --env staging projects ls' and 'PHOTON_ENV=staging photon
projects ls'), and change the "Global flags" section title/content (referenced
as 'Global flags') to only list truly global options; move any per-command flags
out of that global section and into the specific command documentation or
examples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dda80707-0ddb-4d86-9414-47b194d5eb38

📥 Commits

Reviewing files that changed from the base of the PR and between 1826460 and 9c451da.

📒 Files selected for processing (3)
  • .github/workflows/release.yaml
  • README.md
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/release.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
📜 Review details
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: qwerzl
Repo: photon-hq/buildspace PR: 62
File: .github/workflows/update-docs.yaml:164-167
Timestamp: 2026-04-05T00:07:13.859Z
Learning: In photon-hq/buildspace, all reusable workflow blocks are intentionally referenced using `main` (e.g., `photon-hq/buildspace/.github/blocks/check-pr-labelmain`, `photon-hq/buildspace/.github/blocks/update-docsmain`). This is by design: the blocks and workflows ship together in the same repo and stay in sync. Do not flag these as version-pinning issues; pinning to a release tag would add unnecessary maintenance burden on every buildspace release.
📚 Learning: 2026-04-05T00:07:13.859Z
Learnt from: qwerzl
Repo: photon-hq/buildspace PR: 62
File: .github/workflows/update-docs.yaml:164-167
Timestamp: 2026-04-05T00:07:13.859Z
Learning: In photon-hq/buildspace, all reusable workflow blocks are intentionally referenced using `main` (e.g., `photon-hq/buildspace/.github/blocks/check-pr-labelmain`, `photon-hq/buildspace/.github/blocks/update-docsmain`). This is by design: the blocks and workflows ship together in the same repo and stay in sync. Do not flag these as version-pinning issues; pinning to a release tag would add unnecessary maintenance burden on every buildspace release.

Applied to files:

  • README.md
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install`

Applied to files:

  • README.md
📚 Learning: 2026-03-10T22:49:19.048Z
Learnt from: CR
Repo: photon-hq/advanced-imessage-kit PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-10T22:49:19.048Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json scripts

Applied to files:

  • README.md
📚 Learning: 2026-04-28T03:08:36.661Z
Learnt from: CR
Repo: photon-hq/cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-28T03:08:36.661Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json

Applied to files:

  • README.md
📚 Learning: 2026-04-21T18:03:17.985Z
Learnt from: lcandy2
Repo: photon-hq/dashboard PR: 40
File: apps/web/next.config.ts:6-8
Timestamp: 2026-04-21T18:03:17.985Z
Learning: In the photon-hq/dashboard repo (`apps/web/next.config.ts`), `typescript.ignoreBuildErrors: true` is intentional. Eden's `import type { App }` (cross-workspace type import from `photon-dashboard/api`) triggers unresolvable type resolution issues during `next build` in the Turborepo monorepo. Runtime behavior is correct and types resolve at dev time via the separate `typecheck` turbo task. Do not flag this as an issue.

Applied to files:

  • README.md
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>`

Applied to files:

  • README.md
🪛 LanguageTool
README.md

[uncategorized] ~189-~189: The official name of this software platform is spelled with a capital “H”.
Context: ...n merge to main, the Release workflow (a thin caller ...

(GITHUB)


[uncategorized] ~189-~189: The official name of this software platform is spelled with a capital “H”.
Context: ...pm. Standalone binaries are uploaded by release-binaries.yaml on eac...

(GITHUB)

🔍 Remote MCP Linear

Additional context relevant to reviewing this PR

  • ENG-1262: precedent for renaming packages to the @photon-ai scope, adding publishConfig.access: "public", updating README/install/imports, and verifying npm publish dry-run + CI release workflow use the scoped name. Confirms the package rename + publishConfig change in this PR matches an established repo pattern.

  • ENG-837: prior work that implemented a "build block for publishing binary" (completed). Attached link to buildspace PR for homebrew support — indicates org experience with binary build + distribution, and that GitHub Release attachment (current PR) is consistent with earlier binary-release groundwork.

Comment thread README.md Outdated
Rename:
- Package name @photon-ai/cli -> @photon-ai/photon so the post-scope
  segment matches the `photon` binary. Lets `npx @photon-ai/photon`
  and `bunx @photon-ai/photon` resolve directly without --package.
  Unscoped `photon` and `photon-cli` are both taken on npm.
- README quickstart updated; new bunx/npx one-off section added.

Review fixes (Copilot + CodeRabbit on PR #11):
- release-binaries.yaml: macos-13 -> macos-15-intel (deprecated runner
  label) and pin bun-version to 1.3.13 for reproducibility.
- release.yaml: use bracket notation inputs['dry-run'] to avoid hyphen
  parsing ambiguity.
- package.json: move typescript from peerDependencies to
  devDependencies now that the package is publishable.
- README: use \$PHOTON_CONFIG_DIR/... in path examples instead of
  hardcoded ~/.config/photon/...; fix flag positioning (only --debug
  is program-level, all others must follow the subcommand).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
@lcandy2 citron (lcandy2) added the release Just as it is label Apr 29, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

41-47: Prefer Bun-only one-off examples in docs.

Given the Bun-first posture, keep this section on bunx and drop the npx line to avoid mixed guidance.

✏️ Suggested patch
 bunx `@photon-ai/photon` login
 bunx `@photon-ai/photon` projects ls
-npx  `@photon-ai/photon` whoami     # also works

Based on learnings: Use bunx <package> <command> instead of npx <package> <command>.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 41 - 47, The README examples show both bunx and npx;
remove the npx example to keep Bun-first guidance: edit the code block with the
one-off command examples (the lines containing "bunx `@photon-ai/photon` login",
"bunx `@photon-ai/photon` projects ls", and "npx  `@photon-ai/photon` whoami") and
delete the "npx  `@photon-ai/photon` whoami" line so only bunx examples remain,
preserving formatting and surrounding fenced code block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 14-23: The package.json is missing explicit SPDX license metadata;
add a top-level "license": "MIT" field to package.json (alongside existing keys
like "author", "homepage", "repository", "bugs", and "type") so npm and tooling
can detect the repository's license (the project already contains a LICENSE file
to justify using "MIT").

---

Nitpick comments:
In `@README.md`:
- Around line 41-47: The README examples show both bunx and npx; remove the npx
example to keep Bun-first guidance: edit the code block with the one-off command
examples (the lines containing "bunx `@photon-ai/photon` login", "bunx
`@photon-ai/photon` projects ls", and "npx  `@photon-ai/photon` whoami") and delete
the "npx  `@photon-ai/photon` whoami" line so only bunx examples remain,
preserving formatting and surrounding fenced code block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22e1370a-5d00-4ad3-87d7-58efca26fd4d

📥 Commits

Reviewing files that changed from the base of the PR and between 9c451da and 5752678.

📒 Files selected for processing (4)
  • .github/workflows/release-binaries.yaml
  • .github/workflows/release.yaml
  • README.md
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/release.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release-binaries.yaml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
package.json

📄 CodeRabbit inference engine (CLAUDE.md)

package.json: Use bun install instead of npm install, yarn install, or pnpm install in package.json
Use bun run <script> instead of npm run <script>, yarn run <script>, or pnpm run <script>

Files:

  • package.json
🧠 Learnings (12)
📓 Common learnings
Learnt from: qwerzl
Repo: photon-hq/buildspace PR: 62
File: .github/workflows/update-docs.yaml:164-167
Timestamp: 2026-04-05T00:07:13.859Z
Learning: In photon-hq/buildspace, all reusable workflow blocks are intentionally referenced using `main` (e.g., `photon-hq/buildspace/.github/blocks/check-pr-labelmain`, `photon-hq/buildspace/.github/blocks/update-docsmain`). This is by design: the blocks and workflows ship together in the same repo and stay in sync. Do not flag these as version-pinning issues; pinning to a release tag would add unnecessary maintenance burden on every buildspace release.
📚 Learning: 2026-04-21T18:03:17.985Z
Learnt from: lcandy2
Repo: photon-hq/dashboard PR: 40
File: apps/web/next.config.ts:6-8
Timestamp: 2026-04-21T18:03:17.985Z
Learning: In the photon-hq/dashboard repo (`apps/web/next.config.ts`), `typescript.ignoreBuildErrors: true` is intentional. Eden's `import type { App }` (cross-workspace type import from `photon-dashboard/api`) triggers unresolvable type resolution issues during `next build` in the Turborepo monorepo. Runtime behavior is correct and types resolve at dev time via the separate `typecheck` turbo task. Do not flag this as an issue.

Applied to files:

  • package.json
  • README.md
📚 Learning: 2026-04-01T08:18:18.974Z
Learnt from: CR
Repo: photon-hq/advanced-imessage-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T08:18:18.974Z
Learning: Applies to **/*.{tsx,jsx} : Specify all dependencies in hook dependency arrays correctly

Applied to files:

  • package.json
📚 Learning: 2026-04-01T08:18:18.974Z
Learnt from: CR
Repo: photon-hq/advanced-imessage-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T08:18:18.974Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Leverage TypeScript's type narrowing instead of type assertions

Applied to files:

  • package.json
📚 Learning: 2026-04-17T02:57:19.075Z
Learnt from: CR
Repo: photon-hq/billing PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-17T02:57:19.075Z
Learning: Applies to **/*.{tsx,jsx} : Specify all dependencies in hook dependency arrays correctly in React

Applied to files:

  • package.json
📚 Learning: 2026-04-15T02:30:10.124Z
Learnt from: CR
Repo: photon-hq/whatsapp-business-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-15T02:30:10.124Z
Learning: Applies to **/*.{jsx,tsx} : Specify all dependencies in hook dependency arrays correctly

Applied to files:

  • package.json
📚 Learning: 2026-04-05T00:07:13.859Z
Learnt from: qwerzl
Repo: photon-hq/buildspace PR: 62
File: .github/workflows/update-docs.yaml:164-167
Timestamp: 2026-04-05T00:07:13.859Z
Learning: In photon-hq/buildspace, all reusable workflow blocks are intentionally referenced using `main` (e.g., `photon-hq/buildspace/.github/blocks/check-pr-labelmain`, `photon-hq/buildspace/.github/blocks/update-docsmain`). This is by design: the blocks and workflows ship together in the same repo and stay in sync. Do not flag these as version-pinning issues; pinning to a release tag would add unnecessary maintenance burden on every buildspace release.

Applied to files:

  • README.md
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install`

Applied to files:

  • README.md
📚 Learning: 2026-03-10T22:49:19.048Z
Learnt from: CR
Repo: photon-hq/advanced-imessage-kit PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-10T22:49:19.048Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json scripts

Applied to files:

  • README.md
📚 Learning: 2026-04-28T03:08:36.661Z
Learnt from: CR
Repo: photon-hq/cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-28T03:08:36.661Z
Learning: Applies to package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json

Applied to files:

  • README.md
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>`

Applied to files:

  • README.md
📚 Learning: 2026-04-04T19:01:14.591Z
Learnt from: CR
Repo: photon-hq/explore-send-imessage-app PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-04-04T19:01:14.591Z
Learning: Use `bunx <package> <command>` instead of `npx <package> <command>`

Applied to files:

  • README.md
🪛 LanguageTool
README.md

[uncategorized] ~214-~214: The official name of this software platform is spelled with a capital “H”.
Context: ...n merge to main, the Release workflow (a thin caller ...

(GITHUB)


[uncategorized] ~214-~214: The official name of this software platform is spelled with a capital “H”.
Context: ...pm. Standalone binaries are uploaded by release-binaries.yaml on eac...

(GITHUB)

🔇 Additional comments (2)
package.json (1)

25-46: Publish/build wiring is clean and release-ready.

bin points to built output, build marks the artifact executable, and prepublishOnly gates publish on typecheck + build. Nice setup for npm + release automation.

README.md (1)

151-168: Flag semantics are clearly documented now.

Great clarification that only --debug is program-level and others are per-command, with concrete valid/invalid examples.

Comment thread package.json
@lcandy2 citron (lcandy2) merged commit 31ce989 into main Apr 29, 2026
1 check passed
citron (lcandy2) added a commit that referenced this pull request May 5, 2026
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Just as it is

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants