Gong
A command-line tool for seamless Git and issue tracker integration
[](https://github.com/KensoDev/gong/actions) [](https://goreportcard.com/report/github.com/KensoDev/gong) [](LICENSE) [](go.mod) [](https://github.com/KensoDev/gong/releases)Table of Contents
Overview
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
Quick Start
# 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)"
Installation
Pre-built Binaries
Download the latest release from GitHub Releases for your platform:
- macOS (Darwin)
- Linux
- Windows (community tested)
Place the binary in your PATH and make it executable:
# Example for macOS/Linux
chmod +x gong
sudo mv gong /usr/local/bin/
From Source
go install github.com/KensoDev/gong/cmd/gong@latest
Using Homebrew (macOS/Linux)
# Coming soon
brew install gong
Supported Issue Trackers
| 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.
Commands
gong login - Authenticate with JIRA
Before 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):
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Create a new API token
- Use the token as your password when logging in
gong start - Start Working on Existing Issue
Start 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:
- Fetches the issue title from JIRA
- Creates a branch:
{type}/{issue-id}-{slugified-title} - Transitions the issue to βstartedβ state (based on your configured transitions)
- Checks out the new branch
- 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_TYPEenvironment variable
- Common types:
gong browse - Open Issue in Browser
Opens 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 Pipe
Add 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 β¨ NEW
Automatically install git hooks that add JIRA ticket links to every commit.
gong install-hooks
What it does:
- Installs
prepare-commit-msghook 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-message
This 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 β¨ NEW
Create JIRA issues directly from your terminal with an interactive TUI.
gong create <PROJECT-KEY>
Example:
gong create OPS
Interactive Workflow:
- Select Issue Type: Choose from Bug, Story, Task, Epic, etc.
- Enter Summary: One-line title for the issue
- Add Description: Press Enter to open your editor (
$EDITORor vim) for multi-line descriptions - Issue Created: JIRA issue created automatically
- Branch Created: Git branch created and checked out with format
{type}/{ISSUE-ID}-{slugified-title} - 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)
Complete Workflows
Workflow 1: Create New Issue from Scratch
# 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
Workflow 2: Work on Existing Issue
# 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"
Workflow 3: Bug Fix Workflow
# 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
Configuration
Environment Variables
GONG_DEFAULT_BRANCH_TYPE: Set default branch typeexport GONG_DEFAULT_BRANCH_TYPE=featureEDITOR: Set your preferred editor for multi-line descriptionsexport EDITOR=nvim # or vim, nano, code --wait, etc.
Config File Location
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.
Issues/Feedback
If you have any issues, please open one here on Github or reach out on Twitter @avi_zurel
Development
Building from Source
# 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
Contributing
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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Project Structure
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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Original author: Avi Zurel
- Inspired by the need for seamless Git and issue tracker workflows
Changelog
2.0.0 (2026) - Major Release β¨
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βfeature, etc.)
- π Automatic Git Hook Installation:
gong install-hookscommand- Automatically prompted on first
gong createorgong start - Smart installation: appends to existing hooks instead of replacing
- Auto-links every commit to JIRA ticket
- Automatically prompted on first
- π Enhanced Documentation: Complete workflow examples and configuration guide
- β Comprehensive Test Suite: 27 tests covering all new functionality
Breaking Changes:
gong createnow requires a project key argument and creates issues interactively (previously opened browser)
Bug Fixes:
- Fixed issue ID extraction from branch names with various formats
- Improved error messages with detailed JIRA API responses
Internal:
- Added
hooks.gofor git hook management - Added
jira_create_test.go,hooks_test.go,integration_test.go - Updated CLI interface to support new create workflow
1.7.0 (2025)
- BREAKING: Removed Pivotal Tracker support (Pivotal Tracker has been discontinued)
- Modernized Go tooling (Go 1.23)
- Replaced deprecated
ioutilpackage - Added GitHub Actions CI/CD
- Added Makefile for build automation
- Improved README with badges and better structure
- Added new logo and branding
- Migrated from Travis CI to GitHub Actions
- Changed default branch from
mastertomain
1.6.0
- Added transitions to the config and outputting the transitions to stdout
1.3.4
- Added
createcommand to open browser on create ticket URL
Support
- Issues: GitHub Issues
- Twitter: @avi_zurel

