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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ deepseek resume --last # resume the most recent sessio
deepseek resume <SESSION_ID> # resume a specific session by UUID
deepseek fork <SESSION_ID> # fork a session at a chosen turn
deepseek serve --http # HTTP/SSE API server
deepseek serve --mobile # phone-friendly local remote control page
deepseek serve --acp # ACP stdio adapter for Zed/custom agents
deepseek pr <N> # fetch PR and pre-seed review prompt
deepseek mcp list # list configured MCP servers
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ deepseek resume --last # 恢复最近会话
deepseek resume <SESSION_ID> # 按 UUID 恢复指定会话
deepseek fork <SESSION_ID> # 在指定轮次分叉会话
deepseek serve --http # HTTP/SSE API 服务
deepseek serve --mobile # 适配手机的本地远程控制页面
deepseek pr <N> # 获取 PR 并预填审查提示
deepseek mcp list # 列出已配置 MCP 服务器
deepseek mcp validate # 校验 MCP 配置和连接
Expand Down
23 changes: 19 additions & 4 deletions crates/tui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ struct ServeArgs {
/// Start runtime HTTP/SSE API server
#[arg(long)]
http: bool,
/// Start runtime HTTP server with the built-in mobile control page
#[arg(long)]
mobile: bool,
/// Start ACP server over stdio for editor clients such as Zed
#[arg(long)]
acp: bool,
Expand All @@ -407,6 +410,10 @@ struct ServeArgs {
/// `[runtime_api] cors_origins` from `config.toml`. Whalescale#255.
#[arg(long = "cors-origin", value_name = "URL")]
cors_origin: Vec<String>,
/// Bearer token for HTTP runtime API access. If omitted in --mobile mode,
/// a one-time token is generated and printed at startup.
#[arg(long = "auth-token", value_name = "TOKEN")]
auth_token: Option<String>,
}

#[derive(Subcommand, Debug, Clone)]
Expand Down Expand Up @@ -694,26 +701,34 @@ async fn main() -> Result<()> {
let workspace = cli.workspace.clone().unwrap_or_else(|| {
std::env::current_dir().unwrap_or_else(|_| PathBuf::from("."))
});
let selected_modes = [args.mcp, args.http, args.acp]
let http_selected = args.http || args.mobile;
let selected_modes = [args.mcp, http_selected, args.acp]
.into_iter()
.filter(|selected| *selected)
.count();
if selected_modes != 1 {
bail!("Choose exactly one server mode: --mcp, --http, or --acp");
bail!("Choose exactly one server mode: --mcp, --http/--mobile, or --acp");
}
if args.mcp {
mcp_server::run_mcp_server(workspace)
} else if args.http {
} else if http_selected {
let config = load_config_from_cli(&cli)?;
let cors_origins = resolve_cors_origins(&config, &args.cors_origin);
let host = if args.mobile && args.host == "127.0.0.1" {
"0.0.0.0".to_string()
} else {
args.host
};
runtime_api::run_http_server(
config,
workspace,
runtime_api::RuntimeApiOptions {
host: args.host,
host,
port: args.port,
workers: args.workers.clamp(1, 8),
cors_origins,
mobile: args.mobile,
auth_token: args.auth_token,
},
)
.await
Expand Down
Loading