> ## Documentation Index
> Fetch the complete documentation index at: https://docs.60db.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 60db CLI

> Agent-native command-line interface for the full 60db platform — AI completions, TTS, STT, voice cloning, memory/RAG, Cerbos policy checks, billing, and workspaces with structured JSON output.

# 60db CLI

Agent-native command-line interface for the full 60db platform. Covers AI completions, TTS, STT, voice cloning, persistent memory with document upload (PDF, DOCX, XLSX, scanned images with OCR), Cerbos policy checks, billing, and workspace management — all with structured JSON output for scripts and AI agents.

**Source code:** [github.com/60db-ai/cli](https://github.com/60db-ai/cli) · **npm:** [`60db-cli`](https://www.npmjs.com/package/60db-cli) · **License:** MIT

## Features

* **Dual Mode**: Interactive REPL + subcommand interface
* **Agent-Native**: Structured JSON output with `--json` flag
* **AI Completions**: Chat, meeting notes analysis, and text completion
* **TTS (Text-to-Speech)**: Generate speech from text with multiple voices
* **STT (Speech-to-Text)**: Transcribe audio files with multiple languages
* **Memory & RAG**: Ingest memories, upload documents (91+ formats with OCR), hybrid semantic search, LLM-ready context assembly, per-month spend tracking
* **Authorization (Cerbos)**: Inspect effective permissions and probe `(resource, action)` checks before attempting gated operations
* **Authentication**: Secure login and token management
* **Complete Coverage**: Users, Credits, Billing, Workspaces, Categories, Memory, Authz
* **Configuration**: Persistent config with `60db config`

## Installation

### Global Installation

```bash theme={null}
npm install -g 60db-cli
```

### Local Installation

```bash theme={null}
npm install 60db-cli
```

### From Source

```bash theme={null}
git clone https://github.com/60db-ai/cli.git
cd cli
npm install
npm link        # exposes the `60db` binary globally
```

## Quick Start

### Interactive Mode (REPL)

```bash theme={null}
60db
60db --version
```

Enter the interactive shell with tab completion and persistent session:

```
60db> users
60db> credits:add --user-id 123 --amount 50
60db> config --list
60db> exit
```

### Command Mode

```bash theme={null}
# List all users
60db users --list

# Add credits to user
60db credits:add --user-id 123 --amount 50 --currency USD

# Upload a document to memory with OCR
60db memory:upload --file ~/Documents/handbook.pdf --type knowledge

# Search with hybrid semantic + keyword recall
60db memory:search --query "refund policy" --limit 5

# Check if current user can ingest memories
60db authz:check --resource memory --action create

# Get JSON output for agent consumption
60db --json users --list
```

## Environment Variables

```bash theme={null}
# Set API URL
export SIXTYDB_API_URL=https://api.60db.ai

# Set API Key
export SIXTYDB_API_KEY=your_api_key_here
```

Legacy `X60DB_*` variable names are still honored for backward compatibility.

## JSON Output (for AI Agents)

All commands support `--json` flag for structured output:

```bash theme={null}
60db --json users --list
```

Response:

```json theme={null}
{
  "success": true,
  "users": [
    {
      "id": 123,
      "email": "user@example.com",
      "full_name": "John Doe",
      "system_role": "user",
      "is_active": true,
      "is_verify_email": true,
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total_users": 1,
    "total_pages": 1,
    "current_page": 1,
    "limit": 10
  }
}
```

## Error Handling

All commands return structured error responses:

```json theme={null}
{
  "success": false,
  "error": "User not found"
}
```

## Requirements

* Node.js >= 16.0.0
* npm or yarn

## Support

For issues or questions, please visit:

* GitHub: [https://github.com/60db-ai/cli](https://github.com/60db-ai/cli)
* Issues: [https://github.com/60db-ai/cli/issues](https://github.com/60db-ai/cli/issues)

## License

MIT
