Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color control to goose cli #1089

Closed
nyonson opened this issue Feb 5, 2025 · 0 comments · Fixed by #1098 · May be fixed by #1092
Closed

Add color control to goose cli #1089

nyonson opened this issue Feb 5, 2025 · 0 comments · Fixed by #1098 · May be fixed by #1092

Comments

@nyonson
Copy link
Contributor

nyonson commented Feb 5, 2025

I would like goose cli to blend in with the rest of my cli and only use the base 16 colors of my terminal emulator.

I believe there are a handful of dependencies goose uses which control some parts of the output, bat, cliclack, console, rustyline. Some of these currently respect a NO_COLOR environment variable being set. But that is a bit drastic and not consistent throughout the app. Ideally goose exposed a control for colors.

jasonkneen added a commit to jasonkneen/goose that referenced this issue Feb 5, 2025
Fixes block#1089

Add color control to goose CLI to use base 16 colors of the terminal emulator.

* Add a new `--color` option to the CLI parser in `crates/goose-cli/src/main.rs` with options `auto`, `always`, `never`, and `base16`.
* Update the `main` function in `crates/goose-cli/src/main.rs` to handle the `--color` option and set the appropriate environment variable.
* Pass the `--color` option to the `handle_configure` function in `crates/goose-cli/src/commands/configure.rs`.
* Update the `configure_provider_dialog`, `toggle_extensions_dialog`, and `configure_extensions_dialog` functions in `crates/goose-cli/src/commands/configure.rs` to respect the `--color` option.
* Update the `RustylinePrompt` struct in `crates/goose-cli/src/prompt/rustyline.rs` to include a `color_mode` field and initialize it based on the `--color` option.
* Update the `render`, `print_markdown`, and `print_params` functions in `crates/goose-cli/src/prompt/renderer.rs` to respect the `color_mode` field.
* Add documentation for the new `--color` option in `documentation/docs/guides/goose-cli-commands.md`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/1089?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant