Mirror every repo you own โ in one command
Project description
๐ฅ Farmore
"Mirror every repo you own โ in one command."
Farmore is a comprehensive Python CLI tool for backing up GitHub repositories and their associated data. Clone repositories, export issues, download releases, backup wikis, and more โ all with a single command.
Version: 0.3.0 License: MIT Python: 3.10+
โจ Features
๐ Repository Management
- Bulk backups - Clone all repos for a user or organization in one command
- Single repo backups - Backup individual repositories with the
repocommand - Smart updates - Automatically pulls updates for existing repositories
- Parallel processing - Fast backups with configurable worker threads
- SSH/HTTPS support - Tries SSH first, falls back to HTTPS with token
๐ Data Export
- Issues export - Export all issues to JSON/YAML with optional comments
- Pull requests export - Export PRs with metadata and comments
- Workflows backup - Backup GitHub Actions workflows and run history
- Releases download - Download releases with metadata and binary assets
- Wiki backup - Clone repository wikis as git repositories
๐ Access & Security
- Private repository support - Full access with GitHub Personal Access Tokens
- Organization repos - Backup all organization repositories
- Starred & watched repos - Mirror repositories you've starred or are watching
- Secrets export - Export repository secret names (values are never exposed)
๐ฏ Advanced Features
- Flexible filtering - By visibility (public/private/all), forks, archived status
- Rate limit handling - Automatic retries with exponential backoff
- Organized structure - Clean directory organization separating code from data
- Cross-platform - Works on Linux, macOS, and Windows
- Beautiful CLI - Powered by Typer and Rich with progress bars
๐ฆ Installation
Requirements
- Python 3.10 or higher
- Git installed and available in PATH
- GitHub Personal Access Token (for private repos and higher rate limits)
From Source
# Clone the repository
git clone https://github.com/miztizm/farmore.git
cd farmore
# Install in development mode
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"
Verify Installation
farmore --version
farmore --help
๐ Quick Start
# Backup all repos for a user
farmore user miztizm
# Backup a single repository
farmore repo microsoft/vscode
# Backup with issues and pull requests
farmore repo miztizm/hello-world --include-issues --include-pulls
# Backup everything for a repository
farmore repo python/cpython --all
# Backup all repos for an organization
farmore org github --include-issues --include-pulls
# With authentication (recommended)
export GITHUB_TOKEN=ghp_your_token_here
farmore user miztizm
"They say privacy is dead. Prove them wrong. Use a token." โ schema.cx
๐ Authentication
Farmore uses GitHub Personal Access Tokens (PAT) for authentication. Tokens provide:
- Access to private repositories
- Higher rate limits (5,000 vs 60 requests/hour)
- Organization repository access
Creating a Token
โญ Recommended: Use Classic Personal Access Token
-
Create a Classic PAT: https://github.com/settings/tokens
- Click "Tokens (classic)" โ "Generate new token (classic)"
- Give it a name:
farmore-backup - Select scope: โ
repo(required for private repositories) - Optional: โ
delete_repo(only if usingfarmore deletecommand) - Click "Generate token" and copy it immediately
-
Set environment variable:
# Linux/macOS
export GITHUB_TOKEN=ghp_your_token_here
# Windows PowerShell
$env:GITHUB_TOKEN="ghp_your_token_here"
# Or create a .env file in the project directory
echo "GITHUB_TOKEN=ghp_your_token_here" > .env
Why Classic PAT?
- โ
Simple setup (just check
reposcope) - โ Works with all repository types (personal + organization)
- โ Proven reliability
- โ Broader API compatibility
Rate Limits
| Mode | Requests/Hour | Use Case |
|---|---|---|
| โ Unauthenticated | 60 | Small public repos only |
| โ Authenticated | 5,000 | Production, private repos |
Security Best Practices
- โ
Use environment variables or
.envfiles - โ Set token expiration (90 days recommended)
- โ Use minimal required permissions
- โ Never commit tokens to version control
- โ Avoid
--tokenflag (exposes in shell history)
๐ Commands
Farmore provides 13 commands organized into 4 categories:
๐ Repository Backup
farmore user <username>
Backup all private and public repositories for a GitHub user.
# Backup all repos
farmore user miztizm
# Backup with data exports
farmore user miztizm --include-issues --include-pulls
# Filter by visibility
farmore user miztizm --visibility public
# Dry run
farmore user miztizm --dry-run
Key Options: --visibility, --include-forks, --include-archived, --include-issues, --include-pulls, --include-workflows, --include-releases, --include-wikis, --max-workers, --dry-run
farmore org <orgname>
Backup all repositories for an organization. Same options as user.
farmore repo <owner>/<repo>
Backup a single repository with optional data exports.
# Just clone
farmore repo microsoft/vscode
# Clone + data
farmore repo microsoft/vscode --include-issues --include-pulls
# Everything
farmore repo python/cpython --all
Key Options: --include-issues, --include-pulls, --include-workflows, --include-releases, --include-wikis, --all
๐ Data Export
farmore issues <owner>/<repo>
Export issues to JSON/YAML.
farmore issues microsoft/vscode
farmore issues miztizm/hello-world --state open --include-comments
Options: --format [json|yaml], --state [all|open|closed], --include-comments
farmore pulls <owner>/<repo>
Export pull requests to JSON/YAML.
farmore pulls microsoft/vscode
farmore pulls miztizm/hello-world --state open --include-comments
Options: --format [json|yaml], --state [all|open|closed], --include-comments
farmore workflows <owner>/<repo>
Backup GitHub Actions workflows.
farmore workflows microsoft/vscode
farmore workflows actions/checkout --include-runs
Options: --include-runs
farmore releases <owner>/<repo>
Download releases and assets.
farmore releases microsoft/vscode
farmore releases nodejs/node --download-assets
Options: --download-assets
farmore wiki <owner>/<repo>
Clone repository wiki.
farmore wiki python/cpython
๐ Profile & Discovery
farmore profile [username]
Export user profile.
farmore profile # Your profile
farmore profile miztizm # Another user's profile
Options: --format [json|yaml]
farmore starred [username]
Mirror starred repositories.
farmore starred # Your starred repos
farmore starred miztizm # Another user's starred repos
farmore watched [username]
Mirror watched repositories.
farmore watched
๐ Security & Management
farmore secrets <owner>/<repo>
Export repository secret names (values never exposed).
farmore secrets miztizm/farmore
Options: --format [json|yaml]
farmore delete <owner>/<repo>
Delete a repository (requires confirmation).
farmore delete miztizm/old-project
farmore delete miztizm/test-repo --force # Skip confirmation
โ ๏ธ Warning: Requires delete_repo scope in your GitHub token.
๐ Directory Structure
Farmore organizes backups with a clean structure that separates code from metadata:
backups/
โโโ <username>/
โโโ profile.json # User profile
โโโ repos/ # Git repositories
โ โโโ private/<owner>/<repo>/
โ โโโ public/<owner>/<repo>/
โ โโโ starred/<owner>/<repo>/
โ โโโ watched/<owner>/<repo>/
โ โโโ organizations/<owner>/<repo>/
โ โโโ forks/<owner>/<repo>/
โโโ data/ # Metadata
โโโ issues/<owner>_<repo>_issues.json
โโโ pulls/<owner>_<repo>_pulls.json
โโโ workflows/<owner>_<repo>/
โโโ releases/<owner>_<repo>/
โโโ wikis/<owner>_<repo>.wiki/
โโโ secrets/<owner>_<repo>_secrets.json
Example:
# After: farmore user miztizm --include-issues --include-pulls
backups/miztizm/
โโโ profile.json
โโโ repos/
โ โโโ public/miztizm/farmore/
โ โโโ private/miztizm/secret-project/
โโโ data/
โโโ issues/
โ โโโ miztizm_farmore_issues.json
โ โโโ miztizm_secret-project_issues.json
โโโ pulls/
โโโ miztizm_farmore_pulls.json
โโโ miztizm_secret-project_pulls.json
๐ง How It Works
- Discovery - Uses GitHub API to find repositories
- Filtering - Applies visibility, fork, and archived filters
- Parallel Processing - Processes multiple repos simultaneously
- Smart Cloning - Tries SSH first, falls back to HTTPS
- Progress Reporting - Real-time progress with rich output
- Summary - Final statistics and error reporting
Key Features:
- Incremental backups - Updates existing repos, clones new ones
- Error resilience - Continues even if individual repos fail
- Rate limit aware - Handles GitHub API limits automatically
- Organized output - Auto-categorizes by type
๐ ๏ธ Development
Setup
git clone https://github.com/miztizm/farmore.git
cd farmore
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e ".[dev]"
Testing
pytest # Run all tests
pytest --cov=farmore --cov-report=html # With coverage
pytest tests/test_github_api.py # Specific test
Code Quality
black farmore/ # Format
ruff check farmore/ # Lint
mypy farmore/ # Type check
๐ License
MIT License - see LICENSE file for details.
๐ค Contributing
Contributions welcome! Please:
- Check existing issues and PRs
- Follow the existing code style
- Add tests for new features
- Update documentation
๐ฌ Support
๐ Acknowledgments
Built with Typer, Rich, Requests, and PyYAML.
"Control is an illusion. But backups? Those are real." โ schema.cx
Made with ๐ฅ by miztizm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file farmore-0.3.0.tar.gz.
File metadata
- Download URL: farmore-0.3.0.tar.gz
- Upload date:
- Size: 35.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6def010543d08d81c02f709c8ec446dae57972e8909188fffad0734b3b97aa3a
|
|
| MD5 |
33977d60e903236022653b689229cc08
|
|
| BLAKE2b-256 |
e66febce9bf1e61037f4600582a21c3644c067614d7918e0a2cdf81f6f143ecd
|
File details
Details for the file farmore-0.3.0-py3-none-any.whl.
File metadata
- Download URL: farmore-0.3.0-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c141760ed8ab627cf7758ef740186c15df3b445620fe4889e2960f2dd8279f2f
|
|
| MD5 |
2688d58539c2d0d2ba20f6c5c6378dd4
|
|
| BLAKE2b-256 |
f3ce2d9cc680782eafcb567c1c3df354f2f067c39ec9e85a4e37e5d8d9302367
|