← All tools

argc

Popularity 85 Updated Development & Build

Easily create and use cli based on bash script

homebrewauto-collected

Installation

Homebrew
brew install argc

Install with Homebrew.

Argc

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:
  • An 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.

  - uses: sigoden/install-binary@v1
    with:
      repo: sigoden/argc

Get Started

Building a command-line program using Argc is a breeze. Just follow these two steps: