Metadata-Version: 2.4
Name: gh-claude
Version: 0.2.7
Summary: A modern multi-repository GitHub TUI with Claude Code integration
Author: Masa
License-Expression: MIT
Project-URL: Homepage, https://github.com/masaaaaa725/ghc
Project-URL: Repository, https://github.com/masaaaaa725/ghc
Project-URL: Issues, https://github.com/masaaaaa725/ghc/issues
Keywords: github,gh,claude,textual,tui
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: textual>=8.2.8
Dynamic: license-file

# gh-claude

A modern, keyboard-first TUI for managing GitHub issues and pull requests across
multiple repositories. It uses [Textual](https://textual.textualize.io/) for the
interface, GitHub CLI for data, and Claude Code for issue drafting and analysis.

License: [MIT](LICENSE)

PyPI: [`gh-claude`](https://pypi.org/project/gh-claude/)  
Repository: [`masaaaaa725/ghc`](https://github.com/masaaaaa725/ghc)

## Requirements

- Python 3.13+
- [uv](https://docs.astral.sh/uv/) or pip
- [GitHub CLI](https://cli.github.com/) (`gh auth login`)
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
- Git

## Install

```bash
pip install gh-claude
# or
uv tool install gh-claude
```

Update an existing `uv tool` install:

```bash
uv tool upgrade gh-claude
```

## Publishing

Every push to `main` runs [`.github/workflows/publish.yml`](.github/workflows/publish.yml),
which bumps the patch version in `pyproject.toml`, publishes that version to PyPI,
and commits the bump back to `main` (with `[skip ci]` to avoid a loop).

One-time setup on PyPI (Trusted Publishing):

1. Open [PyPI publishing settings for gh-claude](https://pypi.org/manage/project/gh-claude/settings/publishing/)
2. Add a GitHub publisher:
   - Owner: `masaaaaa725`
   - Repository: `ghc`
   - Workflow: `publish.yml`
   - Environment: `pypi`
3. In GitHub, create an Environment named `pypi` (Settings → Environments)

After that, merges to `main` publish automatically. Users can then run
`uv tool upgrade gh-claude`.

## Run

```bash
gh-claude
# alias
ghc
```

From a local checkout:

```bash
uv sync
uv run gh-claude
```

The app detects the GitHub repository in the current directory. Press `r` or
`Ctrl+P` to switch to any repository returned by `gh repo list`.

## Keyboard shortcuts

- `↑` / `↓`: move the selection in the Issues or Pull Requests list
- `←` / `→`: switch between the Issues and Pull Requests tabs
- `f`: cycle the status filter (`OPEN` → `CLOSED` → `ALL` for Issues; includes `MERGED` / `DRAFT` for PRs)
- `r` / `Ctrl+P`: searchable repository picker (`↑`/`↓` to move, `Enter` to select, `Esc` to cancel)
- `c`: turn rough notes into a reviewed GitHub issue with Claude
- `s`: summarize the selected issue or pull request with Claude
- `o`: check out the selected pull request as a local branch
- `v`: review the selected pull request diff with Claude
- `a`: draft, preview, and post an AI-polished comment
- `Ctrl+E`: create an Issue branch and let Claude implement the selected Issue
- `i` / `p`: switch to Issues / Pull Requests
- `Ctrl+R` / `F5`: refresh Issues and Pull Requests for the current repository
- `Ctrl+C`: quit

## Project layout

```text
.
├── pyproject.toml
├── uv.lock
├── src/                # Import package `ghc` (PyPI name: `gh-claude`)
│   ├── __init__.py
│   ├── __main__.py
│   ├── app.py          # Main Textual app and interactions
│   ├── app.tcss        # Dark UI theme
│   ├── clients.py      # Async gh / claude / git wrappers
│   ├── models.py       # Domain models
│   └── screens.py      # Repository and issue workflow modals
└── tests/
    ├── test_app.py
    ├── test_clients.py
    ├── test_models.py
    └── test_screens.py
```

All external commands are executed without a shell via
`asyncio.create_subprocess_exec`. GitHub read operations request JSON explicitly;
commands such as `gh pr diff`, `gh pr checkout`, `gh issue create`, and
`gh issue comment` are exceptions because those GitHub CLI commands do not
support `--json`.

`Ctrl+E` is intentionally limited to the repository currently checked out on
disk. After confirmation, it creates `issue-<number>-<slug>` with
`git checkout -b`, then runs Claude Code in print mode. Claude is instructed not
to commit, push, or modify unrelated files; always review the working tree after
it finishes.

## Test

```bash
uv run pytest
```
