Skip to main content

codetether_agent/cli/browserctl/
offline_args.rs

1use clap::Subcommand;
2use std::path::PathBuf;
3
4#[derive(Subcommand, Debug)]
5pub enum OfflineCommand {
6    /// Record an auth flow: redirect chain, Set-Cookie per hop, final URL
7    AuthTrace {
8        url: String,
9        #[arg(long, default_value_t = 10)]
10        max_redirects: u8,
11    },
12    /// Diff two JSON cookie jars (lists of {name, value, attrs})
13    CookieDiff { before: PathBuf, after: PathBuf },
14    /// Explain a CORS preflight: send OPTIONS, classify Allow-Origin/Methods
15    ExplainCors {
16        url: String,
17        #[arg(long)]
18        origin: String,
19        #[arg(long, default_value = "GET")]
20        method: String,
21    },
22    /// Capture an HTTP GET (status + headers + body) to a JSON file
23    Record {
24        url: String,
25        #[arg(long)]
26        out: PathBuf,
27    },
28    /// Replay a captured response through a deterministic browser session
29    Replay { capture: PathBuf },
30}