CLI Overview
The nstypocolors CLI, exposed through the nstc command, lets you print clean, readable, and expressive colored output directly from your terminal.
It is designed to be:
- Minimal
- Fast
- Zero-config
- Script-friendly
The CLI complements the library API and works especially well for automation, tooling, and developer workflows.
A fully featured and production level cli commands are still in the works. This overview covers the core concepts and usage patterns. Some of the features may not be available yet.
What the CLI Is For
The CLI is ideal when you want:
- Better-looking logs without writing code
- Colored output in shell scripts
- Clear build or deploy messages
- Quick terminal experiments
- A consistent visual language across tools
Common use cases include:
- CI pipelines
- Local scripts
- npm lifecycle scripts
- Developer utilities
How It Works
The CLI is a thin wrapper around the core nstypocolors logging functions.
Internally, it:
- Parses the message
- Applies the selected color or gradient
- Outputs styled text using ANSI escape codes
There are no configuration files and no runtime state.
Command Structure
nstc "<message>" <option>- The message is always required
- The option is optional
- If no option is provided, a default gradient is applied
Example:
nstc "Build completed successfully"Color vs Gradient
The CLI supports two styling approaches.
Solid Colors
- Predictable and explicit
- Best for warnings, errors, and short messages
Gradients
- More expressive
- Ideal for status messages and highlights
- Designed to stay readable, not noisy
Choose based on context—both are first-class options.
Philosophy
The CLI follows a few simple principles:
- No magic — what you see is exactly what you typed
- No persistence — every command is stateless
- No surprises — styles never change implicitly
- Readable first — aesthetics never sacrifice clarity
When Not to Use It
You may prefer the library API instead if:
- You need structured or conditional logging
- You’re building a long-running application
- You want programmatic control over output
In those cases, import and use the logging functions directly in TypeScript.
Last updated on