Package: code2gist
code2gist 📦code2gistis a Python package that makes sharing your code projects easier than ever. With a simple command, it lets you upload your code files to GitHub's Gist.code2gistis available onPyPI.The package works hand-in-hand with OpenAI's ChatGPT-4's 'Browse with Bing' feature. Send codebases without going over the character limit using a secret URL. 🗜️Another key feature ofcode2gistis its ability to handle a wide range of text-based file types, not just Python files. 📄In addition,code2gistcomes with aprunefeature that provides a clean way to remove all the gists created by this tool from your GitHub account. 🌳Installation ⚙️The recommended way to installcode2gistis viapipx:pipx install code2gistpipxensures the package and its dependencies are isolated from your global Python environment. Moreover,pipxautomatically adds the installed package to your PATH, so you can runcode2gistfrom any directory in the command line. 🧠If you haven't installedpipxyet, you can do it by runningpython3 -m pip install --user pipxand thenpython3 -m pipx ensurepath.You can still install the package via pip, but you will have to add the package directory to your PATH manually 😒:pip install code2gistAdding code2gist Directory to the PATH Environment Variable 👣Here are step-by-step instructions to add the code2gist directory to your PATH environment variable on Windows:Open theControl Panel.Navigate toSystem and Security > System.Click on theAdvanced system settingslink on the left panel.ClickEnvironment Variables.Under theSystem Variablessection, find and double-click the variablePATH.ClickNew.Add the directory where code2gist is installed. For example, if you have Python 3.11 installed, the directory might look like this:C:\...\Python311\ScriptsClickOKto close all windows and save the changes.After following these steps, your system should recognize code2gist commands from any directory in the command line. 👍GitHub Token 🔑code2gistrequires a GitHub token to function. You need to create a new token with thegistscope (which allows it to create gists). Followthis guideto create a new token.Once you have your token, you should store it in the "GITHUB_TOKEN" environment variable. Here are the steps to set this variable in Windows:Open the Control Panel.Search for "Environment Variables".Click on "Edit the system environment variables".In the System Properties window that appears, click the "Environment Variables..." button.In the Environment Variables window, click the "New..." button under the "User variables" section.Enter "GITHUB_TOKEN" as the variable name and your token as the variable value.Click "OK" on all open windows to apply the changes.Please ensure that you have this variable set before using the package. ✅Usage 🚀Uploading Files 📤To usecode2gist, simply use the following command:code2gist .This command will upload all Python files in the current directory to a private Gist on your GitHub account. The Gist will be titled with the name of the current directory, followed by "[code2gist]".If you want to include files with different extensions, you can specify them using the--extoption:code2gist . --ext .txt .md .pyThis command will include all text, Markdown, and Python files in the upload.Deleting Gists 🗑️Theprunefeature allows you to delete all gists created bycode2gist:code2gist --pruneRunning this command will delete all your gists with "[code2gist]" in the description..gitignore and .code2gistignore Support ✅code2gistrespects.gitignoreand.code2gistignorerules. Files that match a rule in either file will be skipped. 🦘Note 📝The gists created bycode2gistare private by default, providing a safe way for you to share your code without making it publicly available.Please remember thatcode2gistis a tool for sharing code and should not be used to share sensitive information. Always ensure that your files do not contain any confidential data before uploading them.License ⚖️code2gistis licensed under theGNU General Public License v3.0.We hopecode2gistserves as a valuable tool in your development toolkit. Happy coding! 💻👨‍💻