Installation

What you need

  • Python 3.12+
  • uv

Setup

git clone https://github.com/benedekaibas/pytifex
cd pytifex

export COHERE_API_KEY=your_cohere_api_key   # or set up another provider, see below

# optional, only raises GitHub rate limits
export GITHUB_TOKEN=ghp_your_github_token

uv run --extra dev pytifex --model command-a-03-2025

--extra dev is what actually installs mypy, pyrefly, zuban, and ty — they’re declared as an optional dependency group in pyproject.toml, not a base dependency. Leave it off and uv run pytifex only installs pytifex’s own two dependencies; the checkers won’t exist on PATH and every checker call fails.

Environment variables

Variable When it’s needed What it’s for
OPENAI_API_KEY Using --openai-base-url against an authenticated server API key for OpenAI, or whatever token your local/lab server expects
COHERE_API_KEY Using a command-* model Cohere API key (CO_API_KEY also works)
GITHUB_TOKEN Optional Raises the GitHub API rate limit from 60 to 5,000 requests/hour

You need exactly one provider key, unless you’re pointing at a local server with no auth — then you need none.

Setting up each provider

OpenAI-compatible (real OpenAI, or any local/lab server)

# real OpenAI
export OPENAI_API_KEY=your_key
uv run --extra dev pytifex --model gpt-4o --openai-base-url https://api.openai.com/v1

# a local server, no key needed unless it requires one
uv run --extra dev pytifex --model qwen3-6b --openai-base-url http://localhost:8080/v1

--openai-base-url forces this provider regardless of the model name — the model name just has to match what the server itself calls it.

Cohere

export COHERE_API_KEY=your_key
uv run --extra dev pytifex --model command-a-03-2025

One current gap

If you omit both --model and --openai-base-url, the CLI falls back to Gemini — that’s a hard-coded default in main.py/agent.py left over from an earlier version. It’s planned to come out. Until it does, always pass a provider flag explicitly rather than leaving --model at its default.