Skip to content
0xRahimPublic

About

Use tint to beautify your javscript cli interfaces

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

tint — beautiful terminal output for JavaScript CLIs

Runtime: Bun TypeScript Themes Tests: bun test License: MIT

A small terminal colorizer with helpers for headings, status messages, lists, prompts, and figlet logos.

Install · Quick start · Themes · Examples · API


tint running with the ocean theme

✨ Features

  • 🎨 Simple painting: wrap any string in a color with colorizer.paint()
  • 🧱 Ready-made helpers: section headings, success/info/warning/error messages, lists, and prompts
  • 🔤 Figlet logos: big ASCII banners for your CLI's splash screen
  • 🌈 Four built-in themes: ocean, ember, forest, mono
  • 🔌 Switchable output: pass enabled to turn colors on or off in one place
  • 🧩 Typed: written in TypeScript, with declarations in types/
  • ⚡ Bun-first: fast install, fast tests, runnable examples

📦 Install

bun install

🚀 Quick start

import { Colorizer, Colors } from "./index.ts";

const colorizer = new Colorizer({ enabled: true });

console.log(colorizer.paint("Hello", Colors.GREEN));
colorizer.section("Status", Colors.CYAN);
colorizer.success("Everything is wired up.");

That's the whole setup: create a Colorizer, then print.

🎭 Themes

Every theme ships with the same set of colors for accents, success, info, warning, and error states, so swapping themes never changes your layout, only the mood. Each preview below is a live-typing terminal window.

ocean theme
ocean · the default
ember theme
ember · warm and loud
forest theme
forest · calm and green
mono theme
mono · no color, all contrast

Note

The animations above are illustrative previews. Run the examples locally to see real output in your own terminal.

🧪 Examples

bun run example               # dashboard with the default ocean theme
bun run example ocean         # dashboard with a specific theme
bun run example:gallery       # every theme variation
bun run example:basic         # minimal usage
Command What you get
bun run example Full dashboard in the default ocean theme
bun run example <theme> Same dashboard in ocean, ember, forest, or mono
bun run example:gallery Every theme rendered back to back
bun run example:basic The smallest possible working script

🧰 API at a glance

Piece Purpose
new Colorizer({ enabled }) Create a colorizer; enabled toggles color output
colorizer.paint(text, color) Return text wrapped in the given color
colorizer.section(title, color) Print a colored section heading
colorizer.success(message) Print a success status line
Colors Color constants such as Colors.GREEN and Colors.CYAN

Lists, prompts, and figlet logos follow the same pattern. See lib/ and examples/ for the full set.

🗂 Project layout

tint/
├── index.ts      # public entry point
├── lib/          # colorizer implementation
├── types/        # type declarations
├── examples/     # runnable demos (dashboard, gallery, basic)
└── test/         # bun test suite

✅ Testing

bun test

🛠 Regenerating the README animations

The SVGs in assets/ are generated, so you can edit palettes or lines and rebuild:

bun scripts/gen-assets.mjs

🤝 Contributing

Issues and pull requests are welcome. If you add a theme, add it to the palette list in scripts/gen-assets.mjs so it shows up in the gallery above.

📄 License

Released under the MIT License.

Copyright (c) 2026 0xRahim

About

Use tint to beautify your javscript cli interfaces

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages