Metadata-Version: 2.3
Name: cac-jira
Version: 0.3.2
Summary: A command-line interface for interacting with Jira
License: MIT
Keywords: jira,cli,atlassian,project-management,command-lint,python,cli-tool
Author: Ryan Punt
Author-email: ryan@mirum.org
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: argcomplete (>=3.6.2,<4.0.0)
Requires-Dist: cac-core (>=0.2.0,<1.0.0)
Requires-Dist: jira (>=3.8.0,<4.0.0)
Requires-Dist: keyring (>=25.5.0,<26.0.0)
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
Project-URL: Homepage, https://mirum.org/cac-jira/
Project-URL: Repository, https://github.com/rpunt/cac-jira
Description-Content-Type: text/markdown

# Jira CLI

A command-line interface for interacting with Jira.

## Installation

This project uses [Poetry](https://python-poetry.org/) for dependency management.

### Steps to Install

```bash
pip install cac-jira
```

## Configuration

Create a configuration file at `~/.config/cac_jira/config.yaml`:

```yaml
server: https://your-jira-instance.atlassian.net
project: YOUR_PROJECT_KEY  # Optional default project
username: your.email@example.com
```

## Usage

The Jira CLI follows a command-action pattern for all operations:

```bash
jira <command> <action> [options]
```

### Global Options

- `--verbose`: Enable debug output
- `--output [table|json]`: Control output format (default table)
- `--help`: Show command help
<!-- --suppress-output: Hide command output -->
<!-- --version: Display version information -->

### Examples

#### Issue Commands

List issues in a project:

```bash
jira issue list --project PROJ
```

List issues with additional filtering:

```bash
jira issue list --project PROJ
```

Create a new issue:

```bash
jira issue create --project PROJ --type Task --title "Fix login bug" --description "Users can't log in"
```

Create and assign to yourself:

```bash
jira issue create --project PROJ --type Bug --title "Server crash" --assign
```

Create and immediately start work:

```bash
jira issue create --project PROJ --type Story --title "Add login feature" --begin
```

Add an issue to an epic:

```bash
jira issue create --project PROJ --type Task --title "Subtask" --epic PROJ-100
```

Label an issue:

```bash
jira issue label --issue ISSUE_KEY --labels label1,label2
```

Transition an issue:

```bash
jira issue begin --issue ISSUE_KEY    # Start work
jira issue close --issue ISSUE_KEY    # Mark as complete
```

#### Project Commands

List all projects:

```bash
jira project list
```

Show a project:

```bash
jira project show --name PROJ-123
```

#### Advanced Examples

Update an issue's title or description:

```bash
jira issue update --issue ISSUE_KEY --title "New issue title" --description "new issue description"
```

Add a comment to an issue:

```bash
jira issue comment --issue ISSUE_KEY --comment "This is a comment."
```

List all issue IDs matching a label:

```bash
jira issue list --output json | jq -r '.[] | select(.Labels | contains("production")) | .ID'
```

## Development

### Setup Development Environment

```bash
# Install dependencies including dev dependencies
poetry install

# Run tests
poetry run pytest
```

Please note that tests are still WIP

### Project Structure

- `cac_jira/commands/` - Command implementations
  - `issue/` - Issue-related commands
  - `project/` - Project-related commands
- `cac_jira/cli/` - CLI entry point and argument parsing

### Adding New Commands

1. Create a new action module in the appropriate command directory.
2. Define a class that inherits from the command's base class.
3. Implement `define_arguments()` and `execute()` methods.

