• Stars
    star
    1,902
  • Rank 23,369 (Top 0.5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bash command line framework and CLI generator

Bashly - Bash CLI Framework and Generator

Create feature-rich bash scripts using simple YAML configuration

Gem Version Build Status Maintainability


demo

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

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

It is available both as a ruby gem and as a docker image.

Documentation

How it works

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

Features

Bashly is responsible for:

  • Generating a single, standalone bash script.
  • Generating a human readable, shellcheck-compliant and shfmt-compliant script.
  • Generating usage 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 required positional arguments.
    • Optional or required option 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-generating markdown and man page documentation for your script.

Contributing / Support

If you experience any issue, have a question or a suggestion, or if you wish to contribute, feel free to open an issue or start a discussion.

Visit the How to contribute page for more information.

More Repositories

1

victor

Ruby SVG Image Builder
Ruby
334
star
2

FlicFlac

Tiny portable audio converter for Windows (WAV FLAC MP3 OGG APE M4A AAC)
AutoHotkey
212
star
3

madness

Instant Markdown Server
Ruby
85
star
4

completely

Generate bash completion scripts using a simple configuration file
Ruby
81
star
5

alf

Bash Alias Generator and Manager
Shell
70
star
6

Gridy

Snap Windows to Grid
AutoHotkey
61
star
7

php-quandl

Easy access to the Quandl Data API using PHP
PHP
54
star
8

snapcrawl

Crawl a website and take screenshots
Ruby
52
star
9

kojo

Command line utility for generating config files from templates and definition files
Ruby
51
star
10

lightly

Ruby file cache for performing heavy tasks, lightly.
Ruby
38
star
11

icodi

Deterministic Random SVG Icon Generator
Ruby
30
star
12

rush-cli

Personal Package Manager - run your GitHub hosted scripts, locally.
Shell
29
star
13

runfile

Command line for your projects
Ruby
28
star
14

secret_hub

Manage GitHub secrets with support for bulk operations and organization secrets
Ruby
25
star
15

minichart

Create SVG mini charts with Ruby
Ruby
24
star
16

approvals.bash

Bash Interactive Approval Testing
Shell
19
star
17

webcache

Hassle-free caching for HTTP download with ruby
Ruby
16
star
18

pretty_trace

Love Your Ruby's Backtrace
Ruby
16
star
19

quandl

Go library for accessing Quandl API
Go
15
star
20

opcode

Local Command Shortcuts
Shell
14
star
21

pundit_extra

Extensions and helpers for Pundit
Ruby
14
star
22

fuzzycd

Change directories with fuzzy search
Shell
14
star
23

docker-madness

Docker Image for the Madness Markdown Server
Ruby
14
star
24

docker-borg-client

Borg Backup Client Docker on Alpine
Dockerfile
7
star
25

menu_commander

Create menus for any command line tool using simple YAML configuration
Ruby
6
star
26

concode

Generate consistent-codenames from any string (Heroku style, aka Haiku).
Ruby
6
star
27

rush-repo

My package repository for the Rush package manager
Shell
6
star
28

gondl

Command line console for Quandl
Go
6
star
29

eclipse

Encrypt / Decrypt any text with a simple hotkey
AutoHotkey
6
star
30

git-changelog

Create a changelog from your git repository
Shell
6
star
31

jobly

Compact job server with API, CLI, Web UI and a Sidekiq heart
Ruby
5
star
32

victor-cli

Command line for Victor, the Ruby SVG library
Ruby
5
star
33

extended_yaml

Ruby YAML with support for including and merging additional YAML files
Ruby
5
star
34

apicake

Build Dynamic API Wrappers
Ruby
5
star
35

filecache

Go File Cache
Go
5
star
36

recode

Command line refactoring utility
Ruby
5
star
37

fredric

Federal Reserve Economic Data (FRED) API Library and Command Line
Ruby
5
star
38

github-redirector

Source code for get.dannyb.co
Ruby
4
star
39

alf-conf

My alf config
Shell
4
star
40

docker-alpine-ruby

Minimal Ruby docker image with native extensions support
Dockerfile
4
star
41

shell-action-example

Run GitHub-hosted shell scripts inside GitHub Actions
Shell
4
star
42

sting

Minimal, lightweight, multi-YAML settings library
Ruby
4
star
43

WallpaperRandomizer

System Tray Wallpaper Changer
AutoHotkey
4
star
44

rigit

Scaffolding that doesn't bite
Ruby
4
star
45

bobkit

Site Generation Toolkit with Slim, SCSS, CoffeeScript and Markdown
Ruby
4
star
46

slacktail

Command line utility for following your Slack chat from the terminal
Ruby
4
star
47

erbx

ERB Extended with Pretty Tags
Ruby
4
star
48

madman

The Markdown Swiss Army Knife
Ruby
3
star
49

loadrunner

GitHub Webhook Server and Event Simulator
Ruby
3
star
50

audio_addict

AudioAddict Command Line for Voting and Playlist Management
Ruby
3
star
51

experiments

GitHub Experiments
3
star
52

docker-snapcrawl

Crawl a website and take screenshots (Docker version)
Dockerfile
3
star
53

my-github

Comprehensive index of my open source projects on GitHub
HTML
3
star
54

bashly-book

Source for bashly.dannyb.co
Shell
3
star
55

docker-sshd

Alpine SSH Client and Server
Shell
3
star
56

colsole

Utility functions for colorful console applications with Ruby
Ruby
3
star
57

rspec_approvals

Interactive Approval Testing for RSpec
Ruby
3
star
58

requires

Require all files in a directory
Ruby
3
star
59

redirectly

Redirect server with dynamic URL and hostname support
Ruby
3
star
60

mister_bin

Build modular command line tools
Ruby
3
star
61

docker-mdbook

Docker with mdbook
Dockerfile
2
star
62

voicemaker

Create Text to Speech files with the Voicemaker API from Ruby or the command line
Ruby
2
star
63

bootstrap

My personal Ubuntu bootstrap metascript
Shell
2
star
64

echo-webserver

A web server that echoes the request back
Ruby
2
star
65

httpme

Static files web server with basic authentication
Ruby
2
star
66

clipper

Pure Command Line Arguments Parser
Crystal
2
star
67

docker-ruby-python

Docker Alpine with Ruby and Python 2+3
Dockerfile
2
star
68

getcomments

Extract Comments from Ruby Code
Ruby
2
star
69

eod

EOD Historical Data API Library and Command Line
Ruby
2
star
70

TinySpeech

Portable system tray utility for Windows that adds a global hotkey for speaking any selected text using the default (SAPI) Windows Text-to-Speech.
AutoIt
2
star
71

docker-alpine-mongo

Docker Alpine MongoDB Image
Dockerfile
2
star
72

docker-alpine-php

Docker PHP CLI Image based on Alpine
Dockerfile
2
star
73

colorly

Command Line Color Palette Generator
Ruby
2
star
74

sector-seven-builder

Static site generator for sector-seven.com
SCSS
2
star
75

docker-rush-sandbox

Docker sandbox for experimenting with Rush CLI
Dockerfile
2
star
76

stress-server

Docker image for simulating server resource stress
Ruby
1
star
77

super_docopt

docopt-based command line utility builder
Ruby
1
star
78

intrinio

Library and command line interface for Intrinio data API
Ruby
1
star
79

hash_cabinet

File-based, key-object store with hash-like access.
Ruby
1
star
80

docker-alpine-ruby-mongo

Docker image with ruby and mongo tools based on Alpine
Dockerfile
1
star
81

clicumber

Cucumber step definitions for testing command line applications
Ruby
1
star
82

action-test

Testing the authoring process of GitHub actions
Shell
1
star
83

docker-redirector

HTTP Redirector Docker Image
Ruby
1
star
84

docker-zsh

ZSH on Alpine for testing ZSH related scripts
Shell
1
star
85

pobject

Automatically persist objects to disk as YAML files
Ruby
1
star
86

docker-ruby-php

Alpine image with Ruby and PHP CLI
Dockerfile
1
star
87

respec

RSpec Convenience Wrapper
Shell
1
star
88

docker-gotty

Docker image with Browser Based Linux Terminal
Dockerfile
1
star
89

sasstool

Sass (SassC) command line renderer with globbing import support.
Ruby
1
star
90

dcind

Docker Compose in Docker
Dockerfile
1
star
91

bashly-support

Support code snippets for bashly
Shell
1
star
92

docker-whoami

Whoami Debug Webserver Docker Image
Dockerfile
1
star
93

actions-debug

Debug GitHub Actions workflow configuration
Ruby
1
star
94

docker-nikto

Nikto vulnerability scanner docker image
Shell
1
star
95

docker-fallback

Default Ingress Backend
Ruby
1
star
96

yamlcon

YAML Configuration File Loader
Ruby
1
star
97

example-rig

Sample rigit rig
1
star
98

favicon.sh

Favicon generator
Shell
1
star
99

node-jsoncache

A Node.js module for caching JSON objects and raw data
JavaScript
1
star
100

docker-alpine-crystal

Docker Alpine Crystal Image
Dockerfile
1
star