FlowAI
FlowAI is an AI agent you run in your terminal, in the same spirit as Claude Code or OpenCode. Bring your own key from Anthropic, OpenAI, NVIDIA, Google Gemini or OpenRouter, or run fully local with Ollama. The agent can read, search and edit the files in your project, run shell commands (after asking you), and search the web.
It is also a Python library: the same agents, tools, workflows and memory the CLI uses are yours to build on.
Install
pip install flowai-cli # once it is published to PyPI
pipx install flowai-cli # same, in its own isolated environment
# from a checkout of this repository:
pip install .
Python 3.10 or newer. The package is flowai-cli (the name flowai is taken on PyPI);
the command it installs is flowai, and the import is import flowai.
First run
flowai
The first time, FlowAI asks for a provider and an API key and saves them to
~/.flowai/config.json. After that, flowai opens a session in the current
directory:
------------------------------------------------------------
FlowAI 0.2.0 anthropic / claude-sonnet-5-5
workspace: /home/you/my-project
session: ses_3f9a1c2e
/help for commands, /exit to quit
------------------------------------------------------------
> why does the test in tests/test_api.py fail?
[tool] grep_files(pattern=def test_, path=tests)
[done] tests/test_api.py:12: def test_create_user(): (+4 more lines)
[tool] read_file(path=tests/test_api.py)
...
Set up non-interactively instead (for scripts or CI):
flowai configure --provider anthropic --key "$ANTHROPIC_API_KEY"
Or skip configuration entirely: if ANTHROPIC_API_KEY, OPENAI_API_KEY,
NVIDIA_API_KEY, GEMINI_API_KEY or OPENROUTER_API_KEY is set, FlowAI uses
it.
Commands
| Command | What it does |
|---|---|
flowai |
Interactive session in the current directory |
flowai "add type hints to utils.py" |
Run one task and exit |
flowai chat --resume (or -c) |
Continue the most recent session |
flowai run -q "..." |
One task, print only the final answer (good for scripts) |
echo "..." | flowai run |
Read the prompt from stdin |
flowai configure |
Choose provider, model and API key |
flowai init [dir] |
Create a flowai.yaml and a starter main.py |
flowai inspect |
Show config status, saved sessions, checkpoints |
flowai tools |
List the built-in tools |
flowai serve |
HTTP API with streaming (pip install 'flowai-cli[server]') |
Options for chat and run: --provider, --model, -w/--workspace DIR,
--yolo (do not ask before shell/python tools run), --no-tools,
--max-iterations N.
Inside a session: /help, /model <name>, /provider <name> [model],
/tools, /cost, /new, /reset, /yolo, /exit.
What the agent can do
| Tool | Notes |
|---|---|
read_file, list_dir, glob_files, grep_files |
Read-only; never asks |
write_file, edit_file |
Changes files inside the workspace only |
bash |
Asks first. Runs in the workspace, 120 s timeout |
python_repl |
Asks first. Runs code in a fresh namespace |
search_web, fetch_url |
DuckDuckGo search and page fetch |
Safety. Every file path is resolved against the workspace (the directory
you started in, or -w) and refused if it points outside. Shell, Python and
MCP tools show you exactly what they will run and wait for y, n or a
(always, for that tool, this session). With no terminal attached, those tools
are refused rather than run. --yolo or approval: "auto" in flowai.yaml
turns the prompt off; use it only in a sandbox.
Configuration
Settings are layered, later wins:
~/.flowai/config.json, written byflowai configureflowai.yaml(or.yml,.toml,.json) in the current directory or any parent, so it works from a subdirectory of your project- Environment:
FLOWAI_PROVIDER,FLOWAI_MODEL, and the provider key variables
See flowai.yaml for every option, including mcp_servers for
borrowing tools from Model Context Protocol servers (pip install 'flowai-cli[mcp]').
Using it as a library
import asyncio
from flowai import Agent, tool
@tool
def compound_interest(principal: float, rate: float, years: int) -> float:
"""Balance after compounding yearly."""
return round(principal * (1 + rate) ** years, 2)
agent = Agent(
name="Advisor",
provider="anthropic", # nvidia, ollama, openai, gemini, openrouter
model="claude-sonnet-5-5",
tools=[compound_interest],
)
print(asyncio.run(agent.run("What will $5,000 be after 10 years at 8%?")))
agent.stream(prompt) yields tokens as they arrive and runs tool calls along
the way. Tools you register in your own code run without an approval prompt
(you wrote them); give a ToolRegistry an approver callback to change that.
Beyond a single agent the library has:
- Specialised agents:
PlannerAgent,CriticAgent,ToolAgent,SupervisorAgent - Patterns:
ReflectionPattern,PlanAndExecutePattern,DebatePattern,Swarm - Workflows: a graph engine with conditional edges, loops, parallel
branches and checkpointing (
Workflow,FileCheckpointer) - Memory:
InMemory,QdrantMemory(flowai-cli[qdrant]),ChromaMemory(flowai-cli[chroma]) - Observability: per-span token counts and estimated cost (
agent.tracer), an event bus, and an OpenTelemetry exporter (flowai-cli[observability]) - Plugins: third-party providers via the
flowai.pluginsentry point
Runnable examples are in examples/.
Developing FlowAI
pip install -e '.[dev]'
pytest
ruff check flowai tests
The tests are offline: providers are faked at the HTTP layer, so no key is needed.
Releasing to PyPI
- Bump
versioninpyproject.tomland__version__inflowai/__init__.py. - Push a tag
flowai-vX.Y.Z. Theflowai-releaseworkflow builds this directory and publishes it with PyPI Trusted Publishing; configure theflowai-cliproject on PyPI to trust this repository and workflow first.
License
MIT
Metadata
Release files for flowai-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flowai_cli-0.2.0.tar.gz | 58.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flowai_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 127.3 kB
Release files / flowai_cli-0.2.0.tar.gz
| Download URL | flowai_cli-0.2.0.tar.gz |
|---|---|
| Size | 58.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e09a2d35f2ae5eec73cc39529e406be4f688155a03d742b373fab386eb161d5b
|
|
BLAKE2b-256 checksum How to use checksums |
4a602a376aed70c05b44e814915ea313948c1c6c578b20903cce464f332da3f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / flowai_cli-0.2.0-py3-none-any.whl
| Download URL | flowai_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 69.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f4485df149f29782ce9d8ef6d7c9858addf9b0b1e0488a1615363516177dbb5
|
|
BLAKE2b-256 checksum How to use checksums |
97ee63ce0666d2f3eeaea56bb5952ff9fa88c8e6528f993ab89a857d34587807
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for flowai-cli 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for flowai_cli-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.