npm package: @shiprail/cli
Description: AI Agent Observability CLI - Monitor and analyze your AI tool performance
Author: Shiprail
Latest version: 0.0.6

# Shiprail - Claude Code Observability CLI

[![npm version](https://badge.fury.io/js/@shiprail/cli.svg)](https://badge.fury.io/js/@shiprail/cli)

**Monitor and analyze your Claude Code AI tool performance with comprehensive observability.**

shiprail provides real-time insights into your AI tool usage, helping you understand performance, optimize prompts, and track success rates across your organization.

## 🚀 Quick Start

### Installation

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

### Setup

```bash
shiprail init
```

**That's it!** Your tools are now being monitored. View your dashboard at [shiprail.ai](https://app.shiprail.ai).

## ✨ Features

- **One-Command Installation**: Get up and running with just `shiprail init`
- **Supports multiple CLIs**: Currently Supports Claude Code, Gemini CLI, and Codex
- **Real-time Dashboard**: Live monitoring of all tool executions
- **Performance Analytics**: Success rates, execution times, and trends
- **Tool Insights**: Per-tool performance analysis and optimization suggestions
- **Secure**: Enterprise-grade authentication and data protection
- **Zero Configuration**: Works out of the box with sensible defaults
- **Robust Hook System**: Supports all hook types

## 📋 Commands

### `shiprail init`

Logins in and configures shiprail fully.

```bash
shiprail init
```

### `shiprail install <tool>`

Installs shiprail observability hooks for your tool.

```bash
shiprail install claude-code
```

### `shiprail login`

Authenticate with shiprail.

```bash
shiprail login
```

### `shiprail uninstall`

Remove shiprail.

```bash
shiprail uninstall claude-code
```

**What it does:**

- 🗑️ Removes hook scripts
- ⚙️ Cleans up Settings settings
- 🔄 Restores original configuration

### `shiprail hook <tool>`

Internal command that processes hook payloads from stdin and sends them to shiprail.

```bash
shiprail hook claude-code
```

**Purpose:**

- Sends data to shiprail backend for analysis
- Fire-and-forget operation - doesn't block tool execution
- Supports all hook types

**Note:** This command is called automatically by Claude Code hooks and should not be used directly by users.

## 🏗️ How It Works

### 1. Direct CLI Integration

shiprail configures direct CLI integration with Claude Code's native hook system:

```json
{
  "hooks": {
    "SessionStart": [{
      "matcher": "*",
      "hooks": [{ "type": "command", "command": "shiprail hook claude-code" }]
    }],
    "SessionEnd": [{
      "matcher": "*",
      "hooks": [{ "type": "command", "command": "shiprail hook claude-code" }]
    }]
  }
}
```

### 2. Real-time Analysis

Data is sent to the shiprail platform where it's processed to provide:

- Performance dashboards
- Success rate analytics
- Tool usage patterns
- Optimization recommendations

## 🔧 Configuration

### Multiple Tools Support

The CLI now supports installing and managing multiple AI coding tools simultaneously. You can install multiple tools and they will all be configured to send telemetry data:

```bash
# Install multiple tools
shiprail install claude-code
shiprail install gemini-cli
shiprail install codex

# Check status to see all installed tools
shiprail status

# Uninstall a specific tool (others remain active)
shiprail uninstall gemini-cli
```

### File Locations

- **Shiprail Config**: `~/.shiprail/settings.json` (main configuration)
- **Claude Settings**: `~/.claude/settings.json`
- **Gemini Settings**: `~/.gemini/settings.json`
- **Codex Config**: `~/.codex/config.toml`

## 🔗 Links

- **Dashboard**: [app.shiprail.ai](https://app.shiprail.ai)
- **Documentation**: [docs.shiprail.ai](https://docs.shiprail.ai)
- **Context Engine** [shiprail Memory](https://www.github.com/shiprail-memory/shiprail-memory)

---

## ❤️ Made by the shiprail Team

*Transform your AI development workflow with comprehensive observability.*