Skip to content

Instantly share code, notes, and snippets.

@petergi
Created June 26, 2025 15:22
Show Gist options
  • Save petergi/4bcc2ecccc135387d59120cf960b04db to your computer and use it in GitHub Desktop.
Save petergi/4bcc2ecccc135387d59120cf960b04db to your computer and use it in GitHub Desktop.

This is the simplest "hello world" example.

This example was generated with:

$ bashly init --minimal
$ bashly generate

bashly.yml

name: download
help: Sample minimal application without commands
version: 0.1.0

args:
- name: source
  required: true
  help: URL to download from
- name: target
  help: "Target filename (default: same as source)"

flags:
- long: --force
  short: -f
  help: Overwrite existing files

examples:
- download example.com
- download example.com ./output -f

Output

$ ./download

missing required argument: SOURCE
usage: download SOURCE [TARGET] [OPTIONS]

$ ./download -h

download - Sample minimal application without commands

Usage:
  download SOURCE [TARGET] [OPTIONS]
  download --help | -h
  download --version | -v

Options:
  --force, -f
    Overwrite existing files

  --help, -h
    Show this help

  --version, -v
    Show version number

Arguments:
  SOURCE
    URL to download from

  TARGET
    Target filename (default: same as source)

Examples:
  download example.com
  download example.com ./output -f

$ ./download -v

0.1.0

$ ./download somesource -f

# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--force]} = 1
- ${args[source]} = somesource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment