Automate Git branch creation and commits from Jira tickets. No more copy-pasting ticket IDs.
npm install -g jira-git-cliIf you want to test this repo locally as the jg command:
# from this repository
npm install
npm run build
npm linkThen you can run:
jg --helpTo remove the global link later:
npm unlink -g jira-git-cliRun the interactive setup wizard:
jg configIt will ask for:
- Jira base URL — e.g.
https://your-org.atlassian.net - Jira email — your Atlassian account email
- API token — generate one at id.atlassian.com/manage-profile/security/api-tokens
Alternatively, set environment variables
JIRA_BASE_URL,JIRA_EMAIL, andJIRA_API_TOKEN. Env vars take precedence over stored config.
# Interactive picker — shows your assigned tickets
jg start
# Direct — create branch from a specific ticket
jg start PROJ-123Creates a branch like feature/PROJ-123-ticket-title-sanitized and sets up a commit template.
# Interactive — prompts for message, pre-fills ticket summary
jg commit
# Direct — quick commit
jg commit "added input validation"
# → PROJ-123: added input validationThe ticket ID is auto-detected from the branch name.
jg push# Default message: "Done"
jg done
# Custom message
jg done "finished auth flow"jg list# Setup wizard
jg config
# Reset stored credentials
jg config --reset| Command | Alias | Description |
|---|---|---|
jg start [ticket] |
Pick a ticket → create branch | |
jg commit [message] |
jg ci |
Commit with ticket prefix |
jg push |
Push + set upstream | |
jg done [message] |
Commit + push | |
jg list |
jg ls |
List open tickets |
jg config |
Setup credentials |
jg startfetches your assigned Jira tickets via the API and lets you pick one- It creates a branch named
feature/PROJ-123-sanitized-title jg commitdetects the ticket ID from the branch name and prefixes your commit messagejg donestages all changes, commits, and pushes in one command
- Node.js 18+
- Git
MIT