Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
525 changes: 524 additions & 1 deletion Cargo.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions crates/goose-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ sha2 = { workspace = true }
sigstore-verify = { version = "=0.6.5", default-features = false }
axum.workspace = true


cdk = { version = "0.16", default-features = false, features = ["wallet"] }
cdk-redb = { version = "0.16", default-features = false, features = ["wallet"] }
home = "0.5"
bip39 = { version = "2.1", features = ["rand"] }

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { workspace = true }

Expand Down
21 changes: 21 additions & 0 deletions crates/goose-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::commands::schedule::{
handle_schedule_sessions,
};
use crate::commands::session::{handle_session_list, handle_session_remove};
use crate::commands::wallet::{handle_wallet_balance, handle_wallet_topup, handle_wallet_withdraw};
use crate::recipes::extract_from_cli::extract_recipe_info_from_cli;
use crate::recipes::recipe::{explain_recipe, render_recipe_as_yaml};
use crate::session::{build_session, SessionBuilderConfig};
Expand Down Expand Up @@ -274,6 +275,13 @@ pub struct InputOptions {
pub render_recipe: bool,
}

#[derive(Subcommand)]
enum WalletCommand {
Balance {},
Topup { token: String },
Withdraw { amount: Option<u64> },
}

/// Output configuration options for the run command
#[derive(Args, Debug, Clone)]
pub struct OutputOptions {
Expand Down Expand Up @@ -726,6 +734,13 @@ enum Command {
#[command(about = "Configure goose settings")]
Configure {},

/// Manage the local Cashu wallet (balance, topup, withdraw)
#[command(about = "Manage the local Cashu wallet (balance, topup, withdraw)")]
Wallet {
#[command(subcommand)]
command: WalletCommand,
},

/// Display goose configuration information
#[command(about = "Display goose information")]
Info {
Expand Down Expand Up @@ -1063,6 +1078,7 @@ fn get_command_name(command: &Option<Command>) -> &'static str {
Some(Command::Configure {}) => "configure",
Some(Command::Doctor {}) => "doctor",
Some(Command::Info { .. }) => "info",
Some(Command::Wallet { .. }) => "wallet",
Some(Command::Mcp { .. }) => "mcp",
Some(Command::Acp { .. }) => "acp",
Some(Command::Serve { .. }) => "serve",
Expand Down Expand Up @@ -1815,6 +1831,11 @@ pub async fn cli() -> anyhow::Result<()> {
Some(Command::Configure {}) => handle_configure().await,
Some(Command::Doctor {}) => crate::commands::doctor::handle_doctor().await,
Some(Command::Info { verbose, check }) => handle_info(verbose, check).await,
Some(Command::Wallet { command }) => match command {
WalletCommand::Balance {} => handle_wallet_balance().await,
WalletCommand::Topup { token } => handle_wallet_topup(token).await,
WalletCommand::Withdraw { amount } => handle_wallet_withdraw(amount).await,
},
Some(Command::Mcp { server }) => handle_mcp_command(server).await,
Some(Command::Acp { builtins }) => goose::acp::server::run(builtins).await,
Some(Command::Serve {
Expand Down
10 changes: 10 additions & 0 deletions crates/goose-cli/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,16 @@ pub async fn configure_provider_dialog() -> anyhow::Result<bool> {
}
}

// Routstr's profile system replaces the standard config-key prompt
// for this provider. Asking the user for a URL here, *before* the
// model fetch, lets goose configure stay coherent: the picker always
// runs against whichever URL the user just chose. Selecting an URL
// that matches an existing profile auto-switches (with refund);
// entering a new URL creates a `default` profile.
if provider_name == "routstr" {
crate::commands::routstr::prompt_and_set_routstr_url().await?;
}

let non_primary_keys: Vec<_> = provider_meta
.config_keys
.iter()
Expand Down
3 changes: 3 additions & 0 deletions crates/goose-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ pub mod info;
pub mod plugin;
pub mod project;
pub mod recipe;
pub mod routstr;
pub mod routstr_pending;
pub mod schedule;
pub mod session;
pub mod term;
pub mod update;
pub mod wallet;
Loading
Loading