Skip to content

A PHP CLI tool to list Jira issues from the terminal, using JQL queries to filter and display results.

License

Notifications You must be signed in to change notification settings

oguzhanT/jira-cli

Repository files navigation

Jira CLI Tool

Jira CLI Platform

A powerful, easy-to-use CLI tool for interacting with Jira, making it simple to manage issues, track worklogs, and automate common tasks right from your terminal. Perfect for developers and project managers who want to streamline their Jira workflows.

Features

  • View, create, edit, assign, and delete Jira issues
  • Track daily, weekly or monthly worklogs with detailed or summarized views
  • Retrieve user details and set environment configurations automatically

Supported Platforms

Platform Supported Notes
macOS Requires PHP installed
Linux Requires PHP installed
Windows Requires PHP installed

Installation

  1. Clone the repository:

    git clone https://github.com/oguzhanT/jira-cli.git
    cd jira-cli
  2. Install dependencies:

    composer install
  3. Configure your environment:

    • Copy the .env.example file to .env and fill in your Jira details:
    JIRA_SERVER=https://your-jira-instance.atlassian.net
    [email protected]
    JIRA_API_TOKEN=your-jira-api-token
    
  4. Set up account ID:

    • Run the following command to automatically set your JIRA_ACCOUNT_ID in .env:
    php bin/jira-cli configure-account-id

Commands

Issue Management

View Issue Details

Display details for a specific issue by key.

php bin/jira-cli show-issue --issueKey=ISSUE-123

Create a New Issue

Interactively create a new issue in Jira.

php bin/jira-cli create-issue

You will be prompted for details such as project, summary, description, issue type, and priority.

Edit an Issue

Edit details of an existing issue.

php bin/jira-cli edit-issue --issueKey=ISSUE-123

Provides prompts for modifying fields like summary, description, assignee, issue type, and priority.

Assign an Issue

Assign an issue to a user by account ID.

php bin/jira-cli assign-issue --issueKey=ISSUE-123 --assignee=account_id

Alternatively, use --projectKey to choose from a list of assignable users.

Delete an Issue

Delete a specified issue.

php bin/jira-cli delete-issue --issueKey=ISSUE-123

Worklog Tracking

Show Worklog Summary

View the total time logged for a specified period (daily, weekly, biweekly, monthly).

php bin/jira-cli show-work-log --accountId=your_account_id --period=weekly

Show Detailed Worklog by Issue

Get a breakdown of worklogs by issue for each day.

php bin/jira-cli show-work-log --accountId=your_account_id --period=monthly --detailed

User Management

Configure Account ID

Automatically fetch and set your Jira accountId in the .env file.

php bin/jira-cli configure-account-id

Show User Details

Retrieve details for the authenticated user.

php bin/jira-cli show-user-detail

Example Workflows

  1. Set up and View Your User Details:

    php bin/jira-cli configure-account-id
    php bin/jira-cli show-user-detail
  2. Log and Track Work:

    php bin/jira-cli create-issue
    php bin/jira-cli assign-issue --issueKey=ISSUE-123 --assignee=account_id
    php bin/jira-cli show-work-log --accountId=your_account_id --period=daily --detailed

Contribution

If you’d like to contribute to this project:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m "Add a new feature").
  4. Push to the branch (git push origin feature-branch).
  5. Create a pull request.

License

This project is licensed under the MIT License.

Sponsor on GitHub

About

A PHP CLI tool to list Jira issues from the terminal, using JQL queries to filter and display results.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages