npm package: @linnify/cli
Description: CLI tool for the Linnify Registry
Latest version: 0.6.0

# @linnify/cli

CLI tool that pulls boilerplate and skills from the Linnify Registry.

## Installation

```bash
pnpm add -g @linnify/cli
```

Or run directly:

```bash
pnpm dlx @linnify/cli list
```

## Prerequisites

- [GitHub CLI](https://cli.github.com/) installed and authenticated (`gh auth login`)
- Access to the `linnify/linnify-registry` private repo

## Commands

### Boilerplate

Pull the full monorepo boilerplate with selected app starters. Each `--app` flag takes a JSON object with `name` (target folder inside `apps/`) and `app` (starter to use).

Available starters: `web`, `api`, `job`.

```bash
linnify boilerplate \
  --app='{"name":"web","app":"web"}' \
  --app='{"name":"admin","app":"web"}' \
  --app='{"name":"jobs","app":"job"}'
```

This copies the entire boilerplate (root configs, `packages/`, `.github/`, etc.) into the current directory, and creates only the selected apps inside `apps/`:

| `--app` value | Result |
|---------------|--------|
| `{"name":"web","app":"web"}` | `apps/web/` using the **web** starter (Next.js) |
| `{"name":"admin","app":"web"}` | `apps/admin/` using the **web** starter (Next.js) |
| `{"name":"jobs","app":"job"}` | `apps/jobs/` using the **job** starter (background jobs) |
| `{"name":"api","app":"api"}` | `apps/api/` using the **api** starter (Fastify) |

### Skills

Pull one or more skills into `.agents/skills/` with symlinks at `.claude/skills/` and `.cursor/skills/`:

```bash
linnify skills web                              # single skill
linnify skills web,terraform,document-feature   # multiple skills (comma-separated)
```

Available skills:

| Name | Aliases | Description |
|------|---------|-------------|
| `web` | — | Next.js conventions, server actions, data loading, forms |
| `terraform` | — | Terraform on GCP patterns, modules, environments |
| `document-feature` | `docs` | Product-focused feature documentation |
| `create-prompt` | `prompt` | LLM prompt creation patterns |

Files are placed in `.agents/skills/<name>/` and relative symlinks are created:
- `.claude/skills/<name>` → `../../.agents/skills/<name>`
- `.cursor/skills/<name>` → `../../.agents/skills/<name>`

### List

```bash
linnify list          # all starters and skills
linnify list:skills   # skills only
```

### Flags

| Flag | Applies to | Description |
|------|-----------|-------------|
| `--app <json>` | boilerplate | App to include (repeatable) |
| `--force` | boilerplate | Overwrite existing app directories |
| `--branch <b>` | all | Pull from a specific branch (default: `main`) |

## Development

```bash
cd cli
pnpm install
pnpm dev boilerplate --help      # run in dev mode
pnpm build                       # bundle to dist/index.js
pnpm type-check                  # typecheck only
```

## Adding new starters or skills

Edit `src/lib/config.ts` — starters are listed in `boilerplate.availableApps`, skills are auto-registered from the `skills` map.

## Publishing a new version

The package is published to the public npm registry as `@linnify/cli`.

**Prerequisites:** you must be logged in to npm with an account that has publish access to the `@linnify` org:

```bash
npm login
```

**Steps:**

1. Bump the version in `cli/package.json` following [semver](https://semver.org/):

   | Change type | Command |
   |-------------|---------|
   | Bug fix | `npm version patch` |
   | New feature (backwards-compatible) | `npm version minor` |
   | Breaking change | `npm version major` |

   Or edit the `"version"` field manually.

2. Publish from the `cli/` directory — the `prepublishOnly` script builds automatically:

   ```bash
   cd cli
   npm publish
   ```

3. Commit and push the version bump:

   ```bash
   git add cli/package.json
   git commit -m "chore(cli): release v$(node -p "require('./cli/package.json').version")"
   git push
   ```

> **Note:** The package is scoped (`@linnify/cli`) and published with `"access": "public"`, so no extra flags are needed.