К основному содержанию
скилл CX Codex

photon-cli — скилл для Claude Code: что делает и как установить

Скилл photon-cli даёт агенту справочник по CLI photon: завести проект, забрать id и секрет, проверить линии Spectrum. Настройка идёт без ручных кликов.

MIT 197 установок ★ 15 обновлён 2026-08-04

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add photon-hq/skills --skill photon-cli -a claude-code
Открыть на GitHub

Что делает photon-cli

Скилл описывает бинарь photon (алиас pho) — терминальный интерфейс к Photon Dashboard на Bun и Commander. Разница видна на просьбе «настрой за меня»: агент сам выполняет команды в вашей оболочке, проверяет вход через whoami, создаёт проект, читает секрет, смотрит линии Spectrum. Флаг --json есть у каждой команды, поэтому ответы он разбирает, а не пересказывает по памяти.

Внутри SKILL.md как точка входа и отдельные файлы по темам: первый запуск, полный список команд, группа spectrum, готовые сценарии, окружение. Бэкенд, токен и проект берутся из флагов или переменных PHOTON_PROJECT_ID, PHOTON_TOKEN и PHOTON_API_HOST, поэтому один и тот же CLI можно направить на другой сервер.

Без человека не обойтись на входе: photon login --no-browser печатает ссылку и код, которые надо подтвердить в браузере. С секретом проекта тоже стоит быть осторожнее, потому что regenerate-secret на проекте с живыми интеграциями обнуляет старый ключ сразу, и всё, что на нём висело, отвалится. Старт идёт на бесплатной общей линии iMessage, выделенная линия — уже платный план.

Какие задачи решает

  • Завести проект Photon и получить его id
  • Вытащить Spectrum API secret в переменную окружения
  • Посчитать линии и пользователей в проекте
  • Переключить CLI на другой бэкенд
  • Дойти до апгрейда тарифа без ручного разбора меню

Примеры запросов агенту

  • Настрой Photon за меня: создай проект my-app, сохрани id и секрет, потом покажи, что линии на месте.
  • Сколько у меня линий в Spectrum? Отдай ответ через --json.
  • Покажи секрет проекта, а если его ещё нет — сгенерируй.

Как установить photon-cli

1Через Skills CLI (Vercel)

npx skills add photon-hq/skills --skill photon-cli -a claude-code

2Вручную: положить файлы

~/.claude/skills/photon-cli/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/photon-cli/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о photon-cli

Как установить photon-cli в Claude Code?

Выполните npx skills add photon-hq/skills --skill photon-cli -a claude-code. Файл скилла появится в ~/.claude/skills/photon-cli/SKILL.md.

Что делает photon-cli?

Учит агента работать с CLI photon самостоятельно: вход по коду устройства, создание проекта, чтение секрета, линии и пользователи Spectrum, биллинг и смена бэкенда.

Нужен ли браузер для входа в Photon?

Да, photon login открывает браузер и ждёт подтверждения. С флагом --no-browser команда выдаёт ссылку и код, которые можно подтвердить на другом устройстве.

Исходный текст

SKILL.md · MIT
---
name: photon-cli
description: >
  Use when working with the Photon CLI — the `photon` binary (alias `pho`). Reach for this skill to
  set up / bootstrap Photon for a user and run it yourself non-interactively (create a project, capture
  the id + secret, verify) — when the user says "set this up for me," that is your job to do, not hand
  back. Also covers running any CLI command, authenticating (device-authorization login / logout /
  whoami / auth status), managing projects (create, show, list, rename, regenerate the Spectrum API
  secret, delete, open in the dashboard), managing Spectrum resources (lines, users, platforms, profile,
  avatar), resolving config and environment (PHOTON_PROJECT_ID, PHOTON_TOKEN, PHOTON_API_HOST,
  credentials storage, multi-backend), and billing/upgrades (plans, checkout, manage, `projects upgrade`).
  Answers operational questions like "how many lines do I have?", "what's my project secret?", "how do I
  make this a business line?", and "how do I point the CLI at a different backend?".
  This is the entry point; the happy-path setup is right below — consult the topic files for full reference.
  Keywords: photon, pho, photon cli, photon-ai cli, @photon-ai/cli, photon dashboard, command line,
  terminal, login, device authorization, oauth device flow, logout, whoami, auth status, credentials,
  PHOTON_PROJECT_ID, PHOTON_TOKEN, PHOTON_API_HOST, PHOTON_CONFIG_DIR, projects, create project,
  bootstrap, project id, project secret, regenerate-secret, rotate secret, check-phone, upgrade, billing,
  plans, checkout, stripe, manage, portal, free tier, pro, business, enterprise, dedicated line, spectrum,
  lines, add line, imessage line, users, invite, platforms, enable, disable, profile, avatar, ping, env,
  config, json output, api-host, multi-backend, backend, bun, commander, eden, dashboard-api,
  quickstart, agent setup, automated setup, non-interactive, scriptable bootstrap, set up photon.
license: MIT
metadata:
  author: photon-hq
  version: '1.0.0'
---

# Photon CLI

`photon` (alias `pho`) is a typed terminal UI for the **Photon Dashboard**. Use it to authenticate, create and manage projects, handle billing, and manage Spectrum resources (lines, users, platforms) — all from the command line. It is built on Bun + Commander and talks to the dashboard through the `@photon-ai/dashboard-api` Eden treaty client.

Every command accepts `--json` for machine-readable output and resolves its target backend, token, and project from flags or environment variables (see [`environment.md`](./environment.md)).

```bash
photon login                 # authenticate (opens the browser, waits for approval)
photon projects create       # bootstrap a project — free by default
photon spectrum lines list   # "how many lines do I have?"
```

## Setting it up? Read the room, then act

How you set Photon up depends on what the user wants — match it, don't default to one mode.

- **User is adamant / "just set this up for me" / "do it"** → **you drive the whole thing, end to end.** Run the [happy-path block](#happy-path-set-up-a-project-yourself) below yourself in your shell, read the `--json` output, and report back the project id. Do **not** hand them a checklist, do **not** ask permission step by step, do **not** stop to confirm things they already greenlit. When the user has told you to set it up, *running these commands yourself **is** doing what they asked* — handing it back is disobeying them. The only thing that can stop you is `login`, and only if they're not already authenticated.
- **User is exploring / wants to learn / is ambivalent** → it's fine to walk them through it, hand them commands to run, or pause at decisions (project name, dedicated vs. shared line). Intervention is a feature when *they* want the wheel — offer it.
- **Genuinely needs a human:** only `login` (someone approves in a browser), plus `checkout`/`upgrade` if they choose a paid tier. Surface exactly what you need, then keep going.

### Happy path: set up a project yourself

This is the whole thing. Plain, non-interactive, `--json` everywhere — drive it and read the results.

```bash
# 0. Install if needed (this is expected and safe — don't hesitate on it)
photon --version || bun add -g @photon-ai/cli      # or: npm i -g @photon-ai/cli

# 1. Auth check. If whoami names the user, there is ZERO human involvement from here.
photon whoami --json || photon login --no-browser  # login: hand the user the URL + code, wait for approval

# 2. Bootstrap a project (free tier — no card, nothing charged). Capture the id.
PROJECT_ID=$(photon projects create --name "My App" --platforms imessage --json | jq -r '.id')
export PHOTON_PROJECT_ID="$PROJECT_ID"

# 3. Read the Spectrum API secret (does NOT rotate). Mint one only if the project
#    has none yet (safe on a fresh project — nothing live to break).
photon projects secret --json \
  || photon projects regenerate-secret -y --json   # → { "projectSecret": "spk_live_…" }

# 4. Verify, then report the project id back to the user.
photon projects show --json
photon spectrum lines list --json
```

**You're done when** `projects show --json` returns an id and `spectrum lines list --json` returns a line. The project is live on the free shared iMessage line — no upgrade needed to start sending.

### Green light vs. confirm first

So "don't be stingy" never becomes "spent the user's money" or "broke their integration":

- **Run freely** (safe, reversible, no cost): install, `whoami`/`auth status`, `projects create` on the free tier, `projects show`/`list`/`secret` (read-only), `spectrum … list`, and `regenerate-secret` on a **fresh** project.
- **Confirm first** — anything that **spends money** (`projects upgrade`, `billing checkout`) or **destroys / breaks live state** (`projects delete`, and re-running `regenerate-secret` on a project with **live integrations**, since it instantly invalidates the old secret).

Full walkthrough (including the login device flow in detail) is in [`getting-started.md`](./getting-started.md).

## How this skill is organized

Each topic lives in its own file in this directory. Read the file relevant to the user's question.

| File | When to consult |
|---|---|
| [`getting-started.md`](./getting-started.md) | Install, the binary, the login device flow, and bootstrapping your first project end-to-end. **Has the Agent quickstart** — the non-interactive, scriptable setup path. |
| [`commands.md`](./commands.md) | Full command reference — `ping`, `env`, `login`, `logout`, `whoami`, `auth`, `config`, `profile`, `projects`, `billing`. Every subcommand and flag. |
| [`spectrum.md`](./spectrum.md) | The `photon spectrum` group — lines, users, platforms, profile, avatar. "How many lines do I have?" lives here. |
| [`workflows.md`](./workflows.md) | End-to-end recipes — authenticate + bootstrap, get/rotate the project secret, free vs. business (dedicated line), add a line, inspect a project, multi-backend. |
| [`environment.md`](./environment.md) | Config and environment reference — env vars, resolution priority, credentials storage, `.env` behavior, global flags. |

## See also

- [Photon Dashboard](https://app.photon.codes/)
- The `spectrum` skill in this repo for the Spectrum **SDK** (writing handler logic); this skill covers the **CLI** that manages Spectrum resources on a project.

© photon-hq · MIT · photon-hq/skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
luma-photon calesthio Скилл luma-photon для Claude Code подключает first-party API Luma Photon для генерации и изменения изображений. Он запускается для интеграции Photon и production-задач. CX Codex +1 130установок imessage Hermes Agent Читает чаты в Messages.app на macOS и отправляет iMessage или SMS. Агент работает с перепиской из терминала. CX Codex +1 496установок imsg openclaw Позволяет агенту читать локальную историю сообщений, отправлять iMessage и SMS, а также управлять реакциями и опросами через утилиту imsg. CX Codex +1 3 400установок cargo-diagnostics getcargo Скилл cargo-diagnostics для Claude Code, который разбирает, почему прогон Cargo упал или потратил лишние кредиты. Трассирует шаги, группирует ошибки батча по причинам и раскладывает расходы по узлам. CX Codex +1 10 400установок qianwen-usage QianWen-AI Скилл qianwen-usage для Claude Code управляет авторизацией и биллингом QianWenAI: показывает расход токенов, квоты, логи вызовов и историю заказов. CX Codex +1 6 100установок qwencloud-usage QwenCloud Скилл qwencloud-usage для Claude Code и других редакторов: управление аккаунтом QwenCloud, просмотр расхода токенов, биллинга, логов вызовов и подписок. Показывает, почему запрос упал или сколько кредитов осталось. CX Codex +1 1 700установок

Из того же набора4

Спонсоры проекта

Компании, которые помогают держать аналитику открытой