Bia — a coding agent for your terminal

Read the code. Make the change. Run the tests. Bia works in your project, streams its replies, and keeps the conversation so you can pick it up later.

Bring your own model. Use it on any codebase. Open source and MIT licensed.

Install Bia · Read the source

From a failing test to a fix

Ask in plain language. Follow the files it reads, the diff it makes and the commands it runs.

› fix the failing test

• Explored
  └ Read CalcTest.php, Calc.php
• Edited src/Calc.php (+1 −1)
  └   12 - return $a - $b;
      12 + return $a + $b;
• Ran composer test
  └ OK (12 tests, 30 assertions)

Fixed: add() subtracted.

Example conversation from Bia's guide , not a live session.

Your project. Your tools. Your model.

Coding tools
Read and search files, make exact edits, apply patches, run commands and inspect the git diff. Read-only calls can run concurrently.
Your models
Use OpenAI-compatible APIs, including OpenAI, OpenRouter, Ollama and LM Studio. Switch models in the same conversation; configure fallbacks when a provider is unavailable.
Pick up later
Conversations are saved locally in SQLite. Resume one, fork it to try another direction, or export it as JSONL.
Long tasks
No fixed limit on model/tool steps in a turn. Older context is summarized when needed. Bia works until the model finishes, you stop it, or an error ends the turn.
Project context
Reads your AGENTS.md instructions. Keeps memories between sessions as plain files you can inspect, edit or delete.
Stay in control
Send another message while it works to steer the next step. Press Esc to stop the turn, its model request and running commands.
Make it yours
Add skills, connect MCP servers, or ask Bia to write a plugin with a new slash command or tool.

Explore the features

Install Bia

The prebuilt binary includes PHP. No PHP or Composer installation needed. Linux and macOS, Intel or ARM; on Windows, use WSL.

curl -fsSL https://raw.githubusercontent.com/crabphp/bia/main/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
bia doctor

The installer checks the download against the release's SHA256SUMS and installs to ~/.local/bin. Add the PATH line to your shell's startup file if needed. Install git and ripgrep for patches, diffs and search; bia doctor checks what is available.

Inspect the installer · Build from source

Connect a model

Create your global config:

bia init --global

In ~/.bia/config.php, set your provider's key and choose a model. For example, these entries inside the returned array use OpenAI and read the key from your environment:

'providers' => [
    'openai' => ['api_key' => env('OPENAI_API_KEY')],
],
'model' => ['name' => 'openai/gpt-5'],

Set OPENAI_API_KEY in your shell environment, then start in your project:

cd ~/code/my-project
bia "explain the structure of this repository"

Run bia without a prompt for an interactive conversation, bia resume to continue one, and bia update to update an installed binary.

Other providers and configuration

Know what it can do

Bia is not a sandbox. Tools run with full permission by default, and shell commands have your access to the machine. Review the changes it makes. Set read, write or shell permissions to ask or deny when you need tighter control.

Bia is an early-stage project. It supports OpenAI-compatible Chat Completions and Responses APIs, not native Anthropic Messages or Gemini APIs. Commands run without an interactive terminal.

Permissions · Status and limits

Built with CrabPHP

Bia is written in PHP 8.4 on Crab's engine. The event loop coordinates the work, the HTTP client streams model replies, and cancellable subprocesses run the commands. It starts no web application to have a conversation.

A terminal agent, built from the same foundation as Crab's JSON APIs and services.

Meet Crab · Framework documentation