Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bash command line framework and CLI generator

License

NotificationsYou must be signed in to change notification settings

bashly-framework/bashly

Repository files navigation

Bashly - Bash CLI Framework and Generator

Create feature-rich bash scripts using simple YAML configuration


demo

Bashly is a command line application (written in Ruby) that lets yougenerate feature-rich bash command line tools.

Bashly lets you focus on your specific code, without worrying about command lineargument parsing, usage texts, error messages and other functions that areusually handled by a framework in any other programming language.

It is available both as aruby gem and asadocker image.

Documentation

How it works

  1. You provide a YAML configuration file, describing commands, sub-commands,arguments, and flags. Runningbashly init creates an initial sample YAMLfile for you (example).
  2. Bashly then automatically generates a bash script (when you runbashly generate) that can parse and validate user input, provide helpmessages, and run your code for each command.
  3. Your code for each command is kept in a separate file, and can be mergedagain if you change it (example).

Features

Bashly is responsible for:

  • Generating asingle, standalone bash script.
  • Generating ahuman readable, shellcheck-compliant and shfmt-compliant script.
  • Generatingusage texts and help screens, showing your tool's arguments, flags and commands (works for sub-commands also).
  • Parsing the user's command line and extracting:
    • Optional or requiredpositional arguments.
    • Optional or requiredoption flags (with or without flag arguments).
    • Commands (and sub-commands).
    • Standard flags (like--help and--version).
  • Preventing your script from running unless the command line is valid.
  • Providing you with a place to input your code for each of the functions your tool performs, and merging it back to the final script.
  • Providing you with additional (optional) framework-style, standard library functions:
    • Color output.
    • Config file management (INI format).
    • YAML parsing.
    • Bash completions.
    • and more.
  • Auto-generatingmarkdown and man page documentation for your script.

Contributing / Support

If you experience any issue, have a question or a suggestion, or if you wishto contribute, feel free toopen an issue orstart a discussion.

Visit theHow to contribute page for more information.


[8]ページ先頭

©2009-2025 Movatter.jp