MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / run_web_command

Function run_web_command

crates/opencode-cli/src/main.rs:1912–1929  ·  view source on GitHub ↗
(
    port: u16,
    hostname: String,
    mdns: bool,
    mdns_domain: String,
    cors: Vec<String>,
)

Source from the content-addressed store, hash-verified

1910}
1911
1912async fn run_web_command(
1913 port: u16,
1914 hostname: String,
1915 mdns: bool,
1916 mdns_domain: String,
1917 cors: Vec<String>,
1918) -> anyhow::Result<()> {
1919 let bind_port = if port == 0 { 3000 } else { port };
1920 let display_host = if hostname == "0.0.0.0" {
1921 "localhost".to_string()
1922 } else {
1923 hostname.clone()
1924 };
1925 let url = format!("http://{}:{}", display_host, bind_port);
1926 println!("Web interface: {}", url);
1927 try_open_browser(&url);
1928 run_server_command("web", bind_port, hostname, mdns, mdns_domain, cors).await
1929}
1930
1931async fn run_acp_command(
1932 port: u16,

Callers 1

mainFunction · 0.85

Calls 3

try_open_browserFunction · 0.85
run_server_commandFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected