Getting Started with AI-Parrot¶
AI-Parrot is an async-first Python framework for building AI agents and chatbots. This guide takes you from a plain operating system to a working install and a first running agent.
Every command below is explained — what it does, why the step needs it, and
what it changes on your machine — so you can decide whether to run it rather
than pasting it blindly. Commands that need sudo or fetch something over the
network additionally state their blast radius and, where one exists, a
non-piped alternative you can inspect before running.
Supported Python: AI-Parrot requires Python 3.11 (3.11.4 or later), 3.12 or 3.13. Python 3.14 is not yet supported — the package will refuse to install on it.
1. Prerequisites¶
Pick your operating system below. Each block installs Python (if you don't
already have a supported version) and git.
Ubuntu 24.04.4 LTS+¶
apt-get updaterefreshes Ubuntu's local package index from its configured repositories — it does not install or change anything by itself.apt-get install -y ...installs Python 3.12 (a supported version), its standard-libraryvenvmodule,pip, andgit. Blast radius: this modifies system-wide packages under/usrand requiressudo. If you'd rather not run it blind, inspect what it would do first withapt-get install -y --dry-run python3.12 python3.12-venv python3-pip git, which prints the plan without changing anything.- Ubuntu 24.04 ships Python 3.12 in its default repositories, so no extra PPA is required for a supported interpreter.
macOS 14+¶
xcode-select --install # if you don't already have the Xcode CLI tools
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python@3.12 git
xcode-select --installinstalls Apple's Command Line Tools (compiler,git, standard Unix utilities) if you don't already have them — a one-time, interactive, GUI-prompted install; skip it ifxcode-select -palready prints a path.- The
curl | bashline installs Homebrew, macOS's package manager. Blast radius: it downloads and executes a remote script with your user's privileges (it will prompt forsudoitself when it needs to create/opt/homebrew). A non-piped alternative: download the script first (curl -fsSL -o install.sh <url>), read it, then runbash install.sh. Skip this step entirely if you already have Homebrew (brew --version). brew install python@3.12 gitinstalls a supported Python andgitunder Homebrew's own prefix — it does not touch the system Python.
Windows 10+¶
winget install Python.Python.3.12installs a supported Python release via the Windows Package Manager (already present on Windows 10 2004+ and all of Windows 11). It installs to the current user's app data by default — no system-wide change.winget install Git.Gitinstalls Git for Windows the same way.- Prefer an interactive install instead? Download both installers directly
from python.org and
git-scm.com and run them manually — the
wingetcommands above are a scripted shortcut to the same installers, not a different source.
2. Install the package¶
Create an isolated virtual environment first, then install AI-Parrot into it.
Using a venv means the install only ever touches files inside the project
directory — nothing system-wide, and rm -rf .venv fully undoes it.
Linux / macOS:
Windows (PowerShell):
python -m venv .venvcreates a self-contained Python environment in a new.venv/directory — no admin/sudo privileges needed.- The
activatestep points your shell'spython/pipat that environment instead of the system one, for the rest of this session only. pip install --upgrade pipupdates the venv-localpip(not the system one) so the next command resolves dependencies with a current resolver.pip install ai-parrotdownloads AI-Parrot and its core dependencies from PyPI into.venv/. This is a real network fetch of third-party code — the package is public on PyPI if you want to inspect it first.
If you prefer uv (a faster, drop-in
alternative to pip/venv), the equivalent is:
A bare install alone is not enough to talk to an LLM — see the next section.
Global install (managed runtime, no project venv)¶
Instead of a per-project venv you can install AI-Parrot once per machine. One command puts parrot,
wikitoolkit and bookstore on your PATH, backed by a managed runtime under ~/.parrot (or
$PARROT_HOME): a compatible system uv or a private pinned uv, a uv-managed Python 3.12 and a venv holding ai-parrot together with
ai-parrot-tools at the same version (wikitoolkit mcp needs it). It needs no system Python.
Supported platforms. The global install is officially supported on Linux x86_64 only. Linux aarch64 (ARM servers) is not supported: no wheel is published for it and the installer refuses it. On macOS arm64 and Windows x64 the installer runs but prints a warning. On macOS some dependencies (python-datamodel, navconfig, navigator-api, navigator-auth) publish no arm64 wheel, so the install compiles them and needs a C toolchain. On Windows it currently fails: navigator-auth has no Windows wheel, and uvloop, which proxylists requires, does not run on Windows. This affects a project install on Windows too. Details: wiki/operations/install/global-runtime.md.
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/phenobarbital/ai-parrot/main/scripts/install/install-parrot.sh | bash -s -- --global
Downloads: the script above and, only when no compatible system uv is available, the pinned uv 0.11.28 archive plus its .sha256 file
(https://github.com/astral-sh/uv/releases/download/0.11.28/uv-<target>.tar.gz), then ai-parrot and
ai-parrot-tools from PyPI. A system uv in >=0.11.28,<0.12 is recorded and reused; all other system uv
installations are left as is.
Writes: ~/.parrot/bin, ~/.parrot/libexec, ~/.parrot/venv and ~/.parrot/python, plus a # >>> parrot >>> PATH block
in your shell profile. If they are missing, it also writes the credentials file ~/.parrot/env/.env (mode 0600,
every key commented out) and an empty ~/.parrot/etc/config.ini for navconfig. Existing ~/.parrot data (wikis,
library, skills, brains, parrot.db, an existing env/.env) is never touched. Your own uv is never modified,
moved or removed; a pinned fallback lives under ~/.parrot/libexec, never on PATH.
Verified by: the uv archive checksum, then parrot self doctor --runtime-only; a failure removes only
what the run created. Before writing anything the script checks the platform, curl/wget, sha256sum,
git, 2 GiB of free space under PARROT_HOME and that GitHub and PyPI are reachable, and prints a plan first.
Without piping: download install-parrot.sh and SHA256SUMS from
https://raw.githubusercontent.com/phenobarbital/ai-parrot/main/scripts/install/, run
sha256sum -c --ignore-missing SHA256SUMS (macOS: shasum -a 256 -c --ignore-missing SHA256SUMS), read the
script, then run bash install-parrot.sh --global. Add --dry-run to print the plan only.
Windows (PowerShell):
powershell -ExecutionPolicy Bypass -Command "& ([scriptblock]::Create((irm https://raw.githubusercontent.com/phenobarbital/ai-parrot/main/scripts/install/install-parrot.ps1))) -Global"
Downloads: the script above and, only when no compatible system uv is available, the pinned uv 0.11.28 zip
plus its .sha256 file, then ai-parrot and ai-parrot-tools from PyPI. A system uv in >=0.11.28,<0.12 is
recorded and reused; all other system uv installations are left as is.
Writes: ~\.parrot\bin, ~\.parrot\libexec, ~\.parrot\venv and ~\.parrot\python, and adds ~\.parrot\bin to your
USER PATH (never the Machine PATH); reopen the terminal afterwards. If they are missing, it also writes
~\.parrot\env\.env (readable only by you, every key commented out) and an empty ~\.parrot\etc\config.ini.
Your own uv is never modified, moved or removed; a pinned fallback lives under ~\.parrot\libexec, never on PATH.
Verified by: the uv checksum (Get-FileHash), then parrot self doctor --runtime-only; a failure
removes only what the run created.
Without piping: Invoke-WebRequest both install-parrot.ps1 and SHA256SUMS from the same folder,
compare (Get-FileHash install-parrot.ps1).Hash with its line in SHA256SUMS, read the script, then run
powershell -ExecutionPolicy Bypass -File install-parrot.ps1 -Global.
Windows status (pending CI verification): the
-Globalpath has not yet run on a Windows runner. CI checks the script's syntax, its-DryRunplan and its pre-write gates underpwshon Linux; the install itself, the post-install rollback and the USER PATH restore are covered only by an offline harness that is still marked expected-to-fail. They become verified claims when the install-matrix Windows leg passes.
Options (PowerShell name in parentheses):
--provider <k>[,<k>...](-Provider): the LLM provider extras of the managed venv:anthropic(the default),openai,google,claude-code,codex-code. To add a provider later, run the installer again with--provider <k>; it reuses the existing venv.--with <component>[,...](-With): also install the packages an MCP toolkit needs, for example--with scraping(Playwright and Chromium). It is the same as runningparrot self add <component>later (see MCP toolkits below). An unknown name fails before anything is downloaded and lists the valid ones.--version <X>(-Version): pinai-parrotandai-parrot-toolsto one release.
--with and --version only apply to --global.
Your API keys go in ~/.parrot/env/.env: uncomment the lines you need and fill them in. The SDD flow and
wikitoolkit need no key.
Reference detail (gate, plan text, launcher order, --portable, version skew) is in
wiki/operations/install/global-runtime.md.
Manage the runtime: parrot self¶
parrot self add <component>installs the packages an MCP toolkit needs into the managed venv;--hereinstalls into the current project venv instead, and is the only way a dependency enters a project venv.parrot self envprints the venv the launcher resolves, the rule that picked it and the versions;parrot self env --initcreatesenv/.envandetc/config.iniif they are missing.parrot self doctordiagnoses the runtime, host configs and toolkit requirements.parrot self updateupgradesai-parrotandai-parrot-toolstogether in the managed venv (--versionpins one).parrot self uninstallremoves onlybin/,venv/andpython/; your credentials (env/),etc/and data stay (--yesskips the prompt). The PATH block in your shell profile stays too; delete it by hand.
MCP toolkits: parrot self add and parrot toolkits install¶
A toolkit (scraping, querysource, sdd-coder, ...) is an MCP server your coding assistant can call. Using one takes up to two steps, with different scopes:
parrot self add <name>: installs the Python packages the toolkit needs (and a post-install step, such as downloading Chromium) into the managed venv. Once per machine.--with <name>at install time does the same. Onlyscrapingandbrowsing(Playwright and Chromium) andquerysource(ai-parrot-tools[db]) need it; the other toolkits run on the base runtime.parrot toolkits install <name> --yes: adds the toolkit to the repository's.parrot/mcp-toolkits.yamland registers its MCP server with Claude Code, Codex or Antigravity (--host claude|codex|google; default: every host detected in the repository). Once per repository. Without a name it opens an interactive picker.
parrot self add scraping # once per machine
cd my-repo && parrot toolkits install scraping --yes # once per repository
parrot toolkits list # state, hosts and missing packages per toolkit
parrot toolkits install does not install packages. If a toolkit's packages are missing it prints
run: parrot self add <name>, and parrot self doctor reports it.
3. Install a provider (REQUIRED)¶
pip install ai-parrotalone registers ZERO LLM providers. Every concrete provider client ships as its ownai-parrot-client-<provider>satellite package, discovered via Python entry points. Until you install at least one,LLMFactory.list_providers()returns{}and any agent you create will fail with an "unsupported LLM" error the first time it tries to call a model — with no earlier warning. Installing a provider is not optional; it is step 3 of getting a working agent, not a later refinement.
There are two supported ways to add a provider:
Option A — API-key providers¶
Install the extra for the vendor whose API key you have, then set the key as an environment variable.
pip install "ai-parrot[anthropic]" # Anthropic (Claude models)
# or:
pip install "ai-parrot[openai]" # OpenAI
# or:
pip install "ai-parrot[google]" # Google Gemini
- Each command installs one
ai-parrot-client-<provider>satellite package and its SDK from PyPI — a normal, scoped dependency install, not a system change. - Set the matching API key as an environment variable before running any
code that uses it, e.g. (Linux/macOS)
export ANTHROPIC_API_KEY=sk-...or (PowerShell)$env:ANTHROPIC_API_KEY = "sk-...". Never commit a key to a file in your repository.
Option B — CLI-backed providers¶
If you already run the Claude Code or Codex coding-agent CLI on this machine, AI-Parrot can reuse that CLI's own authentication instead of a separate API key.
- These extras install
ai-parrot-client-anthropic/ai-parrot-client-openaiwith the SDK that talks to an already-runningclaude/codexCLI session — they do not install the CLI binaries themselves (see the installer scripts below for that). - Authentication is delegated to the CLI.
ClaudeAgentClientpicks upANTHROPIC_API_KEYfrom the environment when set, otherwise it relies on whatever auth flow you already completed viaclaude auth. The same idea applies to Codex and its own CLI auth. - Caveat: AI-Parrot's
detect_coding_agent_llm()helper only checks whether theclaude/codexbinary is on yourPATH(shutil.which) — it does not check whether you're actually logged in. A CLI binary that is installed but logged out will pass detection and then fail the first time it actually tries to call the model. If a call fails right after a clean detection, check your CLI's own auth status first (claude auth status/ the Codex equivalent). - You can install one, several, or none of the CLI-backed options independently of the API-key options above — pick whichever paths match what you already have.
You can install any combination of the extras above; LLMFactory discovers
whatever is present.
One asymmetry to know: Gemini has no CLI-backed provider path in
AI-Parrot. It is reachable only via the google (API key) extra above, or
google-compat (OpenAI-compatible wire format over the same Gemini API key)
— never through a coding-agent CLI.
4. Hello world¶
With a provider installed and its key/auth in place, this runs a minimal
agent end to end. It is adapted from examples/basic_agent.py in the
repository, with one deliberate change: it passes llm="anthropic" (swap in
whichever provider extra you installed) and from_database=False explicitly.
import asyncio
from parrot.bots.agent import BasicAgent
async def get_agent(question: str):
# from_database=False is deliberate: Chatbot (which BasicAgent extends)
# defaults to from_database=True, which tries to load the bot's
# configuration from a Postgres database you likely haven't set up yet.
# For a first run, skip that and configure the agent manually instead.
agent = BasicAgent(name="HelperAgent", llm="anthropic", from_database=False)
await agent.configure()
response = await agent.invoke(question)
return response.output, response
if __name__ == "__main__":
answer, response = asyncio.run(get_agent("What is the capital of France?"))
print(answer)
Run it with python hello_world.py (after activating your venv). It makes
one real network call to whichever provider you chose in step 3 — expect a
one-line answer. With the global install there is no venv to activate: run
~/.parrot/venv/bin/python hello_world.py and put the key in ~/.parrot/env/.env
(the managed venv already has the anthropic provider unless you chose another
--provider).
Two things this snippet deliberately avoids:
- The
from_database=Truetrap.Chatbot.__init__(the base classBasicAgentextends) defaultsfrom_database=True, which — with no explicit argument — tries to load the bot's configuration from a Postgres database onconfigure(). That's the right choice once you're persisting named bots, but it is the wrong default for a first run with nothing set up. Passingfrom_database=Falseconfigures the agent purely from the constructor arguments instead. - The zero-providers trap from step 3.
llm="anthropic"is explicit here, not left to the default, precisely because a bare install has no default provider to fall back to.
5. Building and querying the codebase knowledge graph¶
wikitoolkit ships as a console script with the base package — no extra
install needed for build/query themselves (some optional per-language
scanners are covered in the next section).
- Scans the current repository deterministically — no LLM calls, no
embeddings, no network access — and writes a local SQLite knowledge-graph
index under
.parrot/wiki/. Safe to re-run; it incrementally re-indexes only changed files.
- Runs a token-budgeted, ranked lexical search over that local index and
prints matching page stubs — again, fully offline once
buildhas run.
Use the SDD flow in your repo¶
With the global runtime installed, any git repository (Python or not) can adopt the Spec-Driven Development flow:
parrot sdd install --host claude --dry-run # preview: write / skip / upgrade per file; changes nothing
parrot sdd install --host claude # deploy commands, skills, helpers and seeds
parrot self doctor --sdd # origin, base branch, ledger, worktrees ignore, gh, jq, python3, host CLIs
parrot sdd status # missing | current | outdated | edited | foreign
- The install writes the host's
/sdd-*commands, the seedssdd/config.json,sdd/CONVENTIONS.mdandsdd/tasks/.id_ledger.json, an ignore block for the resolved worktree root (default.parrot/worktrees/, orWORKTREE_BASE_PATH) and.parrot/, a marked.gitattributesblock (merge=unionfor the ledger log) and the fourparrot-ledgergit hooks. What it wrote is recorded insdd/.sdd-installed.json; commit it.parrot sdd installandparrot self doctorrefuse while worktrees remain under the legacy.claude/worktrees/and print the migration recipe./sdd-insightis not installed. - Edit
sdd/config.json:base_branch,hotfix_base,issue_tracker,test_command, ... A repository whose tests are not pytest (Node, Rust, Go, ...) MUST settest_command(e.g."npm test"): without it,/sdd-taskrejects every non-pytest validation command. Whentest_commandis set, the shipped test steps run it once from the repo root instead of the selection/report steps (cache_test_contractin/sdd-task,select_tests/test_reportin/sdd-done), and a run with no tests shows "not run". When it is null the ai-parrot selection path applies, andparrot sdd installwarns. - Fill in the
sdd/CONVENTIONS.mdseed (## Repository layout,## Project areas); it is created once and never overwritten. - Then open your assistant and run your first
/sdd-spec... command. Helpers run asparrot sdd <noun> <verb>(for exampleparrot sdd ids reserve --help). - The install also prepares the SDD base branch (
base_branchfromsdd/config.json, defaultdev): when the repository has a commit and the branch is missing it creates the local branch (trackingorigin/<base>if that exists, otherwise fromHEAD); it never moves or deletes an existing branch and uninstall keeps it. A repo with no commit yet, or noorigin, gets awarning:/note:with the exact command.--base-branch NAMEseedssdd/config.jsonwith that branch (refused if the config already sets another); a repo that integrates onmainalso passes--hotfix-base NAME, because the base and hotfix branches must differ andmainis the default hotfix branch;--push-basealso runsgit push -u origin <base>when origin lacks it.--dry-runshowsplan: base-branch ...and creates nothing. - For the Claude host the install also registers a portable dangerous-actions guard (a
PreToolUsehook onBash|Edit|Write|MultiEditin.claude/settings.json, served byparrot sdd hooks dangerous-actions --hook; stdlib only, so it works the same on Linux, macOS and Windows). It blocksgit reset --hard,git clean -fd, force-push to (--force,-for a+refspec) or deleting a protected branch (dev,main,master,stagingalways, plusbase_branch,staging_branchandhotfix_basefromsdd/config.json),git worktree remove --force, recursive deletes of/,~, a drive root or.git/.venv,mkfs/diskutil erase*/format X:, destructive SQL through a database client, direct package publication, barepip installin a uv-managed repo, literal API keys, and writes to secret files; each block names a safe alternative. A deliberate recovery session can setPARROT_ALLOW_DANGEROUS=1;parrot sdd install --no-dangerous-guardskips the registration. Foreign hook entries are never touched, a repository that already runsdangerous-actions-blockeris left alone, andparrot sdd uninstallremoves only the entry the install recorded. - The install also registers the two MCP toolkits the
sdd-workeragent relies on —sdd-coderandbounded-source— in.parrot/mcp-toolkits.yamland the host MCP config (.mcp.jsonfor Claude). It keeps the shippedsdd-coderroster and prints a staticnote: sdd-coder seats available: …; unavailable: … (<reason>)line (credentials and CLIs only, no model call). Awarning:that complex tasks have "no retry seat" means fewer than two strong MCP seats (codex/gemini/nova) are usable — add credentials and re-run. Toolkits you installed yourself are never recorded or removed byparrot sdd uninstall;parrot sdd install --no-sdd-coderskips all of this. - Re-running
parrot sdd install(e.g. after upgrading parrot) replaces every installed SDD file — commands, agents, rules, templates — with the packaged copy, including ones you edited or copied in by hand. Pass--keep-editsto leave those untouched (a warning lists them). Seeds such assdd/config.jsonare never overwritten.
More: wiki/operations/install/global-runtime.md.
6. Optional extras¶
Two extras worth knowing about beyond the provider ones in step 3:
- Installs the client for TypeSafe AI's Jev System
One model — typed, calibrated decisions (routing/ranking/verification)
instead of free text. Requires a
TYPESAFE_API_KEYenvironment variable. Seewiki/clients/jev.mdfor the full client reference.
- Installs
parrot_codec, an optional Rust-accelerated columnar codec used to compress large tool results. Pre-built wheels are published for common platforms; without this extra, AI-Parrot transparently falls back to a pure-Python implementation, so this is a performance optimization, not a functional requirement.
7. Verification checklist & troubleshooting¶
Confirm each of these before moving on:
-
python -c "import parrot; print(parrot.__name__)"succeeds inside your activated venv. -
python -c "from parrot.clients.factory import LLMFactory; print(LLMFactory.list_providers())"prints a non-empty dict. An empty{}means no provider satellite is installed yet — go back to step 3. -
wikitoolkit --helpruns without error. - Global install: in a new terminal,
parrot self doctorshows no✗. - The hello-world snippet in step 4 prints an answer instead of raising.
Common failures:
| Symptom | Likely cause | Fix |
|---|---|---|
ValueError: Unsupported LLM: '<provider>' |
That provider's satellite isn't installed | pip install "ai-parrot[<provider>]" (step 3) |
| Agent construction or a call raises an auth/401 error | API key not set, or CLI not logged in | Re-check the environment variable, or run claude auth / the Codex login flow |
| A CLI-backed provider "works" during detection but the call itself fails | detect_coding_agent_llm() only checks the binary is on PATH, not that you're logged in |
Check the CLI's own auth status directly |
pip install ai-parrot fails outright |
Unsupported Python version | Confirm python --version is 3.11.4 or later, 3.12, or 3.13 |
8. Where to go next¶
wiki/wiki/wiki-claude-code.md— wiringwikitoolkitinto Claude Code as coding-assistant infrastructure.wiki/clients/jev.md— the Jev typed-decision client in depth.- The repository's
.agent/CONTEXT.md— architectural overview of AI-Parrot's core abstractions (AbstractClient,AbstractBot/Chatbot/Agent,AbstractTool) if you're going to build beyond the hello-world above.