Skip to content

argsh logo
arg.sh

Make Bash a structured language.

Stargazers Releases License

 

Bash is powerful and widely available, but easy to write in a way that is hard to read and maintain. argsh provides the building blocks to write Bash code that is structured, tested, and production-ready.

 

🔧 Zero-boilerplate CLI parsing

local -a args=(
  'name|n:!'    "Your name"
  'age|a:~int'  "Your age"
  'verbose|v:+' "Verbose output"
)
:args "Greet someone" "${@}"

Flags, types, defaults, validation, and --help — from a plain array.

 

🗂️ Git-style subcommands

local -a usage=(
  'deploy|d' "Deploy the app"
  'status|s' "Show status"
)
:usage "App manager" "${@}"

Convention-based routing with fuzzy typo suggestions.

 

⚡ Up to 1500x faster with Rust builtins

Optional loadable builtins compiled from Rust run natively inside the Bash process — zero fork overhead, zero subshell cost.

  • 10 flags — Pure Bash 5405 ms → Builtin 4 ms (1351x)
  • 50 flags — Pure Bash 29603 ms → Builtin 20 ms (1480x)

 

🤖 AI-ready out of the box

./myscript mcp              # MCP server (stdio)
./myscript docgen llm claude # Anthropic tool schema
./myscript docgen llm openai # OpenAI function calling

Every argsh script is an MCP server and LLM tool — no glue code.

 

🧰 Batteries included

  • argsh test — Run .bats tests with auto-discovery
  • argsh lint — shellcheck + argsh-specific checks (AG001–AG013)
  • argsh coverage — Coverage reports with minimum threshold
  • argsh docs — Generate Markdown, man, RST, YAML from comments
  • argsh minify — Bundle + minify + obfuscate into a single script
  • LSP + Debugger — Full IDE support with completions, diagnostics, formatting, and step-through debugging
  • Plugin system — Install, publish, and manage libraries via OCI registries

Everything runs locally when available, transparently forwards to Docker otherwise.

 

📦 Install

curl -sL https://min.arg.sh > .bin/argsh && chmod +x .bin/argsh

Or use the interactive installer:

bash -c "$(curl -sL https://get.arg.sh)"

 

🔗 Repositories

  • argsh — Core framework, builtins, LSP, and tooling
  • libs — Community plugin libraries (jaml, ...)

 

Copyright © 2026-present Jan Guth

Pinned Loading

  1. argsh argsh Public

    argsh aims to enhance Bash scripting by promoting structure and maintainability, making it easier to write, understand, and maintain even complex scripts.

    Rust 8 1

Repositories

Showing 3 of 3 repositories

Top languages

Loading…

Most used topics

Loading…