Skip to content

feat: package as gh2gl on PyPI with gh2gl init workflow#2

Open
paladini wants to merge 2 commits into
mainfrom
feat/pypi-packaging
Open

feat: package as gh2gl on PyPI with gh2gl init workflow#2
paladini wants to merge 2 commits into
mainfrom
feat/pypi-packaging

Conversation

@paladini

Copy link
Copy Markdown
Owner

Summary

  • Adds pyproject.toml (hatchling build backend) replacing requirements.txt
  • Renames src/src/gh2gl/ as a proper installable Python package named gh2gl
  • Adds src/gh2gl/cli.py with backup (default) and init subcommands
  • gh2gl init creates a github-backup/ workspace folder in the current directory with config.yaml and .env ready to edit
  • Updates backup.py to a thin dev shim (python backup.py still works for development)
  • Updates README.md with pip install / init / run flow
  • Adds github-backup/ to .gitignore

New user flow

pip install gh2gl

gh2gl init        # creates ./github-backup/ with config.yaml and .env
cd github-backup
# edit config.yaml — set github.username and gitlab.username
# edit .env — set GITHUB_TOKEN and GITLAB_TOKEN

gh2gl --dry-run   # preview
gh2gl             # run backup

Backwards compatibility

All existing CLI flags work without a subcommand (gh2gl --dry-run, gh2gl --filter "...", etc.). Running from a directory with config.yaml and .env in place works the same as before.

Tested

  • pip install -e . installs the gh2gl entry point
  • gh2gl init creates github-backup/config.yaml and github-backup/.env
  • gh2gl --dry-run from inside the workspace listed 189 repos with correct visibility — exit code 0

Test plan

  • pip install gh2gl (once published to PyPI) installs the gh2gl command
  • pip install -e . works from the repo root (editable install)
  • gh2gl --help shows backup args and {backup,init} subcommands
  • gh2gl init creates github-backup/config.yaml and github-backup/.env
  • Running gh2gl init again says folder already exists (no overwrite)
  • gh2gl --dry-run from inside github-backup/ reads the local config.yaml
  • python backup.py --dry-run still works (dev shim)

🤖 Generated with Claude Code

paladini and others added 2 commits June 12, 2026 11:11
- Add pyproject.toml (hatchling build, gh2gl entry point)
- Move src/ → src/gh2gl/ as a proper importable package
- Add cli.py with backup (default) and init subcommands
- gh2gl init creates github-backup/ workspace folder with
  config.yaml and .env templates ready to edit
- Update README with pip install / init / run flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents the workspace folder created by 'gh2gl init' from being
accidentally staged when running inside the repo during development.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@paladini paladini self-assigned this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant