Gist Manager is a command-line tool that simplifies the process of creating Gists on GitHub. With just a single command, you can quickly create Gists using your GitHub API key.
- Create Gists on GitHub effortlessly.
- Specify Gist content, description, file extension, and filename.
- Securely authenticate with your GitHub API key.
To use Gist Manager, follow these simple installation steps:
-
Download the Binary:
You can download the latest binary for your operating system from the Releases page.
-
Install the Binary:
Depending on your operating system, you can either place the binary in a directory included in your system's PATH or run it directly from the directory where you saved it.
To create a Gist using Gist Manager, open your terminal and run the following command:
gist-manager create --content "Your Gist content goes here"
Replace "Your Gist content goes here"
with the actual content you want to include in your Gist. You can also specify additional options such as a description, file extension, and filename as needed.
For more detailed usage instructions and examples, refer to the Command Usage section in the tool's documentation.
Before using Gist Manager, you need to configure your GitHub API access token by setting it as an environment variable. Follow these steps:
-
Generate a GitHub Access Token:
To create a GitHub access token, follow GitHub's official guide. Make sure to grant the necessary permissions required for your project.
-
Set the Environment Variable:
Once you have your GitHub access token, you can set it as an environment variable in your terminal. Open a terminal and execute the following command, replacing
YOUR_TOKEN_HERE
with your actual GitHub access token:export GITHUB_ACCESS_TOKEN=YOUR_TOKEN_HERE
This command sets the
GITHUB_ACCESS_TOKEN
environment variable with your GitHub access token. -
Verify the Configuration:
To ensure that the environment variable is correctly set, you can run the following command in your terminal:
echo $GITHUB_ACCESS_TOKEN
If the correct token is displayed, your configuration is complete.
If you prefer to build Gist Manager from source, you can follow these steps:
-
Clone the Repository:
First, clone this GitHub repository to your local machine:
git clone https://github.com/gabemanfroi/gist-manager.git
-
Navigate to the Project Directory:
Change your working directory to the project's root folder:
cd gist-manager
-
Build the Binary:
Use the
go build
command to build the binary for your platform:go build -o gist-manager
-
Run the Binary:
You can now run the
gist-manager
binary directly from the project folder:./gist-manager create --content "Your Gist content goes here"
Replace
"Your Gist content goes here"
with your desired content.
This project relies on several external packages to function:
-
Google Go GitHub: This project uses the Go client library for the GitHub API provided by Google. You can find more information about this library and its usage in the official documentation.
-
Cobra: Cobra is a popular CLI library for Go, and it is used extensively in this project to define and manage commands. Check out the Cobra documentation for details on how to work with Cobra commands and flags.
-
godotenv: godotenv is used to load environment variables from a
.env
file, which is particularly useful for managing sensitive information like API keys. Learn more about godotenv in the documentation. -
survey: The survey package is used to create interactive command-line prompts and surveys in this tool, enhancing user interaction. Explore the survey documentation to understand how it can be utilized in your project.
We welcome contributions from the community. If you'd like to contribute to Gist Manager, please follow our Contribution Guidelines for details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.
Thank you for using Gist Manager! If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository. We appreciate your feedback!