Welcome to Copycat, a way to copy changes from one git repository to another.
Copycat is an automation tool that enables you to apply consistent changes across multiple GitHub repositories using AI coding assistants. It streamlines the process of creating issues or performing code changes at scale with support for multiple AI tools including Claude, Codex, Qwen, and others.
In order to run Copycat, you need to have the following installed:
- Go (1.16 or later)
- GitHub CLI (
gh) - Installation guide - AI Coding Assistant - At least one of:
- Claude CLI (
claude) - Installation guide - Codex (
codex) - Qwen (
qwen) - Gemini (
gemini) - Or any other AI tool configured in
config.yaml
- Claude CLI (
Before using Copycat, ensure you're authenticated:
# Authenticate with GitHub
gh auth login
# Authenticate with your chosen AI tool (example with Claude)
claude auth loginCopycat reads all settings from a single config.yaml file in the project root:
github:
organization: saltpay
auto_discovery_topic: copycat-subject
requires_ticket_topic: requires-ticket
slack_room_topic_prefix: slack-room/
tools:
- name: claude
command: claude
code_args:
- --permission-mode
- acceptEdits
summary_args: []
- name: codex
command: codex
code_args:
- exec
- --full-auto
summary_args: []
- name: qwen
command: qwen
code_args:
- --approval-mode
- auto-edit
- -p
summary_args: []github.organization: GitHub organization to scan for repositoriesgithub.auto_discovery_topic(optional): GitHub topic Copycat passes togh repo list; when omitted Copycat lists all repositoriesgithub.requires_ticket_topic(optional): Topic that marks repositories as requiring a Jira ticket in PR titlesgithub.slack_room_topic_prefix(optional): Topic prefix used to infer the Slack room by stripping the prefix (e.g.,slack-room/eng-toolingβeng-tooling,slack-room/#eng-toolingβ#eng-tooling)tools: List of AI tools available in the selectorname: Identifier for the toolcommand: CLI command to executecode_args: Arguments passed when making code changessummary_args: Arguments passed when generating PR descriptions (optional)
When Copycat lists repositories it uses the configured discovery topic if provided, otherwise it fetches every unarchived repository in the organization. Any repository that also has the configured requires_ticket_topic is treated as requiring a Jira ticket in the PR title. If a repository includes a topic that starts with slack_room_topic_prefix, Copycat sends notifications to the derived Slack channel.
go run main.go
# Or build and run
go build -o copycat
./copycatCopycat offers two main workflows:
Creates GitHub issues across selected repositories and assigns them to @copilot.
Steps:
- Select repositories from the list (or type "all")
- Choose "Create GitHub Issues"
- Enter issue title
- Enter issue description
- Issues are created automatically
Note: The Copilot agent does not sign commits, so you'll need to fix unsigned commits before merging.
Clones repositories, applies changes using your configured AI coding assistant, and creates pull requests.
Steps:
- Select repositories from the list (or type "all")
- Choose "Perform Changes Locally"
- If any selected project includes the configured
requires_ticket_topic, enter a Jira ticket (e.g., PROJ-123) - Enter PR title
- Enter the AI prompt:
- Single line: Type or paste the prompt and press Enter
- Editor: Opens your default editor (set via
$EDITORenv var, defaults to vim)
- Copycat will:
- Clone all selected repositories to
repos/directory - Create a timestamped branch (e.g.,
copycat-20231015-150405) - Run your chosen AI tool to analyze and apply changes
- Generate PR description automatically
- Commit and push changes
- Create pull requests
- Clean up cloned repositories
- Clone all selected repositories to
When prompted for project numbers:
- Enter specific numbers:
1,3,5 - Enter a range:
1,2,3,4 - Select all projects:
all - Skip selection: press Enter
Branches are automatically named with the format: copycat-YYYYMMDD-HHMMSS
Example: copycat-20231015-150405
- Regular projects: Uses the PR title you provide
- Projects that require a ticket (repositories tagged with the configured
requires_ticket_topic): Automatically prepends Jira ticket:PROJ-123 - Your PR Title
-
Input Collection Phase
- Collects all user inputs upfront (Jira ticket, PR title, AI prompt)
- Validates inputs before processing
-
Repository Processing Phase
- Cleans up existing
repos/directory - Clones selected repositories via SSH
- Creates a new timestamped branch
- Runs your configured AI tool with appropriate arguments (from
config.yaml) - Captures AI output for PR description
- Cleans up existing
-
PR Generation Phase
- Uses your AI tool to generate a concise PR description (2-3 sentences)
- Commits changes using the PR title as commit message
- Pushes branch to origin
- Detects default branch automatically
- Creates PR using GitHub CLI
- Cleans up local repository clone
- Collects issue title and description
- Uses
gh issue createto create issues - Automatically assigns issues to @copilot
- Provides URLs of created issues
copycat/
βββ main.go # Main application code
βββ config.yaml # Combined configuration (GitHub + AI tools)
βββ internal/
β βββ ai/
β β βββ ai.go # AI tool integration logic
β βββ config/
β β βββ config.go # Configuration loading
β β βββ config_test.go # Configuration tests
β βββ input/
β β βββ ai_prompt.go # User input handling
β βββ git/
β βββ filesystem/
βββ go.mod # Go module dependencies
βββ go.sum # Go module checksums
βββ README.md # This file
βββ copycat-logo.png # Logo image
βββ repos/ # Temporary directory for cloned repos (auto-cleaned)
Git clone fails:
- Ensure you have SSH access to the repositories
- Check your SSH keys:
ssh -T [email protected]
AI tool fails:
- Verify your chosen AI tool is installed and in your PATH
- Check authentication with your AI tool
- Ensure repositories have proper file permissions
- Verify the AI tool configuration in
config.yamlis correct
PR creation fails:
- Verify you're authenticated with GitHub CLI:
gh auth status - Check that you have write access to the repositories
- Ensure the base branch exists
No changes detected:
- Your AI tool may not have made any modifications
- Review your prompt for clarity
- Check if the prompt applies to the specific repository
- Verify the AI tool is configured correctly with appropriate arguments
- Test with a single repository first before running on all projects
- Use clear, specific prompts for your AI tool
- Review changes before merging PRs
- Keep Jira tickets handy for projects requiring a ticket
- Use the editor option for complex multi-line prompts
- Configure AI tool arguments properly in
config.yamlfor optimal results
Add a new dependency:
Add the package "github.com/stretchr/testify" to go.mod and run go mod tidy
Update documentation:
Add a CONTRIBUTING.md file with guidelines for: code style (use gofmt), testing requirements (minimum 80% coverage), and PR process (requires 2 approvals)
Refactor code:
Rename all instances of the function 'processData' to 'transformData' across the codebase. Ensure all tests are updated accordingly.
- Copycat uses SSH for git operations
- Credentials are managed via GitHub CLI and Claude CLI
- No credentials are stored by Copycat
- Repository clones are cleaned up after processing
