LinuxCommandLibrary

hub-issue

Create GitHub issues from the command line

TLDR

List the last 10 issues with the bug label

$ hub issue list [[-L|--limit]] [10] [[-l|--labels]] "[bug]"
copy

Display a specific issue
$ hub issue show [issue_number]
copy

List 10 closed issues assigneed to a specific user
$ hub issue [[-s|--state]] [closed] [[-a|--assignee]] [username] --limit [10]
copy

SYNOPSIS

hub issue {create|list|show|update} [options] [issue-number]

PARAMETERS

-a, --assignee <user>
    Filter or assign to specific user (create/list)

-b, --base <branch>
    Filter by base branch (list)

-c, --comments
    Include comments in output (show)

-f, --format <fmt>
    Custom output format string (list/show)

-F, --file <file>
    Read body message from file (create)

-h, --head <branch>
    Filter by head branch (list)

-i, --edit
    Interactively edit issue body in $EDITOR (create)

-l, --label(s) <label[,label..]>
    Add or filter by labels (create/list)

-L, --limit <N>
    Limit number of results (list)

-m, --message <text>
    Issue body message (create)

-M, --milestone <number>
    Assign to milestone (create)

-o, --open
    Show only open issues (list)

-s, --state <open|closed>
    Filter by issue state (list)

-u, --url
    Print URL only (show)

-w, --browse
    Open issue in web browser (create/show)

--close
    Close the issue (update)

--include-prs
    Include pull requests in listings (list)

DESCRIPTION

The hub issue command is a subcommand of hub, an open-source wrapper around git that adds GitHub integration. It enables seamless management of GitHub issues directly from the terminal, ideal for developers preferring CLI workflows.

Primary operations include:
Listing issues with filters for assignee, labels, state (open/closed), branches, and limits.
Creating new issues with titles, bodies from files or stdin, labels, assignees, and milestones.
Showing detailed views of specific issues, including comments.

Hub authenticates using stored GitHub tokens (hub auth login) or environment variables like GITHUB_TOKEN. It assumes the current git repo is linked to a GitHub remote. Commands interact with the repository's default remote (origin).

For instance, hub issue list -l bug -o displays open issues labeled 'bug'. This tool boosts productivity by avoiding browser context switches, supporting formats like JSON for scripting.

Hub issue distinguishes issues from pull requests (hub pr handles PRs), though --include-prs can blend them in listings.

CAVEATS

Hub is unmaintained since 2021; GitHub recommends gh CLI. May break with API changes. Requires git repo with GitHub remote and authentication.

AUTHENTICATION

Setup via hub auth login or GITHUB_TOKEN env var.
Supports 2FA.

EXAMPLES

hub issue create -m "Fix crash" -l bug -a user
hub issue list -o -l enhancement -L 10
hub issue show 123 -c

HISTORY

Developed by Miroslav Bajtoš (@mislav) starting 2011. hub issue added in v1.0 (2012) for issue tracking. Peaked at v2.14 (2018); archived 2021 favoring official gh. Widely used pre-gh era.

SEE ALSO

hub(1), gh(1), git(1)

Copied to clipboard