---
name: phi-cli
description: "Drive Dyno Phi from the phi command line, the dyno-phi package on PyPI, to submit folding and design jobs, run pipelines, watch runs, download artifacts, export designs, read knowledge documents and check quota. Use when working in a terminal or on a machine without a browser, when a person asks how to install, authenticate or script the phi CLI, or when an agent must run Phi jobs with an API key."
allowed-tools: Bash(phi *)
license: MIT
compatibility: "Needs the dyno-phi package (pip install dyno-phi or uv tool install dyno-phi) and either an API key or a browser sign-in."
access: general
metadata:
  author: dynotx
  version: "1.3"
  updated: "2026-11-23"
  prompt: "true"
---

# phi CLI

The `phi` command drives the Phi protein design API. It is the `dyno-phi` package on PyPI, published from `clients/phi` in `dynotx/phi-api`.

## Install

```bash
uv tool install dyno-phi    # or: pip install dyno-phi
phi --version
```

`uv` supplies its own Python 3.12 or later. If `phi --version` reports `0.2.x`, that is the earlier, unrelated `dyno-phi` client; run `pip install --upgrade dyno-phi` in the Python that owns it.

## Authenticate

An agent authenticates with an API key. `phi auth login --key ak_...` saves it as the profile, or `PHI_API_KEY` carries it per process. `phi auth login` without `--key` opens a browser and waits for a person, which an agent cannot complete.

`phi` reads its connection settings from the environment, then from `~/.config/phi/config.toml`:

- `PHI_API`: the base URL of the API. Its host selects the environment (`hosted`, `staging`, `local`).
- `PHI_KEY` or `PHI_API_KEY`: the API key.
- `PHI_ORG`: the organization id, required with a static key.

`phi auth whoami` prints the resolved identity. `phi doctor` says what is wrong when a command cannot reach Phi. Every command accepts the global flags `--api`, `--key`, `--org`, `--profile` and `--json`.

## Script it

Pass `--json` before the command for machine-readable output instead of tables. The job and run ids from the last submit are remembered in `.phi/state.json`, so `status`, `wait` and `artifacts` default to the most recent id when none is given.

## Projects

`phi projects list` shows your projects. Add `--all` (`-a`) for every active project in the organization; both list an owner column.

## Knowledge documents

Read the relevant document before advising, and cite claims as `name#Heading`:

```bash
phi docs list --scope platform --prefix skills/
phi docs search "ipTM on-target contact"
phi docs read skills/phi-pilot/SKILL.md --scope platform
```

`phi docs propose <id-or-name> --file proposal.md --note "..."` creates a draft and leaves the active document unchanged. A document writer reviews it with `phi docs history <id>` and activates it with `phi docs activate <id> <revision>`.

## Skills

`phi skills list` names the skills Phi publishes. `phi skills install` puts them where Claude Code, Cursor and Codex read them; add `--global` for every project on the machine. `phi skills show <name>` prints one.

## Quickstart

```bash
phi quickstart
```

This creates the `quickstart` project, folds the Trp-cage miniprotein with `ESMFOLD`, waits, and downloads the results. Add `--dry-run` to print the plan without spending credits.

## Jobs

Submit one job. `--input` and `--param` are repeatable `key=value` pairs; a value starting with `@` is read from a file:

```bash
phi jobs submit ESMFOLD --input sequences=@seqs.fasta --wait --out results
```

`--wait` polls until the job reaches a terminal state, and `--out DIR` downloads the artifacts afterwards. An object or array-of-object input, such as OPENFOLD3's `complexes`, comes from a structured file: `--input complexes=@complexes.json` (or `.yaml`), or `--inputs-file inputs.yaml` for the whole `inputs` object:

```bash
phi jobs submit OPENFOLD3 --inputs-file complexes.yaml --wait --out results
```

The other job commands are `phi jobs list`, `phi jobs status <id>`, `phi jobs wait <id>`, `phi jobs cancel <id>` and `phi jobs embeddings <id>`. Discover job types and their schemas with `phi models list`, `phi models show <TYPE>` and `phi models schema <TYPE>`.

## Runs (named pipelines)

```bash
phi runs submit --pipeline SCORE_BACKBONES --project <id> --input source_run_id=<run> --wait
```

`phi runs estimate --pipeline <name> --num-designs N` prices a run. The others are `phi runs list`, `phi runs status <id>`, `phi runs timeline <id>`, `phi runs dag <id>`, `phi runs cancel <id>` and `phi runs resume <id>`.

## Pipelines (ad hoc graphs)

Run a graph from a file or from inline nodes:

```bash
phi pipeline run -f graph.yaml --project <id> --wait
phi pipeline run --node mpnn=proteinmpnn --node fold=esmfold:mpnn --project <id>
```

`--node id=tool[:dep,...]` declares a node and its dependencies. `phi pipeline validate -f graph.yaml` checks a graph and `phi pipeline estimate -f graph.yaml` prices it, both locally, without a request to the API.

## Artifacts and export

```bash
phi artifacts list <run_id>
phi artifacts download <run_id> --out results --all
phi artifacts download <run_a> <run_b> --out results --suffix .cif
phi artifacts download --ids-file runs.txt --out results --all
phi artifacts download --project <id> --batch <batch_id> --out results --all
phi export sequences --project <id> --out designs.csv
phi export structure <sequence_id> --out structure.cif
```

`phi artifacts download` needs `--all` or a `--stage` or `--suffix` filter.

Several run ids, `--ids-file` (one id per line) or `--project` (every completed run in it, narrowed with `--batch`) download in bulk, which needs `dyno-phi` 0.4.2 or later. Each run is written to `results/<run_id>/` and `results/summary.json` records the outcome of each. `--project` cannot be combined with run ids or `--ids-file`. A failed run does not stop the rest (`--keep-going`, the default) and the command exits 1 at the end; `--fail-fast` stops at the first. A run that is downloaded again skips the files already there; `--overwrite` fetches them again. `--expires-in` sets how long the signed URLs last, in seconds.

## Logs, quota and billing

```bash
phi logs show <run_id> --stage PROTEINMPNN
phi quota
phi billing
```
