gist for Mac
Command-line utility for uploading Gists
gist — overview
gist(1) -- upload code to https://gist.github.com
Synopsis
The gist gem provides a gist command that you can use from your terminal to upload content to https://gist.github.com/.
Installation
If you have ruby installed:
gem install gist
If you're using Bundler:
source :rubygems gem 'gist'
For OS X, gist lives in Homebrew
brew install gist
For FreeBSD, gist lives in ports
pkg install gist
For Ubuntu/Debian
apt install gist
Note: Debian renames the binary to gist-paste to avoid a name conflict.
For Fedora
dnf install rubygem-gist
Command
To upload the contents of a.rb just:
gist a.rb
Upload multiple files:
gist a b c gist .rb
By default it reads from STDIN, and you can set a filename with -f.
gist -f test.rb ~/.gist)
The umask ensures that the file is only accessible from your user account.
GitHub Enterprise
If you'd like gist to use your locally installed GitHub Enterprise, you need to export the GITHUB_URL environment variable (usually done in your ~/.bashrc).
export GITHUB_URL=http://github.internal.example.com/
Once you've done this and restarted your terminal (or run source ~/.bashrc), gist will automatically use GitHub Enterprise instead of the public github.com
Your token for GitHub Enterprise will be stored in .gist..[.] (e.g. ~/.gist.http.github.internal.example.com for the GITHUB_URL example above) instead of ~/.gist.
If you have multiple servers or use Enterprise and public GitHub often, you can work around this by creating scripts that set the env var and then run gist. Keep in mind that to use the public GitHub you must unset the env var. Just setting it to the public URL will not work. Use unset GITHUB_URL
Token file format
If you cannot use passwords, as most Enterprise installations do, you can generate the token via the web interface and then simply save the string in the correct file. Avoid line breaks or you might see:
Library
You can also use Gist as a library from inside your ruby code:
Gist.gist("Look.at(:my => 'awesome').code")
If you need more advanced features you can also pass:
:access_token to authenticate using OAuth2 (default is File.read("~/.gist")). :filename to change the syntax highlighting (default is a.rb). :public if you want your gist to have a guessable url. :description to add a description to your gist. :update to update an existing gist (can be a URL or an id). :copy to copy the resulting URL to the clipboard (default is false). :open to open the resulting URL in a browser (default is false).
NOTE: The access_token must have the gist scope and may also require the user:email scope.
If you want to upload multiple files in the same gist, you can:
Gist.multi_gist("a.rb" => "Foo.bar", "a.py" => "Foo.bar")
If you'd rather use gist's builtin access_token, then you can force the user to obtain one by calling:
Gist.login!
This will take them through the process of obtaining an OAuth2 token, and storing it in ~/.gist, where it can later be read by Gist.gist
Details
用于上传 Gists 的命令行工具
How to install gist
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
This project has no GitHub releases yet.
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| gist | 6.1.0 | MIT | CLI | 24 |
| cargo-dist | v0.34.0 | Apache-2.0 OR MIT | CLI | 62 |
| wb32-dfu-updater_cli | 1.0.0 | Apache-2.0 | CLI | 7 |
| gistit | 0.1.4 | MIT | CLI | 1 |
Similar apps: Command-line Tools
cargo-dist
Tool for building final distributable artifacts and uploading them to an archivewb32-dfu-updater_cli
wb32-dfu-updater is a host tool used to download and upload firmware to/from WB32 MCU via USB.gistit
Gist It is an application to create gists from console.pmtiles
Single-file executable tool for creating, reading and uploading PMTiles archiveswput
wput is a lightweight command-line FTP upload tool whose name and usage recall wget, except…openssl@4
Cryptography and SSL/TLS ToolkitCategories: Command-line Tools