open-index/open-npm huggingface dataset:
npm package: @kuizuo/get-cookie
Description: CLI tool to read cookies from local browsers
Author: kuizuo
Latest version: 0.1.1

# get-local-cookie

A simple CLI and library to fetch cookies for a given URL from local browsers (Chrome, Edge, etc.). Includes npx usage for quick one-off runs.

## Requirements

- Node >=24 (for node:sqlite) or Bun (for bun:sqlite)
- Local usage only: this reads from your machine’s browser profiles.

## Use

### Recommended: npx (no global install needed)

```bash
npx @kuizuo/get-cookie <url> --browser chrome --format header
```

Examples:
```bash
# Get cookies for github.com (default: Chrome, JSON)
npx @kuizuo/get-cookie https://github.com

# Use Edge and output as Cookie header
npx @kuizuo/get-cookie https://github.com --browser chrome --format header

# If macOS does not have the right to read the keychain, use sudo to let security read the keychain
sudo npx @kuizuo/get-cookie https://github.com --browser edge --format header
```

**CLI options**
- `<url>`: target URL.
- `-b, --browser <browser>`: browser type (`chrome`, `edge`, `brave`, `arc`, `vivaldi`, `opera`). Default `chrome`.
- `-f, --format <format>`: `json` or `header`. Default `json`.

### Use as a library (API)

see: https://github.com/steipete/sweet-cookie#library-usage

## Credit

- Powered by [`@steipete/sweet-cookie`](https://github.com/steipete/sweet-cookie)