jira-cli

repository·main·Indexed 24 days ago

https://github.com/ankitpokhrel/jira-cli

An interactive command-line tool for Atlassian Jira designed to improve workflows by providing issue search, navigation, creation, cloning, linking, and ticket transitions without the web UI. It supports both Jira Cloud and on-premise installations, offering features for managing epics, sprints, releases, and worklogs, as well as a --plain flag for shell scripting and data manipulation.

Tokens
14.4K
Snippets
35
Records
112
Agent score
90%

What's inside jira-cli

  1. Set up a local Jira development environment

    main
    To develop for jira-cli, you can clone the repository and optionally run a local Jira instance using the provided make recipes. Note that a trial license key from Atlassian Admin is required for the local server.
  2. Configure JiraCLI for On-Premise (Local) Installation

    main

    To use JiraCLI with a local/on-premise instance, follow these steps:

    1. Set Authentication Environment Variables:
      • Basic Auth: Export your Jira login password as JIRA_API_TOKEN.
      • Personal Access Token (PAT): Export your token as JIRA_API_TOKEN and set JIRA_AUTH_TYPE to bearer.
      • mTLS (Client Certificates): If using client certificates, set JIRA_API_TOKEN (if required) and run jira init to provide CA Cert, client Key, and client cert.
    2. Initialize Configuration: Run jira init, select Local as the installation type, and provide the required details.
  3. Configure JiraCLI for Jira Cloud

    main

    To use JiraCLI with a Cloud instance:

    1. Generate API Token: Get a Jira API token from Atlassian Security.
    2. Set Environment Variable: Export the token to your shell as JIRA_API_TOKEN. For persistence, add it to your shell configuration file (e.g., $HOME/.bashrc).
    3. Initialize Configuration: Run jira init, select Cloud as the installation type, and follow the prompts to generate your config file.
  4. Navigate the Interactive UI

    main

    JiraCLI uses an interactive UI for issue, epic, and sprint explorers. Use the following keyboard shortcuts:

    • Navigation: Arrow keys or j, k, h, l.
    • Jump to Top/Bottom: g (top) and G (bottom).
    • Scrolling: CTRL + f (down) and CTRL + b (up).
    • View/Transition: v to view issue details, m to transition the selected issue.
    • Refresh: CTRL + r or F5.
    • Open in Browser: ENTER.
    • Copying: c to copy issue URL (requires xclip/xsel on Linux), CTRL + k to copy issue key.
    • Sidebar/Content Toggle: w or TAB (in explorer view).
    • Quit: q, ESC, or CTRL + c.
    • Help: ?.
  5. Manage Multiple Jira Configurations

    main

    If you work with multiple Jira projects or instances, you can specify a custom configuration file using the JIRA_CONFIG_FILE environment variable or the --config/-c CLI flag.

    # Using the environment variable
    $ JIRA_CONFIG_FILE=./local_jira_config.yaml jira issue list
    
    # Using the --config flag
    $ jira issue list -c ./local_jira_config.yaml
    jira issue list -c ./local_jira_config.yaml
  6. Authenticate with Jira API Token

    main

    Most commands require a Jira API token. The CLI checks for authentication in the following order:

    1. Environment Variable: JIRA_API_TOKEN.
    2. .netrc file: A .netrc entry matching your Jira server and login.
    3. System Keyring: A secret stored in the system keyring under the service name jira-cli using your login as the account.

    If none of these are found, the command will fail and prompt you to provide a token. For Cloud servers, you can generate a token at https://id.atlassian.com/manage-profile/security/api-tokens.

  7. Get help and usage information for jira-cli

    main

    You can access help information for the jira CLI to understand available commands, flags, and arguments.

    To see the help for the main entry point, run:

    jira --help

    To see detailed information about a specific command or subcommand, use the --help flag with that command:

    jira <command> <subcommand> --help

    Help output includes:

    • USAGE: How to structure the command.
    • MAIN COMMANDS: Primary commands available.
    • OTHER COMMANDS: Secondary or related commands.
    • FLAGS: Local flags specific to the command.
    • INHERITED FLAGS: Flags available to all commands.
    • ARGUMENTS: Specific arguments required by the command (if defined).
    • EXAMPLES: Practical usage examples.
    • ALIASES: Alternative names for the command.

    For more information, visit the official repository: https://github.com/ankitpokhrel/jira-cli