Skip to content

Repository files navigation

Relay

ReleaseCICodeQLPython 3.10+RuffLicense: MIT

Your Git workflow, on autopilot.

Relay is a zero-dependency CLI that turns your daily Git loop into a single command: stage changed files, generate a Conventional Commit message via LLM, commit, push, and open a Pull Request.

git add . ──▶ Generate Conventional Commit ──▶ git commit ──▶ git push ──▶ Open PR

Relay Terminal Walkthrough

flowchart LR
A["Working Tree"] --> B["relay"]
B --> C{"Mode Selection"}
C -->|--solo| D["Commit & Push to Current Branch"]
C -->|--team| E["Create & Checkout Branch, Push -u"]
D --> F["relay pr"]
E --> F
F --> G["Native Pull Request (GitHub / GitLab / Bitbucket)"]
Loading

Note

Zero Network Dependency for Core Operations
Relay runs entirely on the Python standard library. If the AI model is offline, rate-limited, or misconfigured, Relay immediately drops into an interactive manual prompt in the same terminal session so your work is never blocked.


Key Capabilities

  • Zero Runtime Dependencies
    Built strictly with the Python standard library. No requests, no pydantic, no external CLI frameworks. Installs in seconds and runs anywhere Python 3.10+ is present.

  • AI-Powered Conventional Commits
    Inspects the actual git diff --cached and generates standard type(scope): subject commit messages. Supports Gemini, local Ollama, OpenAI, Anthropic, Mistral, Groq, and xAI.

  • Human-in-the-Loop Control
    Every message is presented for review before committing ([Accept] [Edit] [Retry] [Abort]). Auto-accept can be enabled with --yes.

  • Solo and Team Modes
    Use --solo to commit and push straight to your current branch. Use --team <feature> to auto-create feature branches, with built-in default branch protection preventing accidental direct pushes to main.

  • Native Forge Pull Requests
    Create PRs directly from your terminal (relay pr) via zero-dependency REST clients for GitHub, GitLab (including self-hosted), and Bitbucket Cloud.

  • Engineered for Reliability
    Subprocess calls are executed with strict argv arrays (shell=False). Secrets remain environment-only. Every command is tested with a 90%+ coverage gate.


Installation

Requires Python 3.10+ and git on your PATH.

PlatformPackage ManagerCommand
macOS / LinuxHomebrewbrew tap Fiqqar/relay && brew install Fiqqar/relay/relay
WindowsScoopscoop bucket add relay https://github.com/Fiqqar/Relay && scoop install relay/relay
Anywherepip / gitpip install "git+https://github.com/Fiqqar/Relay.git"

Tip

You can also run the bundled installer directly from a cloned repo:

python install.py --yes

Quick Start

1. Set Provider Credentials

Set the API key for your chosen provider:

# Gemini (default)export GEMINI_API_KEY="your-key-here"# Or local Ollama (no key needed)export RELAY_AI_PROVIDER="ollama"

2. Verify Your Environment

Run relay doctor to verify Python, Git, and credentials:

$ relay doctor[relay doctor] Relay 1.1.3 - gemini provider Python 3.10+ PASS 3.11.9 relay on PATH PASS /usr/local/bin/relay git installed PASS 2.43.0 inside a git repo PASS branch: feat/auth, remote: yes, working tree: clean provider: gemini PASS Gemini API AI credentials PASS GEMINI_API_KEY is set GitHub token PASS GITHUB_TOKEN is set 7 pass, 0 warn, 0 fail - system healthy.

3. Daily Workflow

# Solo workflow: stage all, generate commit message, push to current branch
relay --solo
# Team workflow: stage all, create feat/checkout branch, push upstream
relay --team "checkout"# Open a pull request for the pushed branch
relay pr --open

Command Reference

Command / FlagDescription
relay --soloStage all, generate message, commit, and push to the current branch (default).
relay --team [NAME]Auto-create <type>/<feature> branch, commit, and push upstream.
relay prOpen a PR on GitHub, GitLab, or Bitbucket (-d draft, -o open browser).
relay undoSoft-reset the last commit (HEAD~1); modified files stay staged.
relay amendRegenerate and replace the last commit message in place (never force-pushes).
relay squashFold the last N commits into a single clean Conventional Commit.
relay stageInteractive file and hunk staging helper (git add -p).
relay doctorDiagnose environment readiness (PATH, Git, tokens, remotes).
relay completions [SHELL]Print a shell completion script (bash/zsh/fish/powershell).
relay manPrint the relay(1) manual page (roff) to stdout.
relay telemetry [on|off|status]View or change opt-in anonymous usage telemetry (off by default).
-m, --message TEXTUse this commit message instead of generating one with AI.
--provider NAMEAI provider override (gemini, ollama, openai, anthropic, mistral, groq, xai).
--timeout SECONDSSeconds to wait for the AI response (default 30, max 120).
--no-pushCommit but do not push.
--no-verifySkip git pre-commit and commit-msg hooks.
--repo PATHRun on this repo path (repeatable; defaults to current dir).
--yesSkip the confirmation menu and proceed automatically.
--stagedOnly commit already-staged changes (skips git add .).
--dry-runPreview diff, AI message, and execution plan without making changes.
--allow-protectedExplicit escape hatch to permit team mode on protected branches.
--hunksGenerate multi-part Conventional Commit message per file/hunk.
--verbosePrint exact Git and HTTP commands as they run.

AI Providers and Configuration

Relay reads settings from environment variables or an optional TOML config file (~/.config/relay/config.toml on POSIX, %APPDATA%\relay\config.toml on Windows).

ProviderIdentifierRequired CredentialDefault ModelBase URL Override (Env)
GeminigeminiGEMINI_API_KEYgemini-2.5-flash
OllamaollamaNoneqwen2.5-coder:7bOLLAMA_BASE_URL
OpenAIopenaiOPENAI_API_KEYgpt-4o-miniOPENAI_BASE_URL
AnthropicanthropicANTHROPIC_API_KEYclaude-3-5-haiku-latestANTHROPIC_BASE_URL
MistralmistralMISTRAL_API_KEYmistral-small-latestMISTRAL_BASE_URL
GroqgroqGROQ_API_KEYllama-3.3-70b-versatileGROQ_BASE_URL
xAIxaiXAI_API_KEYgrok-betaXAI_BASE_URL

Sample Configuration (config.toml)

[relay]
provider = "gemini"branch_template = "feat/<feature>"pr_open = true
[team.protected]
branches = ["main", "master", "develop"]
[relay.ignore]
paths = ["dist/*", "*.lock", "package-lock.json"]

Important

Secrets Are Environment-Only
Tokens and API keys are never read from configuration files and are never written to disk or logs. This ensures repository configuration can be safely shared without credential leakage.


Documentation

Full architectural specifications and governance documentation:


Contributing & License

Contributions are welcome. Please read CONTRIBUTING.md and docs/WORKING_RULES.md before submitting patches.

Distributed under the MIT License.

About

One command. From a messy working tree to a clean, AI-authored Conventional Commit, pushed and done - in Solo or Team mode.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages