git-devflow
v1.0.1
Published
AI-powered Git workflow automation using GitHub Copilot CLI
Maintainers
Readme
DevFlow 🚀
AI-powered Git workflow automation using GitHub Copilot CLI. Streamline your development workflow with intelligent commit messages, PR descriptions, and branch naming.
✨ Features
- 🤖 Smart Commit Messages - AI-generated conventional commit messages from your changes
- 📝 PR Generation - Automatic pull request descriptions with summary, changes, and testing notes
- 🌿 Branch Naming - Semantic branch names from GitHub issues or descriptions
- ⚙️ Config Management - Secure token storage with interactive setup wizard
- 💰 Cost-Aware Model Selection - Dynamically fetches available models from Copilot CLI with cost info
- 🔄 Quota Auto-Retry - Automatically falls back to a free model when premium requests are exhausted
- 🔐 Security First - Tokens never displayed, error messages sanitized, config file locked down
🎥 Demo
📦 Installation
npm install -g git-devflow🔧 Setup
# Run interactive setup (single source of truth - no .env file needed)
devflow config setupThe setup wizard will prompt you for:
- GitHub Personal Access Token - for creating PRs and fetching issues
- Preferred AI model - fetched dynamically from Copilot CLI with cost info
- Default base branch - typically
mainordevelop
All config is stored securely in ~/.devflow/config.json with restricted file permissions.
🎯 Usage
Generate Commit Messages
# Stage your changes
git add .
# Generate AI-powered commit message
devflow commit
# Or stage all changes automatically
devflow commit -aEach operation shows the model being used and its cost:
🤖 Model: claude-sonnet-4.5 Balanced · 1 premium request(s) per promptCreate Pull Requests
# On your feature branch
devflow pr create
# Specify custom base branch
devflow pr create --base developCreate Branches
# From GitHub issue
devflow branch create --issue 123
# From description
devflow branch create "add user authentication"
# Interactive mode
devflow branch createConfiguration
# Show current config
devflow config show
# Update specific setting
devflow config set copilotModel claude-haiku-4.5
# Get config value
devflow config get copilotModel
# Re-run full setup wizard
devflow config setup🏗️ How It Works
DevFlow uses GitHub Copilot CLI as its AI engine:
- Commit Command: Reads
git diff, sends to Copilot CLI with conventional commit format instructions - PR Command: Analyzes commits since branch point, generates structured PR description
- Branch Command: Fetches GitHub issue or uses description, generates semantic branch name
Quota Handling
When your premium request quota is exceeded, DevFlow automatically:
- Detects the quota error from the Copilot CLI
- Retries the request with a free model (
gpt-4.1) at no cost - Suggests switching your default model via
devflow config setup
If the free model also fails, DevFlow falls back to intelligent rule-based generation.
🎨 AI Model Selection
During setup, models are fetched dynamically from the Copilot CLI — no hardcoded list. Each model is shown with its cost tier, sorted cheapest-first:
| Tier | Examples | Cost |
| ------------- | ---------------------------------------- | ------------------- |
| Free | gpt-4.1, gpt-5-mini | No premium requests |
| Cheap | claude-haiku-4.5, gpt-5.1-codex-mini | 0.33x per prompt |
| Balanced | claude-sonnet-4.5, gpt-5.1-codex | 1x per prompt |
| Expensive | claude-opus-4.5 | 3x per prompt |
As GitHub adds or removes models, DevFlow automatically reflects the changes.
🔐 Security
- GitHub tokens stored in
~/.devflow/config.jsonwith 600 file permissions (owner-only) - Tokens are never displayed in config output, error messages, or logs
- Sensitive config keys are redacted in
config getandconfig setoutput - Error messages are sanitized to prevent leaking auth headers or request details
- No
.envfile required — config setup is the single source of truth - Environment variables (
GITHUB_TOKEN,GH_TOKEN) supported as fallback for CI
📝 Requirements
- Node.js 18+
- Git
- GitHub Copilot CLI (
npm install -g @githubnext/github-copilot-cli) - GitHub account with Copilot access
Future Enhancements
- [ ] Ollama fallback for offline/quota-exceeded scenarios
- [ ] Custom prompt templates
- [ ] Team collaboration features
🤝 Contributing
Contributions welcome! This project was built for the GitHub Copilot CLI Challenge.
📄 License
MIT
🙏 Acknowledgments
Built with ❤️ using:
Made for the GitHub Copilot CLI Challenge 2026 🚀
