Chuck π§
Interactive commit selection for upstream contributions
Chuck helps you easily select which commits from your template-based project should go back to the upstream template. No more manually figuring out what's template-worthy vs app-specific!
The Problem Chuck Solves
When you create an app from a GitHub template and build your app, you make commits that are:
- β Template-worthy: Shared utilities, bug fixes, improvements everyone could use
- β App-specific: Your business logic, config, deployment scripts
Chuck makes it trivial to interactively select the good stuff and create a clean branch ready for upstream contribution.
Works with GitHub templates via .chuckrc configuration!
Installation
Prerequisites
- GitHub CLI (
brew install gh) - Rust (for building from source)
Build from Source
git clone <this-repo> cd chuck-cli cargo build --release cp target/release/chuck /usr/local/bin/ # or add to PATH
Using the Install Script
Usage
Chuck works with GitHub templates using .chuckrc configuration:
# 1. Create from template on GitHub (web UI) # 2. Clone your new repo git clone git@github.com:yourusername/your-app.git cd your-app # 3. Chuck reads .chuckrc and sets up template remote automatically chuck # Reads .chuckrc, adds remote, works!
.chuckrc Configuration
Add a .chuckrc file to your template repository:
[template] url = "git@github.com:company/web-template.git"
When someone creates a project from your template, this file comes with it and Chuck automatically:
- Reads the template URL from
.chuckrc - Adds it as a remote named "chuck-template"
- Fetches the latest changes
- Compares commits and shows the interactive selection
Supported URL formats:
git@github.com:owner/repo.git(SSH)https://github.com/owner/repo.git(HTTPS)https://github.com/owner/repo(HTTPS without .git)
How Chuck Works
Chuck will:
- Read .chuckrc to find the template repository URL
- Add the template as a remote and fetch latest changes
- Show you all commits since the template's latest commit
- Let you interactively select which ones to contribute back
- Create a clean branch with just those commits
- Push the branch to the template repository
Interactive Selection
Chuck shows you a terminal UI like this:
π§ Chuck: 3 of 4 commits selected
ββ Commits ββββββββββββββββββββββββββββββββββββββββ Details βββββββββββββββββββββββ
ββΊ [β] abc1234 - Fix bug in auth middleware ββHash: abc1234567890abcdef... β
β [ ] def5678 - Add my company's payment logic ββAuthor: John Doe β
β [β] ghi9012 - Improve database connection ββDate: 2025-01-20 14:30 β
β [ ] jkl3456 - Add deployment config ββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββMessage: β
βFix bug in auth middleware β
β/β/j/k: navigate β Space: toggle β a: all β β β
n: none β i: invert β h/?: help β Enter: proceed βFiles: β
q: quit β β’ lib/auth.rs β
β β’ lib/middleware.rs β
ββββββββββββββββββββββββββββββββββ
Controls:
β/βorj/k- Navigate between commitsSpace- Toggle selectiona- Select all commitsn- Select none (clear all)i- Invert selectionhor?- Show helpEnter- Create branch with selected commitsqorEsc- Quit without doing anything
Push and Create PR
After selecting commits, Chuck will:
- Create a timestamped branch (e.g.,
chuck/20250120-143022) - Cherry-pick your selected commits onto the template's base
- Attempt to push the branch to the template repository
- Provide you with a URL to create the pull request
π§ β
SUCCESS! All operations completed successfully.
π§ Check the URL above to create your pull request.Requirements
- Must be run in a GitHub repository created from a template
- GitHub CLI must be installed and authenticated (
gh auth login) - Repository must have a
.chuckrcfile with template URL - Repository must have commits since the template's latest commit
Error Messages
Chuck gives helpful error messages:
- No .chuckrc: "No template found. Chuck needs a .chuckrc file with template URL."
- No GitHub CLI: "GitHub CLI not found. Install with: brew install gh"
- Not authenticated: "Make sure you're in a GitHub repository and authenticated with 'gh auth login'"
- No commits: "Looks like you haven't made any commits since the template. Get to work!"
Example Workflow
# 1. Create from template on GitHub (web UI) # 2. Clone your new repo git clone git@github.com:myuser/my-awesome-app.git cd my-awesome-app # 3. Build your app (template already has .chuckrc) git commit -m "Add user authentication" # β Template-worthy git commit -m "Add company branding" # β App-specific git commit -m "Fix database connection bug" # β Template-worthy git commit -m "Deploy to our servers" # β App-specific # 4. Interactive selection chuck # Select commits 1 and 3 using the TUI # 5. Chuck creates branch and pushes automatically # 6. Create PR using the provided GitHub URL
Command Line Options
chuck --help # Show help chuck --version # Show version chuck --verbose # Show detailed output during operation
Version
Current version: 0.2.3