A powerful Zig-based tool to manage all your GitHub repositories with ease
โจ Features
- ๐ Fast & Efficient - Built with Zig for maximum performance
- ๐ฆ Bulk Operations - Clone all repositories from any GitHub organization or user
- ๐ Concurrent Processing - Handle multiple repositories simultaneously
- ๐งน Cleanup Tools - Prune unwanted repositories automatically
- ๐ ๏ธ Easy Setup - Simple installation process for both Windows and Linux
๐ Table of Contents
๐ Quick Start
Choose your platform and run the installation command:
๐ง Linux
curl -fsSL https://raw.githubusercontent.com/gaskam/workspace/refs/heads/main/install.sh | bash๐ช Windows PowerShell
irm raw.githubusercontent.com/gaskam/workspace/refs/heads/main/install.ps1 | iexThis script will:
- Install Workspace.
- Add it to your PATH.
- Ensure all required dependencies are installed.
๐ Usage
Workspace can be called with the following arguments:
For cloning repositories from a GitHub organization or user:
workspace clone <organization/user> [destination] [--flags]
Flags:
| Flag | Description |
|---|---|
--limit, -l |
Limit the number of repositories to clone |
--processes, -p |
Limit the number of concurrent processes -> Default is the number of logical CPUs - 1 |
--prune |
Delete repositories that do not belong to current user |
For showing help:
For showing the version:
For updating Workspace:
For uninstalling Workspace:
Example
Clone repositories from an organization
# Clone first 10 repos from ziglang workspace clone ziglang ./workspace -l 10 # Clone all repos with 8 concurrent processes workspace clone microsoft ./code -p 8 # Clone and clean up old repos workspace clone gaskam ./projects --prune
Note
Note that if you provide --limit and --prune flags, we'll delete
the repositories that no longer exist once the limit is reached.
This is useful for keeping your workspace clean and up-to-date.
Warning
If you use the --processes flag with a number higher than your
number of CPU threads, you may experience performance issues.
This can be useful if you want to override the default number of simultaneous processes, in order to go faster. It will be faster than the default value, but at the cost of a higher ressource usage.
Benchmarks
This benchmark was run on a GitHub codespaces instance with 4 vCPUs and 16GB of RAM.
[!NOTE] GitHub Codespaces is quite slow, since it clones with just one process.
We're using hyperfine to measure the time taken to clone each repositories from the specified organization.
Realized on 2024-12-03 with the 1.2.2 version of Workspace.
| Organization | Repositories Cloned | Time Taken [s] |
|---|---|---|
| ziglang | 24 | 103.458 ยฑ 4.833 |
| gaskam | 11 | 3.454 ยฑ 0.185 |
๐ ๏ธ Development
For developers who want to contribute or build Workspace from source:
Prerequisites
| Tool | Purpose | Installation |
|---|---|---|
| โก Zig | Building the application | Download |
| ๐ GitHub CLI | Interacting with GitHub | Download |
| ๐ฆ Git | Git, forever and ever | Download |
Steps
- Clone the repository:
git clone https://github.com/gaskam/workspace.git
cd workspace- Build the application:
- Run the built binary:
./zig-out/bin/workspace -h
๐ค Contributing
Contributions are welcome! Feel free to:
- ๐ Report bugs
- ๐ก Suggest new features
- ๐ Improve documentation
- ๐ง Submit pull requests
License
Workspace is licensed under the MIT License. See the LICENSE file for more information.
Made with โค๏ธ by Gaskam