harn cookies
harn cookies [--store <path>] <subcommand> [options]Manages the shared browser cookie store at ~/.cache/harnery/cookies.json. The format is CDP-native, so the same jar is read and written by harn browse, harn browse-ai, and harn fetch, and it round-trips cleanly with Playwright and agent-browser. Use it to inspect what’s stored, set a cookie by hand, produce a Cookie: header for another tool, or move a jar between tools.
Running harn cookies with no subcommand lists the store (same as harn cookies list). Use --store <path> for a separate jar (e.g. one per environment); it goes before the subcommand.
Subcommands
Section titled “Subcommands”harn cookies list [--domain <d>] [--json] # list cookies, grouped by domainharn cookies set <name> <value> --domain <d> # set a cookie (creates the file if missing)harn cookies clear (--domain <d> | --all) # remove matching cookies, or wipe everythingharn cookies header <url> # print a Cookie: header value for the URLharn cookies import <file> [--replace] # merge cookies from a JSON fileharn cookies export <file> # write the store to a fileharn cookies info [--json] # store path, size, counts, exporting toolOptions by subcommand
Section titled “Options by subcommand”list—--domain <domain>filters to one domain;--jsonfor machine output.set—--domain <domain>is required (e.g..example.com). Also--path <path>(default/),--secure,--httpOnly,--sameSite <Strict|Lax|None>,--expires <unix-seconds>(omit for a session cookie).clear— one of--domain <domain>(drop cookies for a single domain) or--all(wipe cookies + origins) is required.import—--replacereplaces the entire store instead of merging by(name, domain, path).
Examples
Section titled “Examples”# List everything in the default jar, grouped by domainharn cookies list
# List one domain as JSONharn cookies list --domain .example.com --json
# Set a secure session cookieharn cookies set session_id abc123 --domain .example.com --secure --httpOnly
# Emit a Cookie: header for use with another HTTP clientharn cookies header https://example.com/
# Drop cookies for one domain, or wipe the whole jarharn cookies clear --domain example.comharn cookies clear --all
# Move a jar between toolsharn cookies export /path/to/backup.jsonharn cookies import /path/to/backup.json --replace
# Operate on a separate jar (--store goes before the subcommand)harn cookies --store /path/to/other.json info