https://github.com/lloydlobo/privateer
Group toggle multiple git repository visibility interactively from your terminal
https://github.com/lloydlobo/privateer
cli git github repository rust
Last synced: about 1 month ago
JSON representation
Group toggle multiple git repository visibility interactively from your terminal
- Host: GitHub
- URL: https://github.com/lloydlobo/privateer
- Owner: lloydlobo
- Created: 2023-05-07T06:58:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T18:50:23.000Z (3 months ago)
- Last Synced: 2025-02-09T00:14:40.405Z (3 months ago)
- Topics: cli, git, github, repository, rust
- Language: Rust
- Homepage:
- Size: 139 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# privateer
**CLI Application for making a GitHub repository private**
This is a command-line interface (CLI) application that makes a GitHub repository private using a personal access token (PAT). The app is written in Rust programming language and uses the `serde` and `anyhow` crates.
## Prerequisites
- Rust programming language should be installed.
- A personal access token (PAT) with `repo` scope is required to modify the repository's privacy settings.## Usage
1. Clone this repository:
```
git clone https://github.com/username/repo-name.git
```2. Change directory to the project's root:
```
cd repo-name
```3. Create a `.env` file and add your PAT token in the following format:
```
PAT_TOKEN=
```4. Build the project:
```
cargo build --release
```5. Run the CLI app:
```
./target/release/make-private-repo
```6. Enter the GitHub username and repository name when prompted.
```shell
Enter username: lloydlobo
Enter repository: gittidy
...
```7. Choose whether to make the repository private or not by entering either `true` or `false`.
```shell
...
Make it private?: (true/false) true
✅ curl: exit status: 0
```## Functionality
The app will send a PATCH request to the GitHub API with the personal access token (PAT) included in the `Authorization` header.
The request payload will contain the `private` field set to either `true` or `false`, depending on the user's input.If the API call is successful, the repository will be made private.
## Further Information
For more information on how to create a personal access token (PAT), visit the [GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
For more information on how to make a repository private using the GitHub API, visit the [GitHub documentation](https://docs.github.com/en/rest/reference/repos#update-a-repository).
## License
This project is licensed under the terms of the [LICENSE].