defunkt/gist — 3.8k★ trên GitHub (Ruby). Potentially the best command line gister.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
If you'd like to copy the resulting URL to your clipboard, use -c.
gist -c <a.rb
If you'd like to copy the resulting embeddable URL to your clipboard, use -e.
gist -e <a.rb
And you can just ask gist to open a browser window directly with -o.
gist -o <a.rb
To list (public gists or all gists for authed user) gists for user
gist -l : all gists for authed user
gist -l defunkt : list defunkt's public gists
To read a gist and print it to STDOUT
gist -r GIST_ID
gist -r 374130
See gist --help for more detail.
Login
Before you use gist for the first time you will need to log in. There are two supported login flows:
The Github device-code Oauth flow. This is the default for authenticating to github.com, and can be enabled for Github Enterprise by creating an Oauth app, and exporting the environment variable GIST_CLIENT_ID with the client id of the Oauth app.
The (deprecated) username and password token exchange flow. This is the default for GitHub Enterprise, and can be used to log into github.com by exporting the environment variable GIST_USE_USERNAME_AND_PASSWORD.
The device-code flow
This flow allows you to obtain a token by logging into GitHub in the browser and typing a verification code. This is the preferred mechanism.
gist --login
Requesting login parameters...
Please sign in at https://github.com/login/device
and enter code: XXXX-XXXX
Success! https://github.com/settings/connections/applications/4f7ec0d4eab38e74384e
The returned access_token is stored in ~/.gist and used for all future gisting. If you need to you can revoke access from https://github.com/settings/connections/applications/4f7ec0d4eab38e74384e.
The username-password flow
This flow asks for your GitHub username and password (and 2FA code), and exchanges them for a token with the "gist" permission (your username and password are not stored). This mechanism is deprecated by GitHub, but may still work with GitHub Enterprise.
This token is stored in ~/.gist and used for all future gisting. If you need to
you can revoke it from https://github.com/settings/tokens, or just delete the
file.
Password-less login
If you have a complicated authorization requirement you can manually create a
token file by pasting a GitHub token with gist scope (and maybe the user:email
for GitHub Enterprise) into a file called ~/.gist. You can create one from
https://github.com/settings/tokens
This file should contain only the token (~40 hex characters), and to make it
easier to edit, can optionally have a final newline (\n or \r\n).
For example, one way to create this file would be to run:
(umask 0077 && echo MY_SECRET_TOKEN > ~/.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).
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.<protocol>.<server.name>[.<port>] (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:
$ gist -l
Error: Bad credentials
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:
defunkt/gist có 3.8k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/defunkt/gist. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
defunkt/gist có phải mã nguồn mở không?
Có — defunkt/gist phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/defunkt/gist.
defunkt/gist có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho defunkt/gist. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
defunkt/gist có trang demo không?
Dự án có trang chủ ở http://defunkt.io/gist/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
defunkt/gist còn đang phát triển không?
Commit gần nhất trên defunkt/gist là 24 ngày trước (theo timestamp GitHub). Repo có 345 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc thêm về defunkt/gist ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/defunkt/gist là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc gist có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về gist.