Raw capture โ€” raw/clig-dev.md


url: https://clig.dev/ title: Command Line Interface Guidelines author: Aanand Prasad, Ben Firshman, Carl Tashian, Eva Parish date_fetched: 2026-07-18 date_published: 2021 site: clig.dev repository: cli-guidelines/cli-guidelines


Command Line Interface Guidelines

An open-source guide from cli-guidelines/cli-guidelines on GitHub

Authors

The guide is authored by Aanand Prasad (Squarespace engineer, Docker Compose co-creator), Ben Firshman (Replicate co-founder, Docker Compose co-creator), Carl Tashian (Smallstep engineer), and Eva Parish (technical writer). Design by Mark Hurrell.

Foreword

The authors reflect on how CLI computing has evolved since the 1980s. Back then, "the command line of the past was machine-first: little more than a REPL on top of a scripting platform." Today's CLI landscape is different โ€” general-purpose interpreted languages have reduced shell scripting's role, and the modern command line is "human-first: a text-based UI that affords access to all kinds of tools, systems and platforms." The guide revisits UNIX best practices for modern CLI design.

Introduction

The document covers both high-level philosophy and concrete guidelines (leaning toward the latter). It doesn't cover full-screen terminal programs like emacs/vim. It's language-agnostic. The intended audience includes CLI creators looking for design principles, professional CLI UI designers, and anyone wanting to avoid "obvious missteps of the variety that go against 40 years of CLI design conventions."

Philosophy

Human-first design

Traditional UNIX commands assumed they'd be used primarily by other programs. Today, many are used mainly by humans but still carry that legacy. "If a command is going to be used primarily by humans, it should be designed for humans first."

Simple parts that work together

A core UNIX tenet: small, cleanly-interfaced programs combine to build larger systems. Pipes, stdin/stdout/stderr, signals, exit codes, and plain text ensure composability. JSON adds structure for web integration. "Designing for composability does not need to be at odds with designing for humans first."

Consistency across programs

Terminal conventions become muscle memory. CLIs should follow existing patterns โ€” that's what makes them "intuitive and guessable" and users efficient. But when convention compromises usability, breaking from tradition may be warranted, if done carefully.

Saying (just) enough

"The terminal is a world of pure information." Too little output (silent hangs) frustrates; too much (debugging dumps) overwhelms. Getting this balance right is "absolutely crucial if software is to empower and serve its users."

Ease of discovery

GUIs naturally make functionality discoverable โ€” everything's on screen. CLIs are assumed to require memorization, but "Discoverable CLIs have comprehensive help texts, provide lots of examples, suggest what command to run next."

Conversation as the norm

"Running a program usually involves more than one invocation." Users learn through trial and error, exploring, dry-running operations โ€” a back-and-forth with the software. Acknowledging this conversational nature lets you design better: suggest corrections, clarify intermediate state, confirm before destructive actions. "The user is conversing with your software, whether you intended it or not."

Robustness

Robustness is both objective (graceful error handling, idempotency) and subjective (the feel of solidity). "Subjective robustness requires attention to detail and thinking hard about what can go wrong." Simplicity also aids robustness โ€” complex code tends toward fragility.

Empathy

CLI tools are a programmer's creative toolkit and should be enjoyable. "Delighting the user means exceeding their expectations at every turn, and that starts with empathy."

Chaos

The terminal world is messy with inconsistencies everywhere. Yet this chaos has been a source of power โ€” "the terminal...places very few constraints on what you can build." Sometimes you must break rules; "Do so with intention and clarity of purpose."

Guidelines

The Basics

Help

Documentation

Help text gives brief, immediate guidance. Documentation provides full detail โ€” purpose, scope, and complete usage.

Output

Errors

Arguments and flags

Terminology note: arguments are positional parameters; flags are named parameters with - or -- prefixes.

Interactivity

Subcommands

Robustness (guidelines section)

Future-proofing

Signals and control characters

Configuration

Three configuration categories with recommendations:

  1. Varies per invocation (debug level, dry-run): Use flags. Environment variables may supplement.
  2. Generally stable, varies per project/user (paths, color settings, proxy): Use flags and environment variables. Possibly a config file.
  3. Stable within a project (build files like Makefile, package.json): Use a version-controlled, command-specific file.

Environment variables

Naming

The section quotes Neal Stephenson on UNIX's "obsessive use of abbreviations and avoidance of capital letters."

Distribution

Analytics

Further Reading

The guide recommends several external resources:


This is an open-source guide. Propose changes at github.com/cli-guidelines/cli-guidelines. Join the discussion on Discord.