Help us shape the future of Go! Take the 2026 Go Developer Survey

bashme

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 6 Imported by: 0

README ΒΆ

bashme

GitHub go.mod Go version GitHub license Go Report Card

Stop wasting time writing "boilerplate" code in Bash. Describe your installation scenario in YAML, bashme generates a robust, interactive, and stylized Shell script.


⚑ Why bashme?

Writing installation or maintenance scripts (install.sh, setup.sh) is often painful:

  • Managing colors and cursors (UI) is complex.
  • Error handling (set -e vs if [ $? ... ]) is verbose.
  • Asking for user inputs securely is repetitive.

bashme solves this: you write a simple recipe in YAML, and it compiles a standalone Bash script.

✨ Features
  • Zero Dependencies: The generated .sh script runs everywhere (Ubuntu, Debian, CentOS, macOS...). The end user does NOT need bashme nor python/ansible.
  • Modern UI: Colors, loading spinners, and automatic formatting included.
  • Interactivity: Easy input management (text, masked passwords).
  • Conditional Logic: if/else conditions, software checks, and error handling (fallback).
  • Templating: Reuse entered variables in subsequent commands.

πŸš€ Demo

Image

Demonstration yaml instructions

destinationFile: "install.sh"
bashHeader: "#!/bin/bash"
requireSudo: false

instructions:
    - step:
        name: "Ask for a username"
        input:
            type: "text"
            prompt: "Please enter your desired username"
            variable: "USERNAME"
    - step:
        name: "Ask for a password"
        input:
            type: "password"
            prompt: "Please enter your desired password"
            variable: "PASSWORD"
    - step:
          name: "Display credentials"
          action:
              type: "message"
              message: "User: {{USERNAME}}, Password: {{PASSWORD}}"

πŸ“¦ Installation

go install github.com/nduboi/bashme@latest
Via Binaries (Linux/Mac/Windows)

Go to the Releases page to download the latest version.


πŸ› οΈ Quick Usage

Create a setup.yaml file:
destinationFile: "install.sh"
requireSudo: false
instructions:

- step:
  name: "Configuration"
  input:
    type: "text"
    prompt: "What is your project name?"
    variable: "PROJECT_NAME"

- step:
  name: "Preparation"
  action:
    type: "command"
    message: "Creating folder for {{ PROJECT_NAME }}"
    command: "mkdir -p .{{ PROJECT_NAME }}"
    when: "! -d ./{{ PROJECT_NAME }}" # Only executes if folder doesn't exist

- step:
  name: "End"
  action:
    type: "message"
    message: "Great! Project {{ PROJECT_NAME }} is ready."

Generate the script:
bashme setup.yaml
Run the generated script:
chmod +x install.sh
./install.sh

πŸ“š Documentation

Complete documentation (Detailed YAML syntax, advanced examples, conditions) is available here:

πŸ‘‰ docs.nduboi.fr/bashme


🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests to us.

  1. Fork the project on GitHub.
  2. Clone your fork locally.
  3. Create your feature branch (git checkout -b feature/AmazingFeature).
  4. Make your changes. You can run tests using go test ./....
  5. Commit your changes (git commit -m 'Add some AmazingFeature').
  6. Push to the branch (git push origin feature/AmazingFeature).
  7. Open a Pull Request.
Reporting Issues

If you find a bug or have a feature request, please open an issue on the GitHub Issue Tracker.


πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL