Jira on the command line. Reads issues, comments and attachments as plain text, so you can pipe them into anything.
Black and white output, --json on every read, stable exit codes. Every subcommand is plain and pipeable — the interactive view lives behind the bare jira command and nowhere else.
Install
npm install -g @kud/jira-cliSetup
Only the token is a secret, so only the token comes from the environment:
export ATLASSIAN_API_TOKEN=... # id.atlassian.com/manage-profile/security/api-tokens
jira init --base-url myorg.atlassian.net --email you@example.comThat writes ~/.config/jira/config.json. ATLASSIAN_BASE_URL and ATLASSIAN_USER_EMAIL override it when you need a second instance.
Attachments
The thing most Jira CLIs skip. Attachments are listed with the comment they came from, and text ones print straight to stdout:
jira attachment list ABC-123
# ID FILENAME SIZE TYPE FROM
# 292542 error.log 22.0KB text/plain comment by Ada Lovelace
# 292731 screen.png 118KB image/png description
jira attachment read ABC-123 error.log | grep -i timeout
jira attachment get ABC-123 screen.png --output ~/Desktop/
jira attachment upload ABC-123 ./build.log ./screenshot.pngDescriptions and comments render as Markdown, with embedded files named rather than left as opaque ids:
jira issue view ABC-123 --commentsThe interactive view
Run jira with no arguments:
jiraYour issues as a board. By default the tabs are Jira's three status categories — To do, In progress, Done — so it works on any instance without knowing what your board calls its columns. Pass --board <id> (or set defaultBoard in the config file) and the tabs become that board's own columns, matched by status id; statuses no column claims land on an Off board tab. Hand-written tabs in the config file win over both. Rows hang under their epic, carry a type pill, a priority glyph (▲ high, ▼ low) and how long since they last moved. Closed work from the last fortnight is on the Done tab; a loads everything.
↑↓ to move, ←→ (or ⇥) to switch tab, enter to open, ? for the legend, r to refresh. q quits from anywhere; esc or ⌫ goes back one level — a prompt, then the issue, then nothing.
/ searches. Plain words narrow the list as you type and, on enter, run as text ~ "…" within your issues — so a match in a comment counts too. Anything shaped like JQL (status = Done, labels in (a, b), ORDER BY …) is sent as-is and replaces the scope; the tag at the end of the line says which reading it took, and ⇥ flips it. A query Jira rejects shows Jira's own message under the box and keeps your text for editing. esc clears the search.
Inside an issue, ⇥ switches between description, comments and attachments — descriptions and comments render as real Markdown, and attachments are listed with the comment or description each was embedded in. t moves it, c comments, a assigns to you, o opens the browser, esc or ⌫ goes back. Writes ask before they act.
Ink is loaded only for this view, via a dynamic import, so jira issue list | grep never pays for it. Piped or redirected, bare jira prints help instead of opening a UI.
Using it alongside the Atlassian MCP
The Atlassian MCP returns an issue's fields and comments, but not the content of its attachments — it can tell you a file is there and nothing more. When the answer to a ticket is inside a screenshot, a log or a CSV, that is the gap this fills:
jira attachment list ABC-123 # what is there, and where it came from
jira attachment read ABC-123 error.log # text, straight to stdout
jira attachment get ABC-123 shot.png -o /tmp/shot.png # then open or read itUseful for agents in particular: get writes a real file, so an image can then be read and reasoned about rather than skipped.
Issues
jira issue list # yours, most recently updated first
jira issue list --status 'In Progress'
jira issue list --project ABC --sprint current
jira issue view ABC-123
jira issue view ABC-123 --fields status,assignee,issuelinks
jira issue transition ABC-123 # list what's available
jira issue transition ABC-123 'In Review' # by transition name or target status
jira issue open ABC-123Writing:
jira issue create -p ABC -t Task -s 'Fix the thing' -b 'Longer **markdown** body' --status 'In Progress'
jira issue create -p ABC -t Task -s 'A sub-task' --parent ABC-100 --link Relates:ABC-99
jira issue edit ABC-123 --summary 'Better title' --assignee me --parent ABC-100
jira issue edit ABC-123 --prepend-description '**Update:** finished QA'
jira issue assign ABC-123 me # or a name, an email, an account id, or 'none'
jira issue comment add ABC-123 - # body from stdin
jira issue comment list ABC-123
jira issue comment list ABC-123 --last 5 # the 5 most recent, oldest first
jira issue comment edit ABC-123 12345 'Actually fixed in 2.1'
jira issue delete ABC-123 # asks first; --yes to confirm in scripts
jira issue rank ABC-1 ABC-2 --before ABC-3
jira issue rank ABC-1 ABC-2 --top --jql 'project = ABC AND sprint = 42'
jira issue link ABC-1 Blocks ABC-2
jira issue link list ABC-1
jira issue watch add ABC-123
jira issue worklog add ABC-123 '2h 30m'
jira issue worklog edit ABC-123 456 --time '3h'
jira issue worklog delete ABC-123 456
jira issue remotelink list ABC-123
jira issue remotelink add ABC-123 https://example.atlassian.net/wiki/spaces/ABC/pages/1234
jira issue remotelink remove ABC-123 789
jira issue history ABC-123jira issue view lists the issue's links and subtasks, in plain text and in --json. Pass --fields status,assignee,parent,issuelinks (comma-separated) to see only those fields — both in plain text and --json; the key and summary stay either way, and without --fields the view is exactly what it has always been.
People are resolved for you. issue assign, and --assignee on create and edit, accept a name or an email: assignable users of the project are searched first, then every user. me means you, none unassigns, and a raw account id passes straight through. If a name matches several people nothing is assigned — every match is printed on stderr and the command exits non-zero, because a guess is worse than an error.
Parents and links belong to the same commands. --parent ABC-100 sets a parent on create or edit, and edit --parent none clears it. --link Relates:ABC-99 (repeatable, <type>:<KEY>) links the new issue right after creating it, exactly as jira issue link <new> <type> <KEY> would. The link type is checked against your instance's link type names before anything is created, so a typo costs nothing; if creation succeeds but a link fails, the new key and the failure are reported and the exit is non-zero.
create --status 'In Progress' moves the new issue to that status right after creation and any links. If the fresh issue already sits in that status nothing is sent, and if the move fails the key and the reason are reported with a non-zero exit, as with links.
edit --prepend-description and --append-description splice markdown onto the start or end of an existing description without touching it: the current ADF nodes are preserved and the converted markdown is added around them. Both may be combined; with --body neither is allowed. Like -b, a value of - reads stdin.
issue transition takes either a transition name or the status it leads to (Start Progress or In Progress), matched case-insensitively and by transition id. With no argument it lists the transitions as name → target status.
issue rank --top --jql <jql> ranks the keys above the first issue of the JQL scope. The JQL must order by rank (ORDER BY Rank ASC is appended when missing, and a JQL ordered any other way is refused, since its first result would not be the top). When the keys already occupy the top in rank order nothing is sent.
Bodies accept Markdown — paragraphs, headings, lists, fenced code, links and code spans are converted to ADF.
Deletes (issue delete, comment delete, worklog delete, remotelink remove) ask before they act; piped or scripted runs refuse unless --yes is passed, since there is no undo on Jira's side. remotelink add is idempotent: re-adding the same url updates the same link rather than creating duplicates.
Projects, boards and sprints
jira project list
jira project versions ABC
jira project components ABC
jira project statuses ABC
jira board list
jira board list --project ABC
jira board view 42 # columns, their statuses, and the board's filter
jira board view 42 --json
jira board issues 42
jira board backlog 42
jira board epics 42
jira epic ABC-100
jira sprint list 42 --state active
jira sprint issues 1234
jira sprint add 1234 ABC-1 ABC-2
jira backlog add ABC-1 ABC-2Knowing what this instance supports
jira whoami
jira meta issuetypes # also: priorities, statuses, resolutions, linktypes
jira meta labels
jira meta filters
jira meta permissions ABC
jira meta server
jira count 'project = ABC AND status = Done'Scripting
Every read command takes --json:
jira issue list --mine --json | jq -r '.[].key'
jira search 'project = ABC AND created >= -7d' --jsonExit codes:
| Code | Means |
|---|---|
0 | success |
1 | Jira rejected the request, or bad usage |
2 | the environment is not set up |
3 | --json result may be truncated |
4 | not authenticated |
issue list and search stop at --limit (50 by default), and Jira no longer
reports a total, so a full page is the only evidence that rows were left behind.
When one comes back, both commands warn on stderr, and with --json they also
exit 3. Stdout is untouched, so --json parses exactly as before and a caller
that ignores the exit code sees no change. The table output keeps exiting 0,
so jira issue list && … still works at a terminal.
Raise --limit to be sure you have it all.
Colour is disabled automatically when stdout is not a TTY, and when NO_COLOR is set.
Custom fields
Jira instances differ. Find yours, then name the ones you care about:
jira fields points
# ID NAME TYPE
# customfield_10784 Offshore Story Points string
# customfield_10002 Story Points number{
"baseUrl": "myorg.atlassian.net",
"email": "you@example.com",
"customFields": [{ "id": "customfield_10002", "label": "points" }],
"sprintField": "customfield_10020",
"defaultProject": "ABC"
}Named fields are requested on every search and shown in issue view.
Automation rules
jira automation list --project SHOP # --state ENABLED|DISABLED, --limit, --json
jira automation get 0192e5ac-0e25-71de-ba7b-d972e6a2049a > rule.json
jira automation update 0192e5ac-0e25-71de-ba7b-d972e6a2049a --file rule.json
jira automation create --file rule.json # prints the new rule's UUID; - reads stdin
jira automation disable 0192e5ac-0e25-71de-ba7b-d972e6a2049a
jira automation enable 0192e5ac-0e25-71de-ba7b-d972e6a2049aThese use Atlassian's Automation REST API with the same classic API token as everything else; nothing new to configure. The account behind it needs the Jira administrator global permission (Administer Jira): Jira answers a project admin with a bare 403, even for rules scoped to that project, and the CLI says so and exits 4. Project admins can still manage their project's rules in the Jira web UI.
create and update take the shape get prints, { "rule": { … } }, or a bare rule. The cloud ID is read from the site's /_edge/tenant_info; set ATLASSIAN_CLOUD_ID to skip that call. Requests go through the site's gateway by default; --host api (or ATLASSIAN_AUTOMATION_HOST=api) sends them to api.atlassian.com instead.
Escape hatch
Anything not covered:
jira api /rest/api/3/myself
jira api /rest/api/3/issue/ABC-123/watchers -X POST -d '{"accountId":"..."}'A call returning 2xx with an empty body — a 204, or a 201 with no content — prints nothing and exits 0, rather than printing the string null; that way null only ever means Jira really answered null. A non-2xx is still an error, showing the body.
Licence
MIT