phoenix-cli-development

Guides design and implementation of noun-verb commands for the Phoenix CLI.

11.3k|1.1k|Updated Nov 9, 2022
One-click install
npx skills add https://github.com/Arize-ai/phoenix --skill phoenix-cli-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-cli-development
Source: https://github.com/Arize-ai/phoenix/tree/main/js/packages/phoenix-cli/.agents/skills/phoenix-cli-development
Command: npx skills add https://github.com/Arize-ai/phoenix --skill phoenix-cli-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Contributors to the Phoenix CLI (px) need consistent conventions for adding or modifying commands so the tool works equally well for humans in a terminal and coding agents executing commands programmatically.

Core Features & Use Cases

  • Command Structure Standards: Enforces the noun-verb pattern (px project list), standard verbs, singular resource names, and backward-compatible migration from flat commands.
  • Dual-Audience Output Rules: Defines --format modes (pretty, json, raw), semantic exit codes, structured errors, non-interactive --no-input behavior, and idempotent mutating commands that return resources on stdout.
  • Implementation Conventions: Covers Commander.js patterns, options interfaces, configuration resolution priority, I/O helpers, vitest testing with MSW mock servers, and a checklist for adding new resource commands.
  • Use Case: When adding a new px dataset get command, follow the checklist to create the command module, formatter, options interface, tests, help examples, and README updates.

Quick Start

Ask the AI to add a new noun-verb command to the Phoenix CLI following the phoenix-cli-development conventions, including formatter, tests, and help examples.

Frequently Asked Questions about phoenix-cli-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new command to the Phoenix CLI?

Create a command module in src/commands with a create<Resource>Command() factory, add verb subcommands like list and get, create a matching formatter module, register it in src/cli.ts, and add vitest tests. The skill provides an 18-step checklist covering help examples, README updates, and agent-friendly output verification.

What command structure does the Phoenix CLI use?

The Phoenix CLI uses a noun-verb pattern modeled after the GitHub CLI: px <resource> <action> [arguments] [options]. Resource names are singular, and standard verbs include list, get, create, update, and delete.

How does the Phoenix CLI support coding agents and automation?

Every data command supports --format with pretty, json, and raw modes, plus --no-input to suppress prompts and --no-progress to silence stderr progress. Mutating commands return the affected resource as structured JSON so agents can extract IDs and fields.

How are Phoenix CLI commands tested?

Tests use vitest with MSW handlers generated from the Phoenix OpenAPI definition via @arizeai/phoenix-testing, so tests never stub global fetch. Tests must cover handler logic over HTTP, formatter output per format mode, error edge cases, and exit code correctness.

What exit codes does the Phoenix CLI use for errors?

The CLI defines semantic exit codes in src/exitCodes.ts: 0 SUCCESS, 1 FAILURE, 2 CANCELLED, 3 INVALID_ARGUMENT, 4 AUTH_REQUIRED, 5 NETWORK_ERROR, and 6 NOT_VERIFIED. Commands must use the named constants rather than bare numeric literals.