All Projects → desertbit → Grumble

desertbit / Grumble

Licence: mit
A powerful modern CLI and SHELL

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
golang
3204 projects

Labels

Projects that are alternatives of or similar to Grumble

Flaggy
Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.
Stars: ✭ 711 (+156.68%)
Mutual labels:  cli, flags
Mri
Quickly scan for CLI flags and arguments
Stars: ✭ 394 (+42.24%)
Mutual labels:  cli, flags
Unpuzzled
A colorful CLI library with variable provenance.
Stars: ✭ 57 (-79.42%)
Mutual labels:  cli, flags
Args
Toolkit for building command line interfaces
Stars: ✭ 399 (+44.04%)
Mutual labels:  cli, flags
Envy
Envy automatically exposes environment variables for all of your Go flags
Stars: ✭ 150 (-45.85%)
Mutual labels:  cli, flags
Cliffy
NodeJS Framework for Interactive CLIs
Stars: ✭ 263 (-5.05%)
Mutual labels:  cli
Irs
🎸 🎶 A music downloader that understands your metadata needs.
Stars: ✭ 268 (-3.25%)
Mutual labels:  cli
Github cli
GitHub on your command line. Use your terminal, not the browser.
Stars: ✭ 263 (-5.05%)
Mutual labels:  cli
Terminus
The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform
Stars: ✭ 263 (-5.05%)
Mutual labels:  cli
Feeluown
trying to be a user-friendly and hackable music player
Stars: ✭ 3,030 (+993.86%)
Mutual labels:  cli
Onefetch
Git repository summary on your terminal
Stars: ✭ 3,680 (+1228.52%)
Mutual labels:  cli
Fw
workspace productivity booster
Stars: ✭ 269 (-2.89%)
Mutual labels:  cli
Pygogo
A Python logging library with superpowers
Stars: ✭ 265 (-4.33%)
Mutual labels:  cli
Git Hound
Git plugin that prevents sensitive data from being committed.
Stars: ✭ 269 (-2.89%)
Mutual labels:  cli
Fastify Cli
Run a Fastify application with one command!
Stars: ✭ 260 (-6.14%)
Mutual labels:  cli
Pydoc Markdown
Create Python API documentation in Markdown format.
Stars: ✭ 273 (-1.44%)
Mutual labels:  cli
Imessage
💬 Send iMessages from command-line
Stars: ✭ 261 (-5.78%)
Mutual labels:  cli
Td
Your todo list in your terminal
Stars: ✭ 265 (-4.33%)
Mutual labels:  cli
Starcli
✨ Browse GitHub trending projects from your command line
Stars: ✭ 269 (-2.89%)
Mutual labels:  cli
Frick
frick - aka the first debugger built on top of frida
Stars: ✭ 267 (-3.61%)
Mutual labels:  cli

Grumble - A powerful modern CLI and SHELL

GoDoc Go Report Card

There are a handful of powerful go CLI libraries available (spf13/cobra, urfave/cli). However sometimes an integrated shell interface is a great and useful extension for the actual application. This library offers a simple API to create powerful CLI applications and automatically starts an integrated interactive shell, if the application is started without any command arguments.

Hint: We do not guarantee 100% backwards compatiblity between minor versions (1.x). However, the API is mostly stable and should not change much.

asciicast

Introduction

Create a grumble APP.

var app = grumble.New(&grumble.Config{
	Name:        "app",
	Description: "short app description",

	Flags: func(f *grumble.Flags) {
		f.String("d", "directory", "DEFAULT", "set an alternative directory path")
		f.Bool("v", "verbose", false, "enable verbose mode")
	},
})

Register a top-level command. Note: Sub commands are also supported...

app.AddCommand(&grumble.Command{
    Name:      "daemon",
    Help:      "run the daemon",
    Aliases:   []string{"run"},

    Flags: func(f *grumble.Flags) {
        f.Duration("t", "timeout", time.Second, "timeout duration")
    },

    Args: func(a *grumble.Args) {
        a.String("service", "which service to start", grumble.Default("server"))
    },

    Run: func(c *grumble.Context) error {
        // Parent Flags.
        c.App.Println("directory:", c.Flags.String("directory"))
        c.App.Println("verbose:", c.Flags.Bool("verbose"))
        // Flags.
        c.App.Println("timeout:", c.Flags.Duration("timeout"))
        // Args.
        c.App.Println("service:", c.Args.String("service"))
        return nil
    },
})

Run the application.

err := app.Run()

Or use the builtin grumble.Main function to handle errors automatically.

func main() {
	grumble.Main(app)
}

Shell Multiline Input

Builtin support for multiple lines.

>>> This is \
... a multi line \
... command

Samples

Check out the sample directory for some detailed examples.

The grml project uses grumble.

Additional Useful Packages

Credits

This project is based on ideas from the great ishell library.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].