Skip to content

[Bug]: example command's --yes flag does not skip the brand-color prompt #170

@bdinsmor

Description

@bdinsmor

Bug description

The `example` subcommand's `--yes` flag is documented as "non-interactive mode - use defaults for all prompts (for AI agents/CI)" but it still prompts for brand color and overwrite confirmation, blocking automation.

Steps to reproduce

```bash
npx untitledui@latest example informational-01/10 --yes --include-all-components --overwrite
```

Expected behavior

All prompts are skipped (defaults used), command completes without TTY interaction.

Actual behavior

CLI hangs at:

```
? Which color would you like to use as the brand color? › - Use arrow-keys. Return to submit.
❯ brand
```

If you set `CI=true` env var, same result. If a project's brand color is already set in components.json (or wherever it's stored), the prompt still fires.

When run without TTY (e.g. piped from another script), the spinner spins forever consuming CPU until killed.

Workaround

Pipe `yes ""` to feed Enter through any prompts:

```bash
yes "" | npx untitledui@latest example informational-01/10 \
--yes --include-all-components --overwrite \
--example-path src/_uui-examples/informational-01-10
```

This works but produces a lot of "unread input" buffering and feels brittle.

Suggested fix

Either:

  1. Make `--yes` truly skip every prompt by using stored defaults from `~/.untitledui/config.json` or `components.json`
  2. Add an explicit `-c, --color ` flag to `example` (the `init` command already has this)
  3. Read brand color from existing project state when present

Same issue exists for the overwrite prompt — `--overwrite` flag does suppress the theme-file overwrite prompt but not the component-overwrite confirmation that fires later in the install for existing shared base components.

Why this matters

Blocks any kind of CI / batch / agent-driven install of multiple templates. We had to wrap the install in a shell loop with `yes ""` piping just to install our six approved templates without manual babysitting.

Environment

  • `untitledui` CLI: latest (run via `npx`)
  • macOS 14, bash and zsh both reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions