Skip to main content

Relay

Python OpenRouter OpenAI SDK Model Context Protocol Pydantic
Rich prompt_toolkit Click DuckDuckGo Docker

Relay is an open-source AI coding agent that runs in your terminal. It connects to LLMs through OpenRouter, reads and edits your code with a built-in tool set, runs shell commands, and streams everything through a full-screen TUI.

Relay planning and executing a multi-step task in the terminal

Functionality

Interface

Interactive TUI Full-screen terminal interface built on Textual, with streaming responses, live tool call output, and token usage tracking.
Single-shot mode Pass a prompt as an argument for non-interactive runs, suitable for scripting.

Tools

Files read, write, edit, grep, glob, and list_directories for working with a codebase.
Shell The shell tool executes commands in the working directory.
Planning A plan tool tracks steps (a todo list) across the agent loop.
Network Web search via DuckDuckGo and URL fetching.
Memory Key-value storage that survives across sessions.
MCP Connects to external MCP servers for additional tools and data sources.

Agent

Sub-agents Specialized agents the main agent can delegate to: codebase_investigator, code_reviewer, software_architect, test_writer, debugger.
AGENTS.md Project instructions are picked up automatically and followed while working.
Context pruning Old tool outputs are cleared once they pile up past the recent working set, reclaiming tokens without touching the conversation itself.
Compaction When the context window fills up, history is summarized into a continuation brief and the session resumes from it instead of erroring out.
OpenRouter backend Authenticate once with relay login (browser OAuth) or paste an API key. Model, temperature, and context window are configurable in ~/.config/relay/config.toml, with per-project overrides in .relay/config.toml.

Getting started

# 1. Install Relay
pip install relay-code

# 2. Log in (opens your browser to authorize with OpenRouter)
relay login
relay login --paste   # or paste an API key directly

# 3. Run it
relay                 # interactive mode
relay "your prompt"   # single-shot mode
relay --cwd /path     # run against a different working directory

# Remove the saved API key
relay logout

Project instructions (AGENTS.md)

Drop an AGENTS.md at the root of your repo and Relay loads it as developer instructions at startup, use it for build and test commands, code style, or anything else the agent should know before touching your code

Relay walks up from the working directory to the repository root, so running relay inside a subdirectory still picks up the root file. Every AGENTS.md found along the way is included, ordered outermost first.

# AGENTS.md

## Commands
- Test: `pytest`
- Lint: `ruff check .`

## Style
- Type hints on all public functions.

The scope of an AGENTS.md file is the directory tree it sits in, and the more deeply nested file wins on conflicts. Files below the working directory are read on demand as the agent works in those subdirectories. Instructions you give directly in a prompt always take precedence over AGENTS.md.

Roadmap

Currently being worked on:

  • Slash commands: in-session commands (e.g. /approval to switch approval mode) instead of only config-file settings.
  • Approval flow: prompting before file edits and shell commands is in place; still to come is switching the mode mid-session and extending confirmations to sub-agents.
  • Session management: saving, resuming, and switching between sessions.

License

GNU GENERAL PUBLIC LICENSE v3.0

Metadata

Release files for relay-code 0.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for relay-code 0.0.22
File Size Uploaded Provenance
relay_code-0.0.22.tar.gz 75.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for relay-code 0.0.22
File Interpreter ABI Platform
relay_code-0.0.22-py3-none-any.whl Python 3 none any Details

Total release size: 165.5 kB

Release files / relay_code-0.0.22.tar.gz

Download URL relay_code-0.0.22.tar.gz
Size 75.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f85d69a596e1cf056222a436b685e93e0debdd8f6165bd4bf77bb720bed08379
BLAKE2b-256 checksum
How to use checksums
1ab0d287687095b381efef7abef1ddbf90614302f8fcc4e600fa9c859425ffe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 23, 2026.

Transparency log

Release files / relay_code-0.0.22-py3-none-any.whl

Download URL relay_code-0.0.22-py3-none-any.whl
Size 90.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbb64201d3936ce240cb33873bd1d7c52e7ee55184e2d4b6e6c73be385b07683
BLAKE2b-256 checksum
How to use checksums
f7359f64cefe2003bd776fa7f0bad7b564847f935aa794bc45727b2aea78b3c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 23, 2026.

Transparency log

Security for relay-code 0.0.22

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.

Select from 2 files

Attestation for relay_code-0.0.22.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 Jul 23, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page