npm package: @shopcrisp/cli
Description: Crisper command line interface
Latest version: 0.1.5

# @shopcrisp/cli

Command line interface for online grocery store Crisp.

## Quickstart

```bash
npx @shopcrisp/cli auth login
npx @shopcrisp/cli search "bananas"
npx @shopcrisp/cli cart add 10827 --quantity 2 --yes
npx @shopcrisp/cli cart slot set
npx @shopcrisp/cli cart validate
npx @shopcrisp/cli cart order --yes
```

## Discovery

```bash
npx @shopcrisp/cli --list
npx @shopcrisp/cli cart --list
npx @shopcrisp/cli describe cart add --output json
```

Use `--list` to discover capabilities and `describe <path>` to inspect a command before running it.

## Output Modes

- `--output text`: human-readable terminal output
- `--output plain`: parse-friendly line output
- `--output json`: structured JSON envelopes

When stdout is not a TTY, the CLI defaults to `json`.

## Auth

- `CRISPER_TOKEN` overrides the local session file when present
- local sessions are stored in `~/.crisper/config.json`
- use `crisper auth` to inspect the active auth source
- use `crisper auth login` to create or refresh a local session

## Write Safety

- mutating commands support `--dry-run`
- headless write commands require `--yes`
- interactive TTY flows can confirm writes or prompt for slot selection when supported

For repeatable scripted usage, prefer `--output json` on reads and `--dry-run` before writes.

## Cart Flow

```bash
npx @shopcrisp/cli search "bananas"
npx @shopcrisp/cli recommendations
npx @shopcrisp/cli cart list
npx @shopcrisp/cli cart validate
npx @shopcrisp/cli cart slot
npx @shopcrisp/cli cart slot list
npx @shopcrisp/cli cart slot set
npx @shopcrisp/cli cart order --yes
```

`cart list` includes the currently selected delivery slot when one exists. `cart validate` checks whether the current cart can be ordered before `cart order` attempts the write.

## Slot Selection

```bash
npx @shopcrisp/cli cart slot
npx @shopcrisp/cli cart slot list
npx @shopcrisp/cli cart slot set
npx @shopcrisp/cli cart slot set "slot:2026-04-02|17:00|18:00" --yes
```

- `cart slot` shows the current slot
- `cart slot list` shows available slots and cart issue counts for each slot
- `cart slot set` opens an interactive selector in a TTY when no slot id is provided
- `cart slot set <slot>` also accepts a slot token for headless usage

## Saved Products

```bash
npx @shopcrisp/cli saved list
npx @shopcrisp/cli saved add 10827 --dry-run
npx @shopcrisp/cli saved add 10827 --yes
npx @shopcrisp/cli saved remove 10827 --yes
```

## Common Mutations

```bash
npx @shopcrisp/cli cart add 10827 --quantity 2 --dry-run
npx @shopcrisp/cli cart add 10827 --quantity 2 --yes
npx @shopcrisp/cli cart set 10827 --quantity 0 --yes
npx @shopcrisp/cli cart clear --yes
```

## Automation

```bash
npx @shopcrisp/cli cart validate --output json
npx @shopcrisp/cli describe cart order --output json
npx @shopcrisp/cli cart add 10827 --quantity 2 --dry-run --output json
```

Commands support three usage patterns:

- interactive terminal usage with `text` output and TTY prompts
- parse-friendly shell usage with `plain` output
- structured integration usage with `json` output

For non-interactive flows, use `--output json` and pass `--yes` on mutating commands.