sigoden/argc là dự án hướng lập trình viên trên GitHub với 1.2k sao, viết chủ yếu bằng Rust. A Bash CLI framework, also a Bash command runner.
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.
Argc is a powerful Bash framework that simplifies building full-featured CLIs. It lets you define your CLI through comments, focusing on your core logic without dealing with argument parsing, usage text, error messages, and other boilerplate code.
Features
Effortless Argument Parsing:
Handles flags, options, positional arguments, and subcommands.
Validates user input for robust error handling.
Generates information-rich usage text.
Maps arguments to corresponding variables.
Standalone Bash Script Creation:
Build a bash script that incorporates all functionalities without depending on Argc itself.
Cross-shell Autocompletion:
Generate autocompletion scripts for various shells (bash, zsh, fish, powershell, etc.).
Man Page Generation:
Automatically create comprehensive man page documentation for your script.
Environment Variable Integration:
Define, validate, and bind environment variables to options and positional arguments.
Task Automation:
A Bash-based command runner that automates tasks via Argcfile.sh.
Cross-Platform Compatibility:
Seamlessly run your Argc-based scripts on macOS, Linux, Windows, and BSD systems.
Install
Package Managers
Rust Developers:cargo install argc
Homebrew/Linuxbrew Users:brew install argc
Pacman Users: yay -S argc
Pre-built Binaries
Alternatively, download pre-built binaries for macOS, Linux, and Windows from GitHub Releases, extract it, and add the argc binary to your $PATH.
You can use the following command on Linux, MacOS, or Windows to download the latest release.
curl -fsSL https://raw.githubusercontent.com/sigoden/argc/main/install.sh | sh -s -- --to /usr/local/bin
GitHub Actions
install-binary can be used to install argc in a GitHub Actions workflow.
Argc parses these arguments and creates variables prefixed with argc_:
foo: 1
bar: xyz
baz: a b
val: v1 v2
Just run ./mycli --help to see the automatically generated help information for your CLI:
Usage: mycli [OPTIONS] [VAL]...
Args:
[VAL]... Positional param
Options:
-F, --foo Flag param
--bar <BAR> Option param
--baz [BAZ]... Option param (multi-occurs)
-h, --help Print help
-V, --version Print version
argc reads the comment tags, parses the command line, and prints shell code that
sets the argc_* variables and calls the selected function. The final eval
executes that code, which is why the script works with plain Bash.
With these simple steps, you're ready to leverage Argc and create robust command-line programs!
Comment Tags
Comment tags are standard Bash comments prefixed with @ and a specific tag. They provide instructions to Argc for configuring your script's functionalities.
Tag
Description
@describe
Sets the description for the command.
@cmd
Defines a subcommand.
@alias
Sets aliases for the subcommand.
@arg
Defines a positional argument.
@option
Defines an option argument.
@flag
Defines a flag argument.
@env
Defines an environment variable.
@meta
Adds metadata.
See the comment tag for tag formats and
behavior, and the grammar for formal syntax.
Argcscript
Argc is also a command runner built for those who love the efficiency and flexibility of Bash scripting.
Similar to how Makefile define commands for the make tool, Argcscript uses an Argcfile.sh to store your commands, referred to as "recipes".
Why Choose Argc for Your Projects?
Leverage Bash Skills: No need to learn a new language, perfect for Bash aficionados.
GNU Toolset Integration: Utilize familiar tools like awk, sed, grep, find, and others.
Powerful Shell Autocompletion: Enjoy autocomplete suggestions for enhanced productivity.
Cross-Platform Compatibility: Works seamlessly across Linux, macOS, Windows, and BSD systems.
Use argc --argc-create to quickly generate a boilerplate Argcfile.sh:
argc --argc-create - build test # '-' is an alias for Argcfile.sh
argc build
argc finds Argcfile.sh in the current directory or one of its parents, so you
can run recipes from a subdirectory without changing back to the project root.
See command runner for more details.
Completions
Argc automatically provides shell completions for all argc-based scripts.
argc --argc-completions <SHELL> [CMDS]...
In the following, we use mycli and mycli2 as examples to show how to add a completion script for various shells.
sigoden/argc thuộc nhóm Developer Tools trên TopGit, cùng 11 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ề sigoden/argc ở đâ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/sigoden/argc là nguồn chính thức.
sigoden/argc có bao nhiêu sao?
sigoden/argc có 1.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/sigoden/argc. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
sigoden/argc có phải mã nguồn mở không?
Có — sigoden/argc 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/sigoden/argc.
sigoden/argc còn đang phát triển không?
Commit gần nhất trên sigoden/argc là 2 ngày trước (theo timestamp GitHub). Repo có 61 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
sigoden/argc dùng license gì?
sigoden/argc phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
sigoden/argc là gì?
sigoden/argc (sigoden/argc) là dự án Rust trên GitHub. Theo mô tả gốc: A Bash CLI framework, also a Bash command runner.
sigoden/argc viết bằng ngôn ngữ gì?
sigoden/argc chủ yếu viết bằng Rust. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc argc 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ề argc.