Name | ghops JSON |
Version |
0.4.1
JSON |
| download |
home_page | None |
Summary | A CLI tool for managing GitHub repos |
upload_time | 2025-01-31 07:41:26 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT License
Copyright (c) 2025 Alex Towell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
git
github
automation
cli
devops
|
VCS |
|
bugtrack_url |
|
requirements |
rich
pathlib
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ghops
![PyPI](https://img.shields.io/pypi/v/ghops)
![License](https://img.shields.io/pypi/l/ghops)
![Python Version](https://img.shields.io/pypi/pyversions/ghops)
ghops is a powerful command-line tool to streamline the management of your GitHub repositories. Whether you need to clone multiple repositories, keep them updated, or check their statuses, ghops provides an intuitive interface with rich, informative outputs.
## Table of Contents
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Clone Repositories (`get`)](#clone-repositories-get)
- [Update Repositories (`update`)](#update-repositories-update)
- [Check Status (`status`)](#check-status-status)
- [Examples](#examples)
- [Configuration](#configuration)
- [Contributing](#contributing)
- [License](#license)
## Features
- **Clone Multiple Repositories**: Easily clone repositories from multiple GitHub users or organizations.
- **Update Repositories**: Automatically commit, pull, handle merge conflicts, and push changes across all your repositories.
- **Check Status**: Get a comprehensive overview of the status of all your repositories in either table or JSON format.
- **Rich Console Output**: Utilizes the `rich` library for enhanced, readable console outputs.
- **Dry Run Mode**: Simulate actions without making any changes, perfect for testing.
- **Conflict Resolution**: Automatically resolve merge conflicts using predefined strategies.
- **Progress Indicators**: Visual progress bars to track operations in real-time.
## Prerequisites
Before installing ghops, ensure you have the following installed:
- **Python 3.7 or higher**
- **Git**: [Download Git](https://git-scm.com/downloads)
- **GitHub CLI (`gh`)**: [Install GitHub CLI](https://cli.github.com/)
> **Note**: ghops relies on the GitHub CLI (`gh`) for interacting with GitHub APIs. Make sure you are authenticated using `gh auth login` before using the tool.
## Installation
You can install ghops via `pip`:
```bash
pip install ghops
```
Alternatively, you can install it from the source:
```bash
git clone https://github.com/queelius/ghops.git
cd ghops
pip install .
```
## Usage
ghops provides three main subcommands:
1. [`get`](#clone-repositories-get): Clone repositories from specified GitHub users or organizations.
2. [`update`](#update-repositories-update): Update all cloned repositories by committing, pulling, and pushing changes.
3. [`status`](#check-status-status): Display the current status of all repositories.
### Clone Repositories (`get`)
Clone repositories from GitHub users or organizations.
#### Syntax
```bash
ghops get [users ...] [options]
```
#### Options
- `users`: List of GitHub usernames or organization names to clone repositories from. If omitted, defaults to the authenticated user.
- `--ignore`: List of repository names to ignore.
- `--limit`: Maximum number of repositories to fetch per user/org (default: `1000`).
- `--dry-run`: Simulate actions without making any changes.
- `--dir`: Directory to clone repositories into (default: current directory).
- `--visibility`: Repository visibility (`all`, `public`, `private`; default: `all`).
### Update Repositories (`update`)
Update all cloned Git repositories by committing changes, pulling the latest updates, handling conflicts, and pushing changes.
#### Syntax
```bash
ghops update [options]
```
#### Options
- `--auto-commit`: Automatically commit changes before pulling.
- `--commit-message`: Custom commit message for auto-commits (default: `"Auto-commit from update script"`).
- `--auto-resolve-conflicts`: Automatically resolve merge conflicts (`abort`, `ours`, `theirs`).
- `--prompt`: Prompt before pushing changes.
- `--ignore`: List of repositories to ignore.
- `--dry-run`: Simulate actions without making any changes.
- `--dir`: Base directory to search for Git repositories (default: current directory).
- `--recursive`: Recursively search for Git repositories.
### Check Status (`status`)
Display the current status of all Git repositories in a specified directory.
#### Syntax
```bash
ghops status [options]
```
#### Options
- `--json`: Output statistics in JSON format (default: table format).
- `--recursive`: Recursively search for Git repositories.
- `--dir`: Directory to search for Git repositories (default: current directory).
## Examples
### Clone Repositories from Multiple Users
```bash
ghops get user1 user2 org1 --dir ~/projects/github --ignore repo-to-ignore --limit 50
```
### Update All Repositories with Automatic Commits and Conflict Resolution
```bash
ghops update --auto-commit --commit-message "Sync changes" --auto-resolve-conflicts theirs --dir ~/projects/github --recursive
```
### Check the Status of All Repositories in JSON Format
```bash
ghops status --json --dir ~/projects/github --recursive
```
### Perform a Dry Run of Cloning Repositories
```bash
ghops get user1 --dry-run --dir ~/projects/github
```
## Configuration
### Authentication
Ensure you are authenticated with GitHub CLI before using ghops:
```bash
gh auth login
```
### Environment Variables
- `GITHUB_TOKEN`: You can set a GitHub personal access token via the `GITHUB_TOKEN` environment variable for authentication if needed.
## Contributing
Contributions are welcome! Please follow these steps to contribute:
1. **Fork the repository**: [https://github.com/queelius/ghops/fork](https://github.com/queelius/ghops/fork)
2. **Create a feature branch**:
```bash
git checkout -b feature/YourFeature
```
3. **Commit your changes**:
```bash
git commit -m "Add your feature"
```
4. **Push to the branch**:
```bash
git push origin feature/YourFeature
```
5. **Open a Pull Request**: Describe your changes and submit.
### Reporting Issues
If you encounter any issues or have suggestions, please [open an issue](https://github.com/queelius/ghops/issues).
## License
This project is licensed under the [MIT License](LICENSE).
---
© 2025 [Alex Towell](https://github.com/queelius)
Raw data
{
"_id": null,
"home_page": null,
"name": "ghops",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "git, github, automation, cli, devops",
"author": null,
"author_email": "Alex Towell <lex@metafunctor.com>",
"download_url": "https://files.pythonhosted.org/packages/7d/4f/2da2e4ab34c259135ea20200e043cfc7beb2149157c8780725e7de97fcac/ghops-0.4.1.tar.gz",
"platform": null,
"description": "# ghops\n\n![PyPI](https://img.shields.io/pypi/v/ghops)\n![License](https://img.shields.io/pypi/l/ghops)\n![Python Version](https://img.shields.io/pypi/pyversions/ghops)\n\nghops is a powerful command-line tool to streamline the management of your GitHub repositories. Whether you need to clone multiple repositories, keep them updated, or check their statuses, ghops provides an intuitive interface with rich, informative outputs.\n\n## Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n - [Clone Repositories (`get`)](#clone-repositories-get)\n - [Update Repositories (`update`)](#update-repositories-update)\n - [Check Status (`status`)](#check-status-status)\n- [Examples](#examples)\n- [Configuration](#configuration)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **Clone Multiple Repositories**: Easily clone repositories from multiple GitHub users or organizations.\n- **Update Repositories**: Automatically commit, pull, handle merge conflicts, and push changes across all your repositories.\n- **Check Status**: Get a comprehensive overview of the status of all your repositories in either table or JSON format.\n- **Rich Console Output**: Utilizes the `rich` library for enhanced, readable console outputs.\n- **Dry Run Mode**: Simulate actions without making any changes, perfect for testing.\n- **Conflict Resolution**: Automatically resolve merge conflicts using predefined strategies.\n- **Progress Indicators**: Visual progress bars to track operations in real-time.\n\n## Prerequisites\n\nBefore installing ghops, ensure you have the following installed:\n\n- **Python 3.7 or higher**\n- **Git**: [Download Git](https://git-scm.com/downloads)\n- **GitHub CLI (`gh`)**: [Install GitHub CLI](https://cli.github.com/)\n\n> **Note**: ghops relies on the GitHub CLI (`gh`) for interacting with GitHub APIs. Make sure you are authenticated using `gh auth login` before using the tool.\n\n## Installation\n\nYou can install ghops via `pip`:\n\n```bash\npip install ghops\n```\n\nAlternatively, you can install it from the source:\n\n```bash\ngit clone https://github.com/queelius/ghops.git\ncd ghops\npip install .\n```\n\n## Usage\n\nghops provides three main subcommands:\n\n1. [`get`](#clone-repositories-get): Clone repositories from specified GitHub users or organizations.\n2. [`update`](#update-repositories-update): Update all cloned repositories by committing, pulling, and pushing changes.\n3. [`status`](#check-status-status): Display the current status of all repositories.\n\n### Clone Repositories (`get`)\n\nClone repositories from GitHub users or organizations.\n\n#### Syntax\n\n```bash\nghops get [users ...] [options]\n```\n\n#### Options\n\n- `users`: List of GitHub usernames or organization names to clone repositories from. If omitted, defaults to the authenticated user.\n- `--ignore`: List of repository names to ignore.\n- `--limit`: Maximum number of repositories to fetch per user/org (default: `1000`).\n- `--dry-run`: Simulate actions without making any changes.\n- `--dir`: Directory to clone repositories into (default: current directory).\n- `--visibility`: Repository visibility (`all`, `public`, `private`; default: `all`).\n\n### Update Repositories (`update`)\n\nUpdate all cloned Git repositories by committing changes, pulling the latest updates, handling conflicts, and pushing changes.\n\n#### Syntax\n\n```bash\nghops update [options]\n```\n\n#### Options\n\n- `--auto-commit`: Automatically commit changes before pulling.\n- `--commit-message`: Custom commit message for auto-commits (default: `\"Auto-commit from update script\"`).\n- `--auto-resolve-conflicts`: Automatically resolve merge conflicts (`abort`, `ours`, `theirs`).\n- `--prompt`: Prompt before pushing changes.\n- `--ignore`: List of repositories to ignore.\n- `--dry-run`: Simulate actions without making any changes.\n- `--dir`: Base directory to search for Git repositories (default: current directory).\n- `--recursive`: Recursively search for Git repositories.\n\n### Check Status (`status`)\n\nDisplay the current status of all Git repositories in a specified directory.\n\n#### Syntax\n\n```bash\nghops status [options]\n```\n\n#### Options\n\n- `--json`: Output statistics in JSON format (default: table format).\n- `--recursive`: Recursively search for Git repositories.\n- `--dir`: Directory to search for Git repositories (default: current directory).\n\n## Examples\n\n### Clone Repositories from Multiple Users\n\n```bash\nghops get user1 user2 org1 --dir ~/projects/github --ignore repo-to-ignore --limit 50\n```\n\n### Update All Repositories with Automatic Commits and Conflict Resolution\n\n```bash\nghops update --auto-commit --commit-message \"Sync changes\" --auto-resolve-conflicts theirs --dir ~/projects/github --recursive\n```\n\n### Check the Status of All Repositories in JSON Format\n\n```bash\nghops status --json --dir ~/projects/github --recursive\n```\n\n### Perform a Dry Run of Cloning Repositories\n\n```bash\nghops get user1 --dry-run --dir ~/projects/github\n```\n\n## Configuration\n\n### Authentication\n\nEnsure you are authenticated with GitHub CLI before using ghops:\n\n```bash\ngh auth login\n```\n\n### Environment Variables\n\n- `GITHUB_TOKEN`: You can set a GitHub personal access token via the `GITHUB_TOKEN` environment variable for authentication if needed.\n\n## Contributing\n\nContributions are welcome! Please follow these steps to contribute:\n\n1. **Fork the repository**: [https://github.com/queelius/ghops/fork](https://github.com/queelius/ghops/fork)\n2. **Create a feature branch**:\n\n ```bash\n git checkout -b feature/YourFeature\n ```\n\n3. **Commit your changes**:\n\n ```bash\n git commit -m \"Add your feature\"\n ```\n\n4. **Push to the branch**:\n\n ```bash\n git push origin feature/YourFeature\n ```\n\n5. **Open a Pull Request**: Describe your changes and submit.\n\n### Reporting Issues\n\nIf you encounter any issues or have suggestions, please [open an issue](https://github.com/queelius/ghops/issues).\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n\u00a9 2025 [Alex Towell](https://github.com/queelius)\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Alex Towell\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "A CLI tool for managing GitHub repos",
"version": "0.4.1",
"project_urls": {
"Homepage": "https://github.com/queelius/ghops",
"Issues": "https://github.com/queelius/ghops/issues",
"Source": "https://github.com/queelius/ghops"
},
"split_keywords": [
"git",
" github",
" automation",
" cli",
" devops"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e133ebd09abf39c4dba557e4dac541a470dc448b34452003f996af9994772583",
"md5": "1e1fde4d2dc529fbba566f8915acceb6",
"sha256": "65b3f1a3f2efbc60c41f082d51f8ba69d7f1cadc53d153dcd7602f0d040b91e7"
},
"downloads": -1,
"filename": "ghops-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1e1fde4d2dc529fbba566f8915acceb6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10855,
"upload_time": "2025-01-31T07:41:24",
"upload_time_iso_8601": "2025-01-31T07:41:24.731861Z",
"url": "https://files.pythonhosted.org/packages/e1/33/ebd09abf39c4dba557e4dac541a470dc448b34452003f996af9994772583/ghops-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7d4f2da2e4ab34c259135ea20200e043cfc7beb2149157c8780725e7de97fcac",
"md5": "5fa5c5cf59902099a537fcf0b3855522",
"sha256": "7012c2865e98304e2ebd73692e3b319086b3e8f2a6cedc1cae46ed5b954ad0b2"
},
"downloads": -1,
"filename": "ghops-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "5fa5c5cf59902099a537fcf0b3855522",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 12698,
"upload_time": "2025-01-31T07:41:26",
"upload_time_iso_8601": "2025-01-31T07:41:26.467268Z",
"url": "https://files.pythonhosted.org/packages/7d/4f/2da2e4ab34c259135ea20200e043cfc7beb2149157c8780725e7de97fcac/ghops-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-31 07:41:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "queelius",
"github_project": "ghops",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "rich",
"specs": []
},
{
"name": "pathlib",
"specs": []
}
],
"lcname": "ghops"
}