cli
github.com/liamg/clinch
go get github.com/liamg/clinch
cli

github.com/liamg/clinch

Go CLI toolkit 🔨

by Liam Galvin

v1.5.6 (see all)License:Unlicense
go get github.com/liamg/clinch
Readme

clinch

Build Status GoDoc

A Go module to make interactive CLI applications easier to develop, better looking and visually consistent.

Demo gif

A full list of included packages and how to use them is below.

For information about using coloured text within clinch, please see the tml package.

Packages

Logging progress of sequential tasks with task

Tasks are single jobs from the users perspective. For example, in the following output:

Running test #1...
Running test #2...
Deploying code...

...each log line represents a single task. Tasks in clinch allow you to beautify these log lines slightly, by showing the status/outcome of each task, and even animate the status while the task is still running. For example:

Tasks demo

Full example here.

Prompting for input with prompt

The prompt package provides various methods of gathering user input.

List prompt demo

Full examples are available in _examples/prompt:

More granular control with terminal

The terminal package allows for more granular control of the terminal. For example, you can use it to show/hide the cursor, get the terminal size, clear the terminal, position the cursor and some other basics.

Loading bars with loading

The loading package allows for the rendering of animated loading bars, with the additional capability of logging messages to the terminal without disrupting the bar.

Loading bar demo

Full example here.

Output coloured/formatted text

You can output coloured and formatted text to the terminal with the external tml module.

Visual Guidelines

Colour Usage

  • Successful actions are reported in green.
  • Warnings are reported in yellow.
  • Errors/failures are reported in red.
  • Items requiring a user action are reported in blue.

GitHub Stars

11

LAST COMMIT

1yr ago

MAINTAINERS

0

CONTRIBUTORS

3

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v1.5.6
1yr ago
v1.5.4
1yr ago
v1.5.5
1yr ago
v1.5.3
1yr ago
No alternatives found
No tutorials found
Add a tutorial