A command-line tool for seamless Git and issue tracker integration
Gong is a CLI tool that bridges the gap between issue trackers and Git workflows. Stay in your terminal and maintain your development flow while working with Jira and other project management tools.
Key Features:
- 🎯 Create issues interactively with a minimal TUI - no browser needed
- 🌿 Auto-create Git branches with proper naming conventions (feature/PROJ-123-issue-title)
- 🔗 Auto-link commits to issues with intelligent git hook installation
- 🚀 Transition issues to "started" state automatically
- 💬 Comment on issues via stdin pipes (perfect for sending diffs or file contents)
- 🌐 Browse issues in your default browser from the command line
- ✏️ Multi-line descriptions using your preferred editor
# 1. Install gong
go install github.com/KensoDev/gong/cmd/gong@latest
# 2. Login to your JIRA instance
gong login jira
# 3. Create a new issue interactively
gong create OPS
# - Select issue type (Bug, Story, Task, etc.)
# - Enter summary
# - Add description (opens your editor)
# - Branch created automatically!
# 4. All your commits will now include the JIRA ticket link!
git commit -m "Implement new feature"
# Result: "Implement new feature\n\n[OPS-123](https://your-jira.com/browse/OPS-123)"
Download the latest release from GitHub Releases for your platform:
Place the binary in your PATH and make it executable:
# Example for macOS/Linux
chmod +x gong
sudo mv gong /usr/local/bin/
go install github.com/KensoDev/gong/cmd/gong@latest
# Coming soon
brew install gong
| Tracker | Status | Notes |
|---|---|---|
| Jira | ✅ Full support | Username/password or API token |
Want to add support for another tracker? Contributions are welcome! The codebase uses a generic Client interface that makes adding new trackers straightforward.
gong login - Authenticate with JIRABefore using gong, you need to authenticate with your JIRA instance.
gong login jira
You'll be prompted for:
- Username: Your JIRA username or email
- Domain: Your JIRA instance (e.g., yourcompany.atlassian.net)
- Password: Your password or API token (recommended)
- Project Prefix: Default project key prefix (optional)
- Transitions: Comma-separated list of allowed issue transitions (e.g., In Progress,Started)
Using API Tokens (Recommended): 1. Go to https://id.atlassian.com/manage-profile/security/api-tokens 2. Create a new API token 3. Use the token as your password when logging in
gong start - Start Working on Existing IssueStart working on an existing JIRA issue.
gong start <ISSUE-ID> [--type <branch-type>]
Examples:
# Start working on a story/task (default: feature)
gong start PROJ-123
# Start working on a bug
gong start PROJ-456 --type bugfix
# Start working with custom branch type
gong start PROJ-789 --type hotfix
What it does:
1. Fetches the issue title from JIRA
2. Creates a branch: {type}/{issue-id}-{slugified-title}
3. Transitions the issue to "started" state (based on your configured transitions)
4. Checks out the new branch
5. Prompts to install git hooks (first time only)
Example:
gong start OPS-123 --type feature
# Creates branch: feature/OPS-123-implement-user-authentication
# Transitions OPS-123 to "In Progress"
# Checks out the branch
Flags:
- --type: Branch type prefix (default: feature)
- Common types: feature, bugfix, hotfix, chore, docs
- Or set GONG_DEFAULT_BRANCH_TYPE environment variable
gong browse - Open Issue in BrowserOpens the current issue in your default browser.
gong browse
What it does: - Extracts the JIRA ticket ID from your current branch name - Opens the issue in your default browser
Example:
# On branch: feature/OPS-123-new-feature
gong browse
# Opens: https://your-jira.atlassian.net/browse/OPS-123
gong comment - Add Comments via PipeAdd comments to the current issue by piping content through stdin.
<command> | gong comment
Why a pipe? This design allows you to send any output directly to JIRA comments: - Git diffs - File contents - Command outputs - Vim buffers - Test results
Examples:
# Send a simple message
echo "Fixed the authentication bug" | gong comment
# Send git diff
git diff | gong comment
# Send file contents
cat error.log | gong comment
# Send test results
npm test | gong comment
# From vim: select lines and run
:'<,'>!gong comment
What it does: - Extracts ticket ID from current branch name - Posts the piped content as a comment to the JIRA issue - Preserves formatting (great for code snippets and logs)
](https://asciinema.org/a/d0rcjavbv55lbq1xpsrqiyyu6)
gong install-hooks - Auto-Link Commits to Issues ✨ NEWAutomatically install git hooks that add JIRA ticket links to every commit.
gong install-hooks
What it does:
- Installs prepare-commit-msg hook in .git/hooks/
- Automatically extracts ticket ID from branch name
- Adds JIRA link to every commit message
- Smart installation: Appends to existing hooks instead of replacing them
Automatic Installation:
When you run gong create or gong start for the first time in a repo, you'll be prompted:
Git hook not installed. Install prepare-commit-msg hook to auto-add ticket IDs to commits? (y/n)
Example:
# On branch: feature/OPS-123-new-feature
git commit -m "Implement authentication"
# Commit message becomes:
# Implement authentication
#
# [OPS-123](https://your-jira.atlassian.net/browse/OPS-123)
Manual Installation (Alternative):
curl https://raw.githubusercontent.com/KensoDev/gong/main/git-hooks/prepare-commit-msg > .git/hooks/prepare-commit-msg
chmod +x .git/hooks/prepare-commit-msg
Note: If you already have a prepare-commit-msg hook, gong will append its logic to preserve your existing hooks.
gong prepare-commit-messageThis command is used internally by the git hook. You typically don't need to run it directly.
It extracts the JIRA ticket ID from your branch name and formats it as a markdown link.
gong create - Create Issues Interactively ✨ NEWCreate JIRA issues directly from your terminal with an interactive TUI.
gong create <PROJECT-KEY>
Example:
gong create OPS
Interactive Workflow:
1. Select Issue Type: Choose from Bug, Story, Task, Epic, etc.
2. Enter Summary: One-line title for the issue
3. Add Description: Press Enter to open your editor ($EDITOR or vim) for multi-line descriptions
4. Issue Created: JIRA issue created automatically
5. Branch Created: Git branch created and checked out with format {type}/{ISSUE-ID}-{slugified-title}
6. Git Hook Installed: On first use, prompts to install commit hooks for auto-linking
Branch Type Mapping:
- Bug/Defect → bugfix/
- Story/Task/Feature → feature/
- Epic → epic/
- Improvement/Enhancement → enhancement/
- Sub-task → task/
Example Output:
Select issue type
▸ Task
Story
Bug
Epic
Summary: Implement user authentication
Description (optional, press Enter to skip): [Opens editor]
Creating issue...
✓ Created issue: OPS-123
✓ Created and checked out branch: feature/OPS-123-implement-user-authentication
Success! Now working on branch: feature/OPS-123-implement-user-authentication
Environment Variables:
- GONG_DEFAULT_BRANCH_TYPE: Override branch type (e.g., export GONG_DEFAULT_BRANCH_TYPE=custom)
- EDITOR: Set your preferred editor for descriptions (default: vim)
# Create issue interactively
gong create OPS
# 1. Select issue type (Bug, Story, Task...)
# 2. Enter summary
# 3. Add description (opens editor)
# 4. Issue created: OPS-456
# 5. Branch created: feature/OPS-456-your-issue-title
# 6. Git hook installed (prompts on first use)
# Make changes
vim src/feature.js
# Commit (ticket link added automatically!)
git commit -m "Implement feature"
# Result: "Implement feature\n\n[OPS-456](https://jira.com/browse/OPS-456)"
# Push and create PR
git push -u origin feature/OPS-456-your-issue-title
# Start working on existing issue
gong start OPS-789
# Creates: feature/OPS-789-existing-issue-title
# Transitions: OPS-789 to "In Progress"
# Make changes
vim src/bugfix.js
# View issue in browser
gong browse
# Send diff as comment
git diff | gong comment
# Commit
git commit -m "Fix the bug"
# Create bug issue
gong create OPS
# Select: Bug
# Branch created: bugfix/OPS-999-fix-login-error
# Fix and test
vim src/auth.js
npm test
# Send test results to JIRA
npm test | gong comment
# Commit and push
git commit -m "Fix login error"
git push -u origin bugfix/OPS-999-fix-login-error
GONG_DEFAULT_BRANCH_TYPE: Set default branch type
bash
export GONG_DEFAULT_BRANCH_TYPE=feature
EDITOR: Set your preferred editor for multi-line descriptions
bash
export EDITOR=nvim # or vim, nano, code --wait, etc.
Credentials are stored in ~/.gong.json with the following structure:
{
"client": "jira",
"username": "your-email@company.com",
"password": "your-api-token",
"domain": "https://yourcompany.atlassian.net",
"project_prefix": "OPS",
"transitions": "In Progress,Started"
}
Security Note: Use JIRA API tokens instead of passwords. Never commit this file to version control.
If you have any issues, please open one here on Github or reach out on Twitter @avi_zurel
# Clone the repository
git clone https://github.com/KensoDev/gong.git
cd gong
# Build the project
make build
# Run tests
make test
# See all available commands
make help
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)gong/
├── cmd/gong/ # Main CLI application
│ └── main.go # Command definitions and routing
├── assets/ # Logo and visual assets
├── git-hooks/ # Sample Git hooks
├── client.go # Generic client interface
├── jira.go # JIRA client implementation
├── hooks.go # Git hook management (NEW)
├── slugger.go # Branch name slugification
├── client_test.go # Client interface tests
├── jira_test.go # JIRA client tests
├── jira_create_test.go # Create flow tests (NEW)
├── hooks_test.go # Hook installation tests (NEW)
├── integration_test.go # End-to-end tests (NEW)
└── slugger_test.go # Slugification tests
Test Coverage: 27 tests across 5 test suites
This project is licensed under the MIT License - see the LICENSE file for details.
New Features:
- 🎯 Interactive Issue Creation: gong create <PROJECT-KEY> now creates issues interactively with a minimal TUI
- Select issue type from available types
- Prompt for required fields only
- Multi-line description support using your default editor
- Auto-creates branch with proper naming convention
- Smart branch type mapping (Bug→bugfix, Story→featu