npm package: @gobi-ai/cli
Description: CLI client for the Gobi collaborative knowledge platform
Latest version: 0.9.12

# gobi-cli

[![CI](https://github.com/gobi-ai/gobi-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/gobi-ai/gobi-cli/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/@gobi-ai/cli)](https://www.npmjs.com/package/@gobi-ai/cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

Command-line interface for the [Gobi](https://gobispace.com) collaborative knowledge platform.

## Installation

### Homebrew

```sh
brew tap gobi-ai/tap
brew install gobi
```

### npm

```sh
npm install -g @gobi-ai/cli
```

### From source

```sh
git clone https://github.com/gobi-ai/gobi-cli.git
cd gobi-cli
npm install
npm run build
npm link
```

## Quick start

```sh
# Initialize — logs in and sets up your vault
gobi init

# Select a space
gobi space warp

# Search brains across your spaces
gobi brain search --query "machine learning"

# Ask a brain a question
gobi brain ask --vault-slug my-vault --question "What is RAG?"
```

## Commands

### Authentication

| Command | Description |
|---------|-------------|
| `gobi auth login` | Sign in via device code flow |
| `gobi auth status` | Show current auth status |
| `gobi auth logout` | Sign out and clear credentials |

### Setup

| Command | Description |
|---------|-------------|
| `gobi init` | Log in (if needed) and select or create a vault |
| `gobi space list` | List spaces you are a member of |
| `gobi space warp [spaceSlug]` | Select the active space (interactive if slug omitted) |

### Brains

| Command | Description |
|---------|-------------|
| `gobi brain search --query <q>` | Search public brains by text and semantic similarity |
| `gobi brain ask --vault-slug <slug> --question <q>` | Ask a brain a question (creates a 1:1 session) |
| `gobi brain publish` | Upload `BRAIN.md` to your vault |
| `gobi brain unpublish` | Remove `BRAIN.md` from your vault |

Public brains are accessible at `https://gobispace.com/@{vaultSlug}`.

`brain ask` also accepts `--rich-text <json>` (mutually exclusive with `--question`) and `--mode <auto|manual>`.

### Brain Updates

| Command | Description |
|---------|-------------|
| `gobi brain list-updates` | List brain updates |
| `gobi brain list-updates --mine` | List only your own brain updates |
| `gobi brain post-update --title <t> --content <c>` | Post a brain update |
| `gobi brain edit-update <id> [--title <t>] [--content <c>]` | Edit a brain update (at least one required) |
| `gobi brain delete-update <id>` | Delete a brain update |

`list-updates` also accepts `--space-slug <slug>` to scope to a space, and `--limit`/`--cursor` for pagination.
`post-update` and `edit-update` accept `--auto-attachments` to upload wiki-linked `[[files]]` before posting.

### Threads

| Command | Description |
|---------|-------------|
| `gobi space list-threads` | List threads in the current space |
| `gobi space get-thread <id>` | Get a thread and its replies |
| `gobi space create-thread --title <t> --content <c>` | Create a thread |
| `gobi space edit-thread <id> [--title <t>] [--content <c>]` | Edit a thread (at least one required) |
| `gobi space delete-thread <id>` | Delete a thread |

### Replies

| Command | Description |
|---------|-------------|
| `gobi space create-reply <threadId> --content <c>` | Reply to a thread |
| `gobi space edit-reply <replyId> --content <c>` | Edit a reply |
| `gobi space delete-reply <replyId>` | Delete a reply |

### Sessions

| Command | Description |
|---------|-------------|
| `gobi session list` | List your sessions |
| `gobi session get <id>` | Get a session and its messages |
| `gobi session reply <id> --content <c>` | Send a message in a session |

`session reply` also accepts `--rich-text <json>` (mutually exclusive with `--content`).

### Sense

| Command | Description |
|---------|-------------|
| `gobi sense activities --start-time <iso> --end-time <iso>` | Fetch activity records in a time range |
| `gobi sense transcriptions --start-time <iso> --end-time <iso>` | Fetch transcription records in a time range |

Times are ISO 8601 UTC (e.g. `2026-03-20T00:00:00Z`).

### Sync

| Command | Description |
|---------|-------------|
| `gobi sync` | Sync local vault files with Gobi Webdrive |

| Option | Description |
|--------|-------------|
| `--upload-only` | Only upload local changes to server |
| `--download-only` | Only download server changes to local |
| `--conflict <strategy>` | Conflict resolution: `ask` (default), `server`, `client`, `skip` |
| `--dir <path>` | Local vault directory (default: current directory) |
| `--dry-run` | Preview changes without making them |
| `--full` | Full sync: ignore cursor and hash cache, re-check every file |
| `--path <path>` | Restrict sync to specific file/folder (repeatable) |
| `--plan-file <path>` | Write dry-run plan to file, or read plan to execute |
| `--execute` | Execute a previously written plan file (requires `--plan-file`) |
| `--conflict-choices <json>` | Per-file conflict resolutions as JSON (use with `--execute`) |

### Global options

| Option | Scope | Description |
|--------|-------|-------------|
| `--json` | All commands | Output results as JSON |
| `--space-slug <slug>` | `space` commands | Override the default space (from `.gobi/settings.yaml`) |
| `--vault-slug <slug>` | Per-command | Override the default vault; available on `brain list-updates`, `brain post-update`, `brain edit-update`, `space create-thread`, `space edit-thread`, `space edit-reply` |

## Configuration

### Environment variables

| Variable | Default | Description |
|----------|---------|-------------|
| `GOBI_BASE_URL` | `https://api.joingobi.com` | API server URL |
| `GOBI_WEBDRIVE_BASE_URL` | `https://webdrive.joingobi.com` | File storage URL |

### Files

| Path | Description |
|------|-------------|
| `~/.gobi/credentials.json` | Stored authentication tokens |
| `.gobi/settings.yaml` | Per-project vault and space configuration |

## Development

```sh
git clone https://github.com/gobi-ai/gobi-cli.git
cd gobi-cli
npm install
npm run build
npm test
```

Run from source without compiling:

```sh
npm run dev -- auth status
```

## License

[MIT](LICENSE)