Metadata-Version: 2.4
Name: jitly
Version: 0.1.3
Summary: Bridge between Jira tickets and your local development workflow
Author: Jitly
License: MIT
Keywords: jira,git,developer-tools,workflow
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Version Control
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: typer[all]>=0.12.0
Requires-Dist: rich>=13.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: gitpython>=3.1.40
Requires-Dist: keyring>=25.0.0
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: requests>=2.31.0
Requires-Dist: requests-oauthlib>=1.3.1
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: click>=8.1.0
Requires-Dist: questionary>=2.0.1
Requires-Dist: platformdirs>=4.2.0

# ⚡ Jitly

**Bridge between Jira tickets and your local Git workflow.**

Stop switching between Jira, terminal, and GitHub. Jitly connects them all — one command to start a ticket, one command to finish it.

```bash
jitly start ABC-123   # pulls base, creates branch, moves ticket → In Progress
jitly done            # commits, pushes, moves ticket → Done
```

---

## Why Jitly?

Every developer has done this manually:

1. Open Jira → find ticket → copy ticket ID
2. `git checkout main && git pull`
3. `git checkout -b feature/ABC-123-some-long-name`
4. Do the work...
5. `git add . && git commit -m "ABC-123: did the thing"`
6. `git push --set-upstream origin feature/ABC-123-some-long-name`
7. Go back to Jira → move ticket to Done

**Jitly automates all of this.** You define your team's policies once (branch naming, base branch, commit format) and Jitly enforces them automatically — for every developer on the team.

---

## Installation

```bash
pip install jitly
```

Works on **macOS**, **Windows**, and **Linux** with Python 3.9+.

---

## Quick Start

### Step 1 — Login to Jira

```bash
jitly auth login
```

Choose how you want to authenticate:

| Method | Best for |
|---|---|
| SSO / OAuth2 (browser) | Jira Cloud with SSO |
| API Token | Jira Cloud (email + token) |
| PAT / Password | Jira Server or Data Center |

### Step 2 — Link your repo

Inside your git project:

```bash
jitly init
```

Connects the repo to a Jira project. Saves config to `.jitly.yaml`.

### Step 3 — Set your workflow policy

```bash
jitly policy setup
```

Answer a few questions — set once, applies forever:

```
? Base branch to pull from:          main
? Branch name template:              feature/{ticket_lower}-{desc}
? Auto-pull base before branching?   Yes
? Commit message template:           {ticket}: {desc}
```

### Step 4 — Start a ticket

```bash
jitly start ABC-123
```

Jitly will:
- ✅ Fetch ticket details from Jira
- ✅ Handle uncommitted changes (stash / push / cancel — your choice)
- ✅ Pull latest from base branch
- ✅ Create `feature/abc-123-your-ticket-title`
- ✅ Move ticket to **In Progress** on Jira

### Step 5 — Finish the ticket

```bash
jitly done
```

Jitly will:
- ✅ Commit all changes (auto-fills message from ticket)
- ✅ Push to remote
- ✅ Move ticket to **Done / In Review / Ready for QA**

---

## Branch Name Templates

Customize how branches are named using tokens:

| Token | Output |
|---|---|
| `{ticket}` | `ABC-123` |
| `{ticket_lower}` | `abc-123` |
| `{desc}` | `add-login-page` (slugified summary) |

**Examples:**

```
feature/{ticket_lower}-{desc}   →   feature/abc-123-add-login-page
{ticket}/{desc}                 →   ABC-123/add-login-page
bugfix/{ticket_lower}           →   bugfix/abc-123
```

---

## Commit Message Templates

| Token | Value |
|---|---|
| `{ticket}` | Jira ticket ID |
| `{desc}` | Ticket summary |
| `{message}` | What you type at prompt |

**Examples:**

```
{ticket}: {desc}            →   ABC-123: Add login page
[{ticket}] {message}        →   [ABC-123] fixed null pointer issue
feat({ticket}): {desc}      →   feat(ABC-123): Add login page
```

---

## Smart Branch Detection

If someone already started working on `ABC-123` and pushed a branch — Jitly detects it automatically:

```
Branch feature/abc-123-add-login already exists on remote.
Someone may have already started this ticket. Fetching their work...
✓ Checked out existing branch feature/abc-123-add-login
```

No manual `git fetch` or `git checkout` needed. Continue right where they left off.

---

## Uncommitted Changes Handling

Run `jitly start` while you have unsaved work? Jitly asks:

```
? You have uncommitted changes on feature/old-branch. What would you like to do?
  > stash — save changes and continue to new ticket
    push  — commit & push current changes first
    cancel — abort
```

---

## All Commands

```
jitly auth login        Login to Jira (SSO, API token, or PAT)
jitly auth logout       Remove saved credentials
jitly auth whoami       Show currently logged in user

jitly init              Link this repo to a Jira project

jitly policy setup      Interactive policy wizard
jitly policy show       View current policy
jitly policy set        Set a single policy value

jitly start <TICKET>    Start working on a Jira ticket
jitly done              Commit, push, and wrap up current ticket
jitly status            Show active ticket, branch, and git state
```

---

## Supported Jira Versions

| Version | Auth Method |
|---|---|
| Jira Cloud | SSO / OAuth2, API Token |
| Jira Server | PAT, Username + Password |
| Jira Data Center | PAT, Username + Password |

---

## Configuration

Jitly stores your global config at `~/.config/jitly/config.yaml`.

Per-project config is saved in `.jitly.yaml` (add to `.gitignore` if it contains sensitive info).

Environment variables:

| Variable | Default | Description |
|---|---|---|
| `JITLY_OAUTH_CLIENT_ID` | — | Atlassian OAuth2 client ID |
| `JITLY_OAUTH_CLIENT_SECRET` | — | Atlassian OAuth2 client secret |
| `JITLY_OAUTH_PORT` | `8727` | Local port for OAuth callback |
| `JITLY_BACKEND_URL` | `https://p01--jitly--m27kcmkbzyf2.code.run` | Jitly backend URL |

---

## Requirements

- Python 3.9+
- Git

---

## Links

- [Privacy Policy](https://p01--jitly--m27kcmkbzyf2.code.run/privacy)
- [Terms of Service](https://p01--jitly--m27kcmkbzyf2.code.run/terms)
- [Support](https://p01--jitly--m27kcmkbzyf2.code.run/support)
- [Report an Issue](https://github.com/guptayush02/jitly/issues)

---

## License

MIT
