mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 10:05:18 +00:00
feat: [US-002] - Register install browser subcommand in CLI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b6ba8e29ef
commit
f8a220c53b
1 changed files with 23 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ mod build_version {
|
|||
include!(concat!(env!("OUT_DIR"), "/version.rs"));
|
||||
}
|
||||
|
||||
use crate::browser_install::{install_browser, BrowserInstallRequest};
|
||||
use crate::desktop_install::{install_desktop, DesktopInstallRequest, DesktopPackageManager};
|
||||
use crate::router::{
|
||||
build_router_with_state, shutdown_servers, AppState, AuthConfig, BrandingMode,
|
||||
|
|
@ -169,6 +170,8 @@ pub struct DaemonArgs {
|
|||
pub enum InstallCommand {
|
||||
/// Install desktop runtime dependencies.
|
||||
Desktop(InstallDesktopArgs),
|
||||
/// Install browser (Chromium) dependencies.
|
||||
Browser(InstallBrowserArgs),
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
|
|
@ -337,6 +340,16 @@ pub struct InstallDesktopArgs {
|
|||
no_fonts: bool,
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
pub struct InstallBrowserArgs {
|
||||
#[arg(long, default_value_t = false)]
|
||||
yes: bool,
|
||||
#[arg(long, default_value_t = false)]
|
||||
print_only: bool,
|
||||
#[arg(long, value_enum)]
|
||||
package_manager: Option<DesktopPackageManager>,
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
pub struct CredentialsExtractArgs {
|
||||
#[arg(long, short = 'a', value_enum)]
|
||||
|
|
@ -444,6 +457,7 @@ pub fn run_command(command: &Command, cli: &CliConfig) -> Result<(), CliError> {
|
|||
fn run_install(command: &InstallCommand) -> Result<(), CliError> {
|
||||
match command {
|
||||
InstallCommand::Desktop(args) => install_desktop_local(args),
|
||||
InstallCommand::Browser(args) => install_browser_local(args),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -522,6 +536,15 @@ fn install_desktop_local(args: &InstallDesktopArgs) -> Result<(), CliError> {
|
|||
.map_err(CliError::Server)
|
||||
}
|
||||
|
||||
fn install_browser_local(args: &InstallBrowserArgs) -> Result<(), CliError> {
|
||||
install_browser(BrowserInstallRequest {
|
||||
yes: args.yes,
|
||||
print_only: args.print_only,
|
||||
package_manager: args.package_manager,
|
||||
})
|
||||
.map_err(CliError::Server)
|
||||
}
|
||||
|
||||
fn run_agents(command: &AgentsCommand, cli: &CliConfig) -> Result<(), CliError> {
|
||||
match command {
|
||||
AgentsCommand::List(args) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue