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 #1092

Closed
wants to merge 1 commit into from

Conversation

jasonkneen
Copy link

@jasonkneen jasonkneen commented Feb 5, 2025

Fixes #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.

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).
@nyonson
Copy link
Contributor

nyonson commented Feb 5, 2025

I think I have a less intrusive patch for this: #1098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add color control to goose cli
3 participants