npm package: @pavitarsaini/tether-cli
Description: CLI bridge for connecting the Tether web extension to AI coding tools like Claude Code and Cursor
Author: Pavitar Saini
Latest version: 1.0.2

# Tether

A CLI wrapper tool for integrating coding assistants like Claude Code and Cursor with browser extensions.

## Features

- **Session Management**: Register and manage CLI tool sessions
- **Browser Integration**: HTTP server for communication with browser extensions
- **Auto-submit**: Automatically submit prompts to CLI tools
- **Image Support**: Send images to compatible CLI tools
- **Multi-tool Support**: Works with Claude, Cursor, Codex, and more

## Installation

```bash
npm install
npm run build
```

## Usage

### Setup

First-time setup to download and install extensions:

#### Chrome Extension
```bash
# Download and install the Tether Chrome extension
tether setup overlay
```

This will:
- Prompt for a download location (defaults to ~/Downloads)
- Download the latest .crx extension file
- Show step-by-step installation instructions
- The extension auto-updates when new versions are released

#### Cursor Extension
```bash
# Download and install the Tether Cursor extension
tether setup cursor
```

This will:
- Prompt for a download location (defaults to ~/Downloads)
- Download the latest .vsix extension file
- Detect if Cursor CLI is available for automatic installation
- Show installation instructions for both automatic and manual methods

### Basic Commands

Start a CLI tool with tether integration:
```bash
# Start Claude with tether integration
npx tether claude

# Start Cursor with tether integration
npx tether cursor

# Start with tether server auto-start
npx tether claude --server
```

### Server Management

```bash
# Start the tether server
npx tether server

# Start on custom port
npx tether server --port 3000
```

### Session Management

```bash
# List active sessions
npx tether sessions list

# Kill a specific session
npx tether sessions kill <session-id>

# Show supported tools
npx tether tools
```

### Updating

Keep Tether up to date with the latest features:
```bash
# Check for and install updates
tether update

# Check current version
tether --version
```

Tether automatically checks for updates daily and notifies you when new versions are available.

## API Endpoints

The tether server exposes these endpoints:

### Tools & Sessions
- `GET /tools` - List supported tools
- `POST /sessions` - Create new session
- `GET /sessions` - List active sessions
- `DELETE /sessions/:id` - Kill session

### Send Data
- `POST /tools/:tool/send` - Send text to tool (with auto-submit based on tool config)
- `POST /tools/:tool/add-context` - Add context to tool (always without auto-submit)
- `POST /tools/:tool/image` - Send image to tool
- `POST /sessions/:id/send` - Send to specific session

### Legacy
- `POST /composer` - Legacy endpoint (forwards to Cursor)

## Browser Extension Integration

Tether integrates with browser extensions by:

1. Running an HTTP server (default port 30756)
2. Accepting data from browser extensions
3. Forwarding data to appropriate CLI tool sessions
4. Supporting auto-submit and image uploads

## Supported Tools

- **Claude**: Full support with auto-submit and images
- **Cursor**: Basic support
- **Codex**: Basic text support

## Configuration

Tools are configured in `src/types.ts`:

```typescript
export const SUPPORTED_TOOLS: Record<string, ToolConfig> = {
  claude: {
    name: 'claude',
    command: 'claude',
    autoSubmit: true,
    imageSupport: true
  },
  // ... more tools
};
```