jlevy/ghizmo là dự án hướng lập trình viên trên GitHub với 89 sao, viết chủ yếu bằng Python. The missing command line for GitHub
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.
GitHub's APIs
are exceptionally powerful, but the friction to using them can be a bit high.
You have to look up which library is best,
then write code to use that library,
spending time on trial and error with setup, authentication, etc.
Once you get something working, the result is probably not a reusable script without additional effort.
Ghizmo lets you do complex things with the GitHub APIs from the command line,
so you can automate reading, creating, or managing GitHub
repos, contributor statistics, pull requests, teams, etc.
Its JSON output is modeled directly off the APIs,
and can be piped into other tools.
It's also easy to add, save, and share more commands you perform frequently,
by putting them into a simple ghizmo_commands.py file,
and they become automatically available.
Essentially, it's just a harness around the clean and complete github3.py library.
It differs from the standard option hub in that it's not focusing key features to augment the git command.
Rather, it's a way to use the full GitHub APIs more easily.
(Also, since it's in Python, not Go, it can be extended without a compile step.)
Examples
Commands are all defined here and below.
Run ghizmo --help for a list of commands -- and see below on how to add new commands.
Commands can take arguments.
This command lists teams, and requires an organization name
(should you forget an argument required by a command, you'll be rudely advised of your oversight):
Another command of interest may be assemble-authors.
It looks at GitHub history and creates an AUTHORS.md file, also including role information and additional configurable headers and footers. See this example.
Installation
Requires Python 3.6+. Then (with sudo if desired):
pip install ghizmo
Ghizmo benefits if git is in your path so it can auto-detect your repository config.
You may also want to install tools like
jq or data_hacks
so you can perform operations such as the ones above that process JSON outputs.
Configuration
You can supply username and password from the command line, but you probably want to be able to use APIs without typing your
password. To do this, create a ~/.ghizmo.yml file:
# Ghizmo configuration
# Default GitHub login name:
username: my-github-id
# Personal access token for the above GitHub account:
access_token: aaaaaaaaaabbbbbbbbbbbccccccccc1234567890
Create an access token on your GitHub settings page to use with Ghizmo.
Custom commands
To add a new command, create a file ghizmo_commands.py in your current directory.
For example, here is one that counts pull requests by user:
import ghizmo.commands.lib as lib
from collections import defaultdict
def count_prs(config, args):
"""
Show tallies of pull requests by author login name.
"""
counts = defaultdict(int)
for pr in config.repo.pull_requests(state="closed"):
counts[pr.user.login] += 1
yield { "status": "I'm at PR %s!" % pr.number }
yield counts
def octotech_create_repo(config, args):
"""
If you like, your command can be custom, e.g. to your organization.
This creates a repo within your org owned by a specific team.
"""
org = config.github.organization("OctoTech")
team_id = 1234567890 # OctoTech engineering team
repo = org.create_repository(args.name, description=args.description, private=True,
has_issues=False, has_wiki=False, team_id=team_id)
Now running
ghizmo count-prs
(note the dash) will stream JSON messages as it tallies,
then write a tally of closed PRs for each user.
To use the second command, you need to specify custom arguments:
ghizmo octotech-create-repo -a name=ninth-leg -a description="Yet another repository!"
Convenience
The idea here is both to provide simple commands, but also to allow more custom or complex use.
You can easily save/commit commands you write to ghizmo_commands.py file to Git,
and your teammates can then use the same commands.
This means you can automate setup and configuration of GitHub repositories, teams, etc. in a flexible way.
If there're generally useful, please submit a PR and I'll gladly merge it for use by everyone.
Maturity
Mostly a one-day hack. Could be extended a lot, but seems to work.
Contributing
Yes, please!
We need more commands in the library.
File issues for bugs or general discussion.
jlevy/ghizmo thuộc nhóm Developer Tools trên TopGit, cùng 3 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về jlevy/ghizmo ở đâ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/jlevy/ghizmo là nguồn chính thức.
jlevy/ghizmo có bao nhiêu sao?
jlevy/ghizmo có 89 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/jlevy/ghizmo. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
jlevy/ghizmo có những chủ đề gì?
GitHub topics của jlevy/ghizmo: "command-line", "github", "python". TopGit xếp repo vào nhóm Developer Tools.
jlevy/ghizmo có phải mã nguồn mở không?
Có — jlevy/ghizmo phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/jlevy/ghizmo.
jlevy/ghizmo có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho jlevy/ghizmo. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
jlevy/ghizmo còn đang phát triển không?
Commit gần nhất trên jlevy/ghizmo là 2.6 năm trước (theo timestamp GitHub). Repo có 15 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
ghizmo có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về ghizmo.