Skip to main content

Add your description here

Project description

Floyd

Floyd is a CLI tool that generates pull request descriptions and commit messages using AI CLI tools — not APIs. It wraps tools like Claude Code, Gemini CLI, and GitHub Copilot CLI to analyze your git changes and produce conventional-commit-style output, then creates PRs via GitHub CLI.

The idea is simple: if you already have an AI CLI tool installed, Floyd can use it to automate the tedious parts of your git workflow without requiring API keys or token management.

Features

  • Multiple AI providers — works with Claude, Gemini, or GitHub Copilot CLI tools
  • PR generation — analyzes diffs, commits, and file stats to generate PR titles and descriptions
  • Commit message generation — generates commit messages from staged changes
  • Iterative refinement — refine generated output with natural language feedback before accepting
  • Configurable — custom instructions, diff size limits, and model selection per provider

Prerequisites

Installation

pip install floyd-pr-generator

Configuration

Create a config file at:

  • Linux/macOS: ~/.config/floyd.toml
  • Windows: C:\AppData\Roaming\floyd\floyd.toml
[ai]
provider = "claude"          # "claude", "gemini", or "copilot"
model = "claude-opus-4-5"   # optional, provider-specific model override
diff_limit = 50000           # max diff size in chars, -1 for unlimited

# optional per-workflow instructions appended to the AI prompt
pr_instructions = """
- Focus on business impact
- Include breaking changes at the top
"""

commit_instructions = """
- Use abbreviated prefixes
- Keep descriptions concise
"""

Only provider is required. Everything else has sensible defaults.

Usage

Generate a pull request

floyd pr <target-branch>

This fetches the diff between your current branch and the target, sends it to the configured AI provider, and presents a draft PR for review. You can then create it, refine it with feedback, or cancel.

Generate a commit message

floyd commit

This reads your staged changes (git diff --cached), generates a conventional commit message, and lets you review it before committing.

Workflow

Both commands follow the same interactive loop:

  1. Floyd gathers git context (diff, commits, file stats)
  2. The AI provider generates a title and body
  3. You review the draft in a formatted panel
  4. Choose to accept, refine (with feedback), or cancel

How it works

Floyd shells out to your chosen AI CLI tool with a structured prompt. It does not call any AI API directly — it relies entirely on the CLI tools being installed and authenticated on your system.

The prompt includes your branch name, commit history, diff stats, and the full diff (truncated to diff_limit if set). The AI response is parsed for TITLE: and BODY: markers to extract the generated content.

For PR creation, Floyd calls gh pr create with the generated title and body. For commits, it runs git commit with the generated message.

Project structure

floyd/
├── domain/              # Business entities and exceptions
│   ├── entities/        # PullRequest, Commit, GitContext, Branch
│   ├── value_objects/   # ProviderType enum, Branch
│   └── exceptions/      # Domain-specific errors
├── application/         # Use cases and port interfaces
│   ├── services/        # PR generation, environment validation
│   ├── ports/           # Inbound/outbound interfaces
│   └── dto/             # Configuration data structures
└── adapters/            # Infrastructure implementations
    ├── inbound/cli/     # CLI entry point and terminal UI
    └── outbound/        # AI, Git, GitHub, and config adapters

Troubleshooting

"This directory is not a git repository" — run Floyd from inside a git repo.

"The 'claude' command failed to execute" — make sure the configured AI CLI tool is installed and available in your PATH.

"The branch 'X' does not exist on origin" — the target branch must exist on the remote. Push it first or use a different branch.

Config not loading — verify the file is at ~/.config/floyd.toml (Linux/macOS) or C:\AppData\Roaming\floyd\floyd.toml (Windows) and has valid TOML syntax.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

floyd_pr_generator-0.2.4.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

floyd_pr_generator-0.2.4-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file floyd_pr_generator-0.2.4.tar.gz.

File metadata

  • Download URL: floyd_pr_generator-0.2.4.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for floyd_pr_generator-0.2.4.tar.gz
Algorithm Hash digest
SHA256 f22905f53f10ca64c01cd6f311c68a3a585438199fc2a43b983141d731e876f4
MD5 7799ddad31cc18e88b84f84196e43f66
BLAKE2b-256 783d731a2937aded320cc7d0344f53ec6fb7885aed3de62df926183a1b44a0bb

See more details on using hashes here.

File details

Details for the file floyd_pr_generator-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for floyd_pr_generator-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f2f53a29045232e78ba10a1c53bca32d9e577f8554ae141422d54b680e3d300
MD5 4e51f7017a14282b1fb649ad079b1cc0
BLAKE2b-256 614c1c2871d0b725ff272a9b633d6db0fc80646c09775d40b1fac900af75e6a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page