Absolutely — let’s button this up and ship v1. Below is a full, updated README.md you can drop in, plus a copy-paste command sequence to create the GitHub repo, push the code, and publish a v0.1.0 release.
# GitHub Issues Exporter
Export issues from repositories you can access into a tidy `.txt`, plus `.jsonl` for automation.
- Official **GitHub REST API** (no scraping).
- **Token discovery**: `--token` → `GITHUB_TOKEN` → `.secrets` → `gh auth token`.
- **Filters**: `--since`, `--assignee`, `--creator`, `--labels`, `--milestone`, `--state`.
- **Scopes**: owner/org scoping, or target a **single repo** with `--repo`.
- **Cross-repo “my issues”** (`--my-issues`) via `GET /issues`.
- **Output**: TXT + JSONL (disable JSONL with `--no-jsonl`).
- GitHub Enterprise via `--api-base`.
## Install (editable)
```bash
pip install -e .Create a .secrets in repo root (ignored by Git):
GITHUB_TOKEN=ghp_your_token_hereOr export it:
export GITHUB_TOKEN=ghp_your_token_hereIf neither is set and you use GitHub CLI, we’ll try:
gh auth tokenAll accessible repos:
gh-issues-exportOnly your user’s repos:
gh-issues-export --owner your-loginOnly a specific org:
gh-issues-export --org my-orgA single repo (recommended for precision):
gh-issues-export --owner my-login --repo my-repo
# or
gh-issues-export --org my-org --repo my-repoInclude PRs too:
gh-issues-export --include-prsFilter examples:
gh-issues-export --since 2025-01-01 --labels bug,priority:high --assignee your-loginCross-repo “my issues”:
gh-issues-export --my-issues --my-filter assigned --state open --since 2025-01-01GitHub Enterprise:
gh-issues-export --api-base https://github.mycompany.com/api/v3Pick output path:
gh-issues-export --outfile my_issues.txtLogging and behavior:
gh-issues-export --verbose
gh-issues-export --continue-on-error
gh-issues-export --no-jsonlExport a single public repo (this project’s author thenarfer / cloud-starter example):
gh-issues-export --owner thenarfer --repo cloud-starter --state all --outfile cloud_starter_issues.txtThis repo ships a sitecustomize.py that sets PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 so pytest won’t auto-load unrelated global plugins.
# Recommended: isolated env
python -m venv .venv && source .venv/bin/activate
pip install -e .[dev]
pytest(Alternatively: PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest)
Use a fine-grained PAT with:
- Issues: Read
- Metadata / Repository: Read
(For private/org repos, you may also need org-level access; classic PAT with
reporead works too.)