npm package: @invariant.guru/cli
Description: CLI tool for managing Claude AI specification invariants
Latest version: 0.3.15

# Invariant CLI

A package manager for Claude AI specification files. Install, compose, and manage reusable markdown instruction blocks for your `CLAUDE.md` files.

## Installation

```bash
yarn global add @invariant--labs/cli
```

## Quick Start

```bash
# Initialize a project
invariant init

# Install a package
invariant install everything-claude-code

# Add items from the package
invariant add agent:everything-claude-code/planner

# Generate CLAUDE.md
invariant claude
```

## Commands

### `invariant init`

Initialize Invariant in your project. Creates `invariant.json` and `.invariant/` directory.

```bash
invariant init
invariant init --name my-project
```

### `invariant install [package]`

Install a package from the registry.

```bash
invariant install everything-claude-code
```

### `invariant add <target> [<target>...]`

Activate items from installed packages. Accepts one or more targets.

```bash
# Add all items from a package
invariant add everything-claude-code

# Add a specific agent
invariant add agent:everything-claude-code/planner

# Add multiple items at once
invariant add skill:my-pkg/react-expert skill:my-pkg/ts-patterns

# Mix types and packages
invariant add agent:pkg-a/planner skill:pkg-b/tdd
```

### `invariant remove <target> [<target>...]`

Remove added items (inverse of `add`). The package stays in cache for future use. Accepts one or more targets.

```bash
# Remove all active items from a package
invariant remove everything-claude-code

# Remove a specific agent
invariant remove agent:everything-claude-code/planner

# Remove multiple items at once
invariant remove skill:my-pkg/react-expert skill:my-pkg/ts-patterns
```

### `invariant uninstall <package>`

Completely remove a package: deletes all added items, removes from cache, and removes from config.

```bash
invariant uninstall everything-claude-code
```

### `invariant inspect [package]`

Show package contents with active items highlighted.

**Without a target** — shows only active (added) items across all installed packages:

```bash
invariant inspect
```

```
everything-claude-code@main
────────────────────────────────────────
  agents/
    ✓ planner
  skills/
    ✓ backend-patterns/SKILL
```

**With `--details`** — shows all items (active and inactive) across all packages:

```bash
invariant inspect --details
```

```
everything-claude-code@main
────────────────────────────────────────
  agents/
    ✓ planner
    ○ architect
    ○ code-reviewer
  skills/
    ✓ backend-patterns/SKILL
    ○ tdd-workflow/SKILL
  contexts/
    ○ dev
    ○ review
```

**With a specific package** — always shows all items (active and inactive):

```bash
invariant inspect everything-claude-code
```

| Flag | Description |
|------|-------------|
| `-d, --details` | Show all items including inactive ones |

### `invariant list`

List installed or available packages.

```bash
invariant list              # List installed packages
invariant list --remote     # List available packages from registry
invariant list --active     # List only packages with active items
```

### `invariant claude`

Generate a `CLAUDE.md` file from all active package items.

```bash
invariant claude
```

### `invariant plan "<instructions>"`

Create a session file with task instructions.

```bash
invariant plan "implement user authentication"
invariant plan "implement user authentication" --full
invariant plan "implement user authentication" --context everything-claude-code/dev
```