npm package: @sirup/cli
Description: Deploy anything instantly — no auth required. npx sirup deploy .
Latest version: 0.1.0

# Sirup CLI

Deploy anything instantly from the command line — no auth required.

```bash
npx sirup deploy .
```

## Install

```bash
# Use directly (no install needed)
npx sirup deploy .

# Or install globally
npm install -g sirup
```

## Commands

### `sirup deploy [directory]`

Deploy a directory to sirup.gg. No account needed.

```bash
sirup deploy .
sirup deploy ./my-app --name my-dashboard
sirup deploy . --framework react
```

**Flags:**
- `-n, --name <name>` — Display name for the drop
- `-f, --framework <framework>` — Override auto-detection

**What it does:**
1. Zips the directory (respects `.gitignore` and `.sirupignore`)
2. Uploads to `POST /v1/deploy`
3. Streams build logs in real-time (SSE)
4. Prints the live URL + claim token
5. Saves claim token to `~/.sirup/tokens.json`

### `sirup status <slug>`

Check the status of a drop.

```bash
sirup status k7x9m
```

### `sirup logs <slug>`

Stream logs from a running drop.

```bash
sirup logs k7x9m                    # Runtime logs, follow mode
sirup logs k7x9m --no-follow        # Print and exit
sirup logs k7x9m --type build       # Build logs
sirup logs k7x9m --type access      # HTTP access logs
sirup logs k7x9m --tail 50          # Last 50 lines
```

**Flags:**
- `--follow / --no-follow` — Live stream or print and exit (default: follow)
- `--tail <n>` — Number of lines from end (default: 200)
- `--type <type>` — `runtime`, `build`, or `access` (default: runtime)

### `sirup claim <slug>`

Claim ownership of a drop.

```bash
sirup claim k7x9m --token ct_a8f29c3e...
sirup claim k7x9m    # Uses saved token from ~/.sirup/tokens.json
```

### `sirup delete <slug>`

Delete a drop.

```bash
sirup delete k7x9m
sirup delete k7x9m --yes    # Skip confirmation
```

### `sirup list`

List your owned drops (requires login).

```bash
sirup list
```

### `sirup login / logout / whoami`

```bash
sirup login      # GitHub device flow auth
sirup logout     # Clear saved credentials
sirup whoami     # Show current user
```

## File Ignoring

The CLI automatically excludes these from deploys:

- `node_modules/`, `.git/`, `.env`, `__pycache__/`, `dist/`, `build/`
- `.next/`, `.nuxt/`, `.cache/`, `coverage/`, `.venv/`, `venv/`
- `.DS_Store`, `Thumbs.db`, `*.pyc`

Add a `.sirupignore` file for custom patterns (same format as `.gitignore`).

## Token Storage

- Claim tokens: `~/.sirup/tokens.json`
- Auth session: `~/.sirup/auth.json`

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `SIRUP_API_URL` | `https://api.sirup.gg` | API base URL (for local dev) |

## GitHub Secrets Required

Set these in repo Settings → Secrets → Actions:

| Secret | What it is |
|--------|-----------|
| `NPM_TOKEN` | npm access token (Automation type) |

## CI/CD

Push a version tag triggers npm publish:

```bash
npm version patch    # bumps version in package.json
git push --tags      # triggers CI → npm publish
```

## Project Structure

```
src/
├── index.js                 # CLI entry (commander)
├── commands/
│   ├── deploy.js            # Zip + upload + SSE build logs
│   ├── status.js            # Fetch + display drop info
│   ├── claim.js             # Claim with saved/provided token
│   ├── logs.js              # SSE log streaming with color
│   ├── delete.js            # Delete with confirmation prompt
│   ├── list.js              # Table of owned drops
│   └── login.js             # GitHub device flow + logout + whoami
└── util/
    ├── api.js               # API client, token storage (~/.sirup/)
    └── zip.js               # Archiver with .gitignore/.sirupignore support
```