npm package: @shipi/cli
Description: AI-powered release notes generator - analyze git history and code changes to create meaningful release notes
Latest version: 0.0.4

# @shipi/cli

AI-powered release notes generator that analyzes your git history and code changes to automatically create meaningful release notes.

## Installation

```bash
npm install -g @shipi/cli
```

## Quick Start

```bash
# 1. Authenticate
shipi login

# 2. Initialize your project (optional but recommended)
shipi init

# 3. Generate release notes
shipi generate v1.0.0
```

## Commands

### `shipi login`

Authenticate with your Shipi account via browser-based OAuth.

### `shipi logout`

Clear stored credentials.

### `shipi whoami`

Display current authenticated user information.

### `shipi usage`

Show API usage quota and plan limits.

### `shipi init`

Initialize a `shipi.json` configuration file in your project and link it to your Shipi account.

### `shipi generate [range]`

Generate release notes for the specified range of commits.

**Arguments:**

- `[range]` - Git revision range (e.g., `v1.0.0..v1.1.0`) or single tag

**Options:**

| Option | Description |
|--------|-------------|
| `--from <ref>` | Start from specific commit/tag |
| `-o, --output <file>` | Save output to file instead of stdout |
| `-f, --format <format>` | Output format: `md` (default) or `json` |
| `-a, --audience <type>` | Target audience: `internal`, `customer`, or `changelog` |
| `--dry-run` | Preview commits without calling API |
| `--no-diffs` | Disable code diff analysis |
| `--no-header` | Omit changelog header |
| `-l, --language <lang>` | Output language (e.g., `en`, `nl`, `de`) |
| `-u, --uncommitted` | Generate from uncommitted changes |
| `--max-diff-size <bytes>` | Max diff size per file (default: 5000) |
| `-v, --verbose` | Log full payload before sending |
| `--premium` | Use Claude instead of GPT (requires Pro/Team plan) |
| `--tickets` | Include ticket numbers in internal notes |

**Examples:**

```bash
# Generate notes for a specific tag
shipi generate v1.2.0

# Generate notes for a range
shipi generate v1.0.0..v1.1.0

# Generate customer-facing notes
shipi generate v1.0.0 --audience customer

# Preview what will be analyzed
shipi generate --dry-run

# Generate from uncommitted changes
shipi generate --uncommitted

# Save to file in German
shipi generate v1.0.0 -o CHANGELOG.md -l de
```

## Configuration

Create a `shipi.json` file in your project root (or run `shipi init`):

```json
{
  "projectId": "proj_xxx",
  "language": "en",
  "maxDiffSize": 5000,
  "include": ["src/**", "lib/**"],
  "exclude": ["**/*.test.ts", "**/*.spec.ts"],
  "extensions": [".ts", ".tsx", ".js", ".jsx"]
}
```

| Field | Description |
|-------|-------------|
| `projectId` | Links to your Shipi dashboard project |
| `language` | Default output language |
| `maxDiffSize` | Maximum bytes per file diff (default: 5000) |
| `include` | Glob patterns for paths to analyze |
| `exclude` | Glob patterns for paths to ignore |
| `extensions` | File extensions to include in analysis |

## Audience Types

- **internal** - Technical details for developers, includes code changes and optionally ticket numbers
- **customer** - User-friendly notes highlighting features and improvements
- **changelog** - Brief summary format suitable for CHANGELOG files

## Environment Variables

| Variable | Description |
|----------|-------------|
| `SHIPI_API_KEY` | Override stored API key |

## How It Works

1. Analyzes your git commits and code diffs
2. Detects your tech stack and project context
3. Groups changes by type (features, fixes, breaking changes, etc.)
4. Uses AI to generate meaningful, contextual release notes
5. Outputs in your preferred format and language

## License

MIT