phi CLI
A terminal coding agent in Go: one binary with no Node or Python, diff review right in the interface and sub-agents
- 744 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The agent reads and edits project files and runs shell commands, and the `--yolo` flag and `autopilot` mode remove approval prompts
- The install script runs through curl and bash, and provider keys sit in the `~/.phi/config.yaml` file
- Skills from a project's `.agents/skills` directory are picked up without confirmation and can carry someone else's instructions
Install
Manual install
curl -fsSL https://raw.githubusercontent.com/pulseaiclub/phi/main/scripts/install.sh | bashInstalls the latest release on macOS and Linux. Read the script before running it. For Windows there is scripts/install.ps1 for PowerShell 5.1 and newer.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The agent reads and edits project files and runs shell commands, and the `--yolo` flag and `autopilot` mode remove approval prompts
- The install script runs through curl and bash, and provider keys sit in the `~/.phi/config.yaml` file
- Skills from a project's `.agents/skills` directory are picked up without confirmation and can carry someone else's instructions
This is third-party code. Review the repository files before installing.
What it does
phi launches a chat interface with a coding agent in the terminal. The model edits code through `read`, `write` and `edit`, searches through `grep`, `find` and `ls`, and runs commands through `bash`. The agent ships as a single binary with no Node, Electron or Python. The interface has its own built-in tools. The `/diff` command opens a full-screen Git change review: you can leave notes on lines and hand them to the agent. `/code` shows source with highlighting and sends a selection to the chat, and `/branch` switches branches. The @ sign opens a file picker, and a command with an exclamation mark runs a shell command locally. MCP servers are added with `phi mcp add`, and their tool schemas stay out of the context until you call a server. With three sub-agent roles, `explore`, `review` and `worker`, the agent splits work into isolated tasks.
Who it is for. For developers who prefer the terminal and want a lightweight coding agent with their own OpenAI, Anthropic or Gemini keys.
Good fit when
- You want to review changes line by line in the terminal itself and send your line notes to the agent
- You need to run the agent in a script or CI with a single `phi run -p` command and get JSONL events
- You connect many MCP servers and their tool schemas must not take up context before the first call
- You want to run parallel research and edits with sub-agents that use different models for different roles
Not a fit when
- You need a graphical shell or desktop app: phi works in the terminal only
- You have no access to any provider's API: without a key the agent does not start
- You need strict agent isolation: phi has a permission system, and the project describes no sandbox
Example request
Find why the test in `internal/tools` fails, fix the code and show me the changes through `/diff` before anything is committed.Limitations
No model is included: you put the key and provider address into `~/.phi/config.yaml` with the `phi config` command or set the `PHI_API_KEY` and `PHI_MODEL` variables. The fd and ripgrep tools download in the background on first start. The sponsors block of the project page advertises a third-party API gateway, infistar.cc, through affiliate links and offers a ready `config.yaml` snippet where every model points at that gateway. If you paste the snippet as is, requests with your code go through an intermediary. To work directly, enter your own provider's address. The optional optimizer, when switched on with `PHI_OPTIMIZER`, sends command history and context to the external TypeSafe service and requires a `TYPESAFE_API_KEY`.
How to disable. Delete the phi binary from the directory where the script put it and, if you want, the `~/.phi` directory with the configuration, sessions and the downloaded `fd` and `ripgrep`. Revoke the provider keys from `config.yaml` in the provider's dashboard if the file ever reached other hands or a repository.
FAQ
How do I install phi and connect a model?
On macOS and Linux run `curl -fsSL https://raw.githubusercontent.com/pulseaiclub/phi/main/scripts/install.sh | bash`, and on Windows use the `install.ps1` script in PowerShell. After installing, run `phi config` and enter the model, key and, if needed, a base URL. For a one-off run the `PHI_MODEL` and `PHI_API_KEY` variables are enough.
Which providers and models does phi support?
The `api` field takes `OpenAI`, `OpenAIResponses`, `Anthropic` or `Gemini`, and when it is empty an OpenAI-compatible format is used. Some models, such as `deepseek-flash`, have built-in presets with the address and context size.
Can I forbid the agent from writing files and running commands?
Yes. Set `permissions.mode` to `readonly`: writes and `bash` are denied and reading still works. The `interactive`, `autopilot` and `headless-strict` modes are also available, and `deny` rules outrank `ask` and `allow`. Writes are limited to the working directory by default.
Which skills does phi read?
It loads `SKILL.md` files from `~/.phi/skills` as well as from `~/.agents/skills` and `.agents/skills` in a project, so a skill set installed for another agent works without setup. Project directories are picked up without confirmation, so review them the way you review `AGENTS.md`.
How do I connect an MCP server in phi?
Run, for example, `phi mcp add browsermcp -- npx @browsermcp/mcp@latest`, and check the setup with `phi mcp doctor`. The configuration lives in `~/.phi/mcp.json`, and a `.phi/mcp.json` file in a project overrides servers with the same name. You can turn MCP off entirely with `PHI_MCP=off`.
Discussion
No questions or reviews yet.
Related
CLI toolsA tmux-based TUI that runs Claude Code, Codex and other agents in one list: status, quick prompts, worktrees and diff review
A teaching terminal coding agent in Python, built as a "nanoGPT for agents": read it, take it apart and fork it
A minimal terminal coding agent extended with skills, prompt templates and TypeScript packages
A Go CLI that configures the AI coding agents you already use: it gives them shared memory, a workflow and deterministic steps without replacing the agents them
An open coding agent for the terminal, browser and desktop that works with models from OpenAI and Claude to Ollama
A Go coding agent for open models: it turns a chat into tasks on separate branches, checks and merges the result and runs all projects in one window
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Repository stars | Main difference |
|---|---|---|---|
| phi (this entry) | no | 744 | |
| zerostack: lightweight coding agent in Rust | no | 1,727 | a Rust terminal coding agent with a sandbox and five permission modes, while phi is written in Go |
| Late | no | 452 | a Go coding agent in one binary where an orchestrator plans and disposable sub-agents write and search |
README in short
The project page opens with a sponsors block and a quick start, then gives benchmarks: a binary of about 15 MB and a startup of about 31 ms. A reference follows on configuration, modes, commands and permissions, plus skills, extensions and MCP.