Skip to content
Open
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
494 changes: 489 additions & 5 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ headers = "0.4.1"
http = "1.4.0"
http-body = "1.0.1"
http-body-util = "0.1.3"
hudsucker = "0.24"
open = "5.3.4"
rcgen = "0.14"
reqwest = { version = "0.13.2", default-features = false }
regex = "1.12.3"
self_update = { version = "0.44.0", default-features = false }
Expand Down
9 changes: 8 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ self_update = { workspace = true, optional = true, features = ["reqwest", "rustl
time = { workspace = true, features = ["formatting", "parsing", "serde"] }
unicode-width.workspace = true

# `relay` feature: MITM proxy that reroutes LLM inference through the Edgee gateway
bytes = { workspace = true, optional = true }
http-body-util = { workspace = true, optional = true }
hudsucker = { workspace = true, optional = true }
rcgen = { workspace = true, optional = true }

[dev-dependencies]
tempfile = "3"

[target.'cfg(windows)'.dependencies]
which = "8"

[features]
default = ["self-update"]
default = ["self-update", "relay"]
self-update = ["dep:self_update"]
relay = ["dep:hudsucker", "dep:rcgen", "dep:http-body-util", "dep:bytes"]
4 changes: 4 additions & 0 deletions crates/cli/src/commands/auth/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ pub fn agent_label(provider: &str) -> &'static str {
"codex" => "Codex",
"opencode" => "OpenCode",
"crush" => "Crush",
"copilot" => "GitHub Copilot",
_ => "your agent",
}
}
Expand Down Expand Up @@ -289,6 +290,7 @@ fn coding_assistant_name(provider: &str) -> Result<&'static str> {
"codex" => Ok("codex"),
"opencode" => Ok("opencode"),
"crush" => Ok("crush"),
"copilot" => Ok("copilot"),
_ => anyhow::bail!("Unsupported provider `{provider}`"),
}
}
Expand All @@ -303,6 +305,7 @@ fn provider_config_mut<'a>(
"codex" => Ok(&mut creds.codex),
"opencode" => Ok(&mut creds.opencode),
"crush" => Ok(&mut creds.crush),
"copilot" => Ok(&mut creds.copilot),
_ => anyhow::bail!("Unsupported provider `{provider}`"),
}
}
Expand All @@ -317,6 +320,7 @@ fn provider_config<'a>(
"codex" => Ok(creds.codex.as_ref()),
"opencode" => Ok(creds.opencode.as_ref()),
"crush" => Ok(creds.crush.as_ref()),
"copilot" => Ok(creds.copilot.as_ref()),
_ => anyhow::bail!("Unsupported provider `{provider}`"),
}
}
Expand Down
10 changes: 10 additions & 0 deletions crates/cli/src/commands/launch/claude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ pub struct Options {
#[arg(long)]
pub local_gateway: bool,

/// Launch through a local relay (MITM) proxy — same as `edgee relay claude`.
#[cfg(feature = "relay")]
#[arg(long)]
pub relay: bool,

/// Extra args passed through to the claude CLI
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
pub args: Vec<String>,
}

pub async fn run(opts: Options) -> Result<()> {
#[cfg(feature = "relay")]
if opts.relay {
return crate::commands::relay::run_for_agent("claude").await;
}

let mut creds = crate::config::read()?;

// Step 1: ensure we are authenticated
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod codebuddy;
pub mod codex;
pub mod crush;
pub mod opencode;
mod util;
pub(crate) mod util;

use anyhow::Result;
use console::style;
Expand Down
8 changes: 7 additions & 1 deletion crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ setup_commands! {
Stats(stats),
/// Render the Edgee statusline and manage agent statusline integrations
Statusline(statusline),
[cfg(feature = "relay")]
/// Relay LLM API traffic through the Edgee gateway via a local MITM proxy
#[command(hide = true)]
Relay(relay),
/// Reset Edgee credentials and connection mode
Reset(reset),
[cfg(feature = "self-update")]
/// Update Edgee
SelfUpdate(update),
#[command(visible_alias = "self-update")]
Update(update),

}
Loading