← 开源

Use Photon in your terminal

TypeScript
增长势头
+024 小时新增 Star0.0%
35
Star
4
Fork
10
贡献者
创建于 2026-04-25 · 更新于 2026-11-21 · 今日第 26819 名
主要开发者
lcandy2vincent-ycwinvisicat
README

Photon CLI

Photon CLI is the command-line client for Photon. It signs you in, manages your organizations and projects, and calls the Photon API from a terminal, a script or an agent.

Install

Install the npm package with your package manager. It runs on Node.js 22 or newer.

npm install --global @photon-ai/cli
pnpm add --global @photon-ai/cli
bun add --global @photon-ai/cli

With Yarn, add it to a project, and run every photon command in this README as yarn photon from that project's folder:

yarn add --dev @photon-ai/cli
yarn photon --version

Or install the standalone binary, which doesn't need Node.js. The installer downloads the latest release, checks its SHA-256 checksum and installs photon in ~/.local/bin by default.

On macOS and Linux:

curl -fsSL https://github.com/photon-hq/cli/releases/latest/download/install.sh | sh

On Windows, in PowerShell:

irm https://github.com/photon-hq/cli/releases/latest/download/install.ps1 | iex

To install the binary by hand, download the archive for your platform from the latest release, check it against the release's checksums.txt, and put photon on your PATH.

Open a new terminal so it picks up the new PATH, then check that it runs:

photon --version

A 2.x version is Photon CLI 1.0. By default, pnpm and Yarn install a release only once it has been on npm for a day, and an older photon on your PATH can run first. The installation guide's troubleshooting covers both.

Get started

photon login                         # sign in, approving the device code in a browser
photon project list                  # list the projects in your organization
photon link --project <project-id>   # use that project for commands in this folder

Where no one can approve a sign-in, as in CI, put a Photon key in PHOTON_API_TOKEN instead of running photon login. Add --json to any command for output a program can read, and --help to see its options.

Documentation

Photon CLI 1.0

Photon CLI 1.0 is the previous CLI, published as @photon-ai/cli versions 2.x. Its source lives on the legacy branch. To install it:

npm i -g @photon-ai/cli@legacy

Issues and security

Report bugs and request features in issues. Report security problems privately, as SECURITY.md describes.

Contributing

This repository holds the CLI's source as published with each release. Changes are made in Photon's private repository and reach this one with the next release, so pull requests aren't accepted here; see CONTRIBUTING.md.

License

Apache-2.0. The npm package and the binaries ship the licenses of the packages they bundle in THIRD_PARTY_NOTICES.txt.

排名相邻

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载