oscli

Theme

Use presets for fast defaults or override only the parts you want.

The theme system is shallow to use and deep enough to be practical. Use a preset name when you want a fast default. Use a theme object when you only need to override a few colors or symbols.

Presets

These are the built-in presets.

src/cli.ts
export const cli = createCLI(() => ({
  title: "default theme",
  theme: "default",
}));
src/cli.ts
export const cli = createCLI(() => ({
  title: "basic theme",
  theme: "basic",
}));
src/cli.ts
export const cli = createCLI(() => ({
  title: "rounded theme",
  theme: "rounded",
}));
src/cli.ts
export const cli = createCLI(() => ({
  title: "minimal theme",
  theme: "minimal",
}));
  • default: square corners, rail, spacing 1
  • basic: square corners, rail, spacing 1, cyan cursor and active state
  • rounded: and corners, pipe rail, spacing 1
  • minimal: no sidebar rail, spacing 0, cyan cursor — icons stand alone without a connecting rail

Preset previews

These examples show the overall layout difference, not the full color treatment.

default
  project setup

 Project: my-app

  Done.
basic
  project setup

 Project: my-app

  Done.
rounded
  project setup

 Project: my-app

  Done.
minimal
project setup

 Project: my-app

Done.

Theme overrides

Use ThemeOverride when you want to change only a few fields.

src/cli.ts
export const cli = createCLI((b) => ({
  title: "themed tool",
  theme: {
    active: "cyan",
    success: "green",
    symbols: {
      cursor: "❯",
      success: "✔",
    },
    spacing: 0,
  },
  prompts: {
    project: b.text().label("Project"),
  },
}));

Prop

Type

Per-prompt color

Use .color() when you want one prompt label to stand out without changing the rest of the theme.

src/cli.ts
export const cli = createCLI((b) => ({
  description: "prompt colors",
  prompts: {
    project: b.text().label("Project").color("cyan"),
    owner: b.text().label("Owner").color("yellow"),
  },
}));

These are the accepted color names.

Prop

Type

Presets are only shortcuts. Internally, they resolve to the same ThemeOverride shape you can pass manually.

On this page