Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions crates/goose-cli/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use serde_json::Value;
use std::collections::HashMap;
use std::error::Error;

use crate::commands::configure_settings::configure_nested_hints_dialog;
use crate::recipes::github_recipe::GOOSE_RECIPE_GITHUB_REPO_CONFIG_KEY;

// useful for light themes where there is no dicernible colour contrast between
Expand Down Expand Up @@ -1081,6 +1082,11 @@ pub async fn configure_settings_dialog() -> Result<(), Box<dyn Error>> {
"Scheduler Type",
"Choose between built-in cron scheduler or Temporal workflow engine",
)
.item(
"nested_hints",
"Nested Goose Hints",
"Enable loading hints files (eg: .goosehints) from current directory up to project root (.git) or current directory if no .git directory found",
)
.interact()?;

match setting_type {
Expand Down Expand Up @@ -1108,6 +1114,9 @@ pub async fn configure_settings_dialog() -> Result<(), Box<dyn Error>> {
"scheduler" => {
configure_scheduler_dialog()?;
}
"nested_hints" => {
configure_nested_hints_dialog()?;
}
_ => unreachable!(),
};

Expand Down
39 changes: 39 additions & 0 deletions crates/goose-cli/src/commands/configure_settings.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use cliclack;
use console::style;
use goose::config::Config;
use serde_json::Value;
use std::error::Error;

pub fn configure_nested_hints_dialog() -> Result<(), Box<dyn Error>> {
let config = Config::global();

if std::env::var("GOOSE_NESTED_HINTS").is_ok() {
let _ = cliclack::log::info("Notice: GOOSE_NESTED_HINTS environment variable is set and will override the configuration here.");
}

let current_enabled: bool = config.get_param("NESTED_GOOSE_HINTS").unwrap_or(false);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think enabled could be a better default here, and people would only need to seek out the config option if they didn't want it for some reason.


println!(
"Current nested hints setting: {}",
style(if current_enabled {
"enabled"
} else {
"disabled"
})
.cyan()
);

let enable = cliclack::confirm("Enable nested hint files loading (eg: .goosehints)?")
.initial_value(current_enabled)
.interact()?;

config.set_param("NESTED_GOOSE_HINTS", Value::Bool(enable))?;

if enable {
cliclack::outro("✓ Nested hints enabled - Goose will load hint files from current directory upwards to project root (.git) or current directory if no .git directory found")?;
} else {
cliclack::outro("✓ Nested hints disabled - Goose will only load hint files from the current working directory")?;
}

Ok(())
}
1 change: 1 addition & 0 deletions crates/goose-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod bench;
pub mod configure;
pub mod configure_settings;
pub mod info;
pub mod mcp;
pub mod project;
Expand Down
1 change: 1 addition & 0 deletions crates/goose-mcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ glob = "0.3"
[dev-dependencies]
serial_test = "3.0.0"
sysinfo = "0.32.1"
temp-env = "0.3.6"

[features]
utoipa = ["dep:utoipa"]
Loading
Loading