Welcome to Cute-Line-Interface Beautiful designs brought to your terminal. This is a small attempt to do what charm did with terminals and TUIs, from scratch. Get all pretty colors, tables and list components in your favourite terminal. Written fully in Go without any external dependencies.
- Interactive command-line interface with custom commands
- List navigation with arrow keys
- HTTP API integration (fetches user data from JSONPlaceholder)
- Table rendering with customizable colors
- Terminal raw mode for capturing key events
- ANSI color support for styled output
- Go 1.24 or higher
Clone the repository and navigate to the project directory:
git clone https://github.com/DivyanshuShekhar55/cute-line-interface.git
cd cute-line-interfaceInstall dependencies:
go mod downloadRun the application:
go run .Once started, you can use the following commands:
help- Display available commands and their descriptionsusers- Fetch and display a list of users from JSONPlaceholder APIexit- Exit the terminal (or use Ctrl+C)monkey- print a pretty table
main.go- Entry point and main loopcommand_defs.go- Command definitions and implementationscommands.go- Command mapping and retrievalrepl.go- Input tokenizationlist/- Interactive list component with arrow key navigationutils/- Utility functions including error logging and ANSI formatting
Create an interactive list with arrow key navigation:
import "cute-line-interface/list"
items := []string{"Option 1", "Option 2", "Option 3"}
list.List(items)Navigate with arrow keys, press Enter to select, or q to quit.
Build and render tables with custom colors:
import "cute-line-interface/monkey"
table := monkey.NewTable()
table = table.Header([]string{"Name", "Email", "Username"})
table = table.Row([]string{"John Doe", "john@example.com", "johndoe"})
table = table.Row([]string{"Jane Smith", "jane@example.com", "janesmith"})
table.Render("magentaBright", "cyan")Chain methods to build your table, then render with your choice of colors.
The application runs a read-eval-print loop that accepts user input, tokenizes it, matches it to registered commands, and executes the corresponding callback function. The list component switches the terminal to raw mode to capture individual keystrokes for interactive navigation.
Belongs to official but extended library.
golang.org/x/term- Terminal control and raw modegolang.org/x/sys- System-level operations
This project is open source and available for educational purposes.

