open-index/open-npm huggingface dataset:
npm package: @satori-sh/cli
Description: Satori Memory CLI
Latest version: 0.1.10

# satori

Satori Memory CLI

## Installation

Using Node (recommended):
```bash
npm install -g @satori-sh/cli
```

Using npm:
```bash
npm install -g @satori-sh/cli
```

## Usage

### Chat (Default)

Start memory-augmented chat sessions:
```bash
satori "What's the best pizza topping?"
```

If you run via npm scripts, pass flags after `--`:
```bash
npm start -- --api-key "$SATORI_API_KEY" --memory-id my-id "hello"
```

### Interactive TUI (removed)

This TUI was removed for now. To re-implement later:
- restore `src/ui.tsx` and `src/logo.ts` from git history
- re-add deps: `@opentui/core`, `@opentui/solid`, `solid-js`, `cli-spinners`
- restore `build.ts` plugin `@opentui/solid/bun-plugin`
- wire `runInteractiveApp` back into `src/index.ts` for TTY

### Search Memories

Query the memory database:
```bash
satori search "what is my favorite food?"
```

### Add Memory

Add new memories:
```bash
satori add "I like pizza"
```

### Subscribe

Open checkout in the browser:
```bash
npx @satori-sh sub
```

**Options & Memory:**
- `--memory-id <id>` (scopes conversations)

**Memory Sessions:** If no `--memory-id` is provided, a random ID is generated. Set `SATORI_MEMORY_ID=generated-id` to continue sessions:
```bash
export SATORI_MEMORY_ID=example-words-joined
satori chat "Follow up question"
```

## Configuration

**Required:**
- `SATORI_API_KEY` - Satori authentication key

**Optional:**
- `SATORI_BASE_URL` (default: http://localhost:8000)
- `SATORI_CHECKOUT_URL` - Stripe checkout link for `npx @satori-sh sub`
- `SATORI_MEMORY_ID` - Session scoping
- `SATORI_MOCK` - Enable mock mode
- `OPENAI_API_KEY` - Pass-through OpenAI key for `/ask` (sent as `X-OpenAI-Key`)
- `NODE_ENV` - Set to `development` to default to `http://localhost:8000`

Example:
```bash
NODE_ENV=development bun run src/index.ts
```

## Troubleshooting

- **API Key Errors**: Ensure `SATORI_API_KEY` is set
- **Memory Server Down**: Chat requests to `/ask` will fail
- **Memory ID Issues**: Invalid IDs scope searches but don't break functionality

## Contributing

### Publishing

1. Update version: `npm version patch|minor|major`
2. Publish beta: `npm publish --tag beta`
3. Test: `npm install @satori-sh/cli@beta`
4. Promote: `npm dist-tag add @satori-sh/cli@<version> latest`

### Notes
- Uses ES modules for modern compatibility
- `prepublishOnly` builds automatically
- Test beta versions before promoting
- OTP required for publishing