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

# Overview

> Install and configure the superglue CLI

The superglue CLI (`sg`) lets you build, run, and manage integration tools from the terminal. It connects to your superglue instance (cloud or self-hosted) and supports both interactive and scriptable workflows.

## Installation

```bash theme={null}
npm install -g @superglue/cli
```

Verify the install:

```bash theme={null}
sg --version
```

## Setup

Run the interactive setup wizard:

```bash theme={null}
sg init
```

This prompts for:

* **API key** — from your superglue dashboard (Settings → API Keys)
* **API endpoint** — defaults to `https://api.superglue.cloud`
* **Output mode** — stdout only, or stdout + file
* **Config location** — project-local (`.superglue/config.json`) or global (`~/.superglue/config.json`)

Alternatively, set environment variables directly:

```bash theme={null}
export SUPERGLUE_API_KEY="your-api-key"
export SUPERGLUE_API_ENDPOINT="https://api.superglue.cloud"
```

## Configuration Resolution

Both API key and endpoint resolve in this order:

1. CLI flag (`--api-key`, `--endpoint`)
2. Environment variable (`SUPERGLUE_API_KEY`, `SUPERGLUE_API_ENDPOINT`)
3. Config file
4. Default (endpoint defaults to `https://api.superglue.cloud`)

## Global Flags

These flags work with any command:

| Flag               | Description                                         |
| ------------------ | --------------------------------------------------- |
| `--api-key <key>`  | Override API key                                    |
| `--endpoint <url>` | Override API endpoint                               |
| `--json`           | Force JSON output (default in non-TTY environments) |
| `-V, --version`    | Print CLI version                                   |
| `-h, --help`       | Show help                                           |

## Command Structure

```
sg
├── init                     Setup wizard
├── update                   Update CLI
├── tool
│   ├── build                Build a tool from config
│   ├── run                  Execute a tool
│   ├── edit                 Edit via JSON Patch
│   ├── save                 Persist a draft
│   ├── list                 List saved tools
│   └── find                 Search tools
├── system
│   ├── create               Create a system
│   ├── edit                 Edit a system
│   ├── list                 List systems
│   ├── find                 Search systems
│   ├── credentials          Manage current user's system credentials
│   ├── call                 Make authenticated calls
│   ├── search-docs          Search system docs
│   └── oauth                OAuth authentication
└── run
    ├── list                 List execution runs
    └── get                  Get run details
```

## AI Agent Integration

Install as a skill for AI coding agents ([35+ agents supported](https://skills.sh)):

```bash theme={null}
npx skills add superglue-ai/cli
```

Or target a specific agent:

```bash theme={null}
npx skills add superglue-ai/cli -g -a cursor
npx skills add superglue-ai/cli -g -a claude-code
npx skills add superglue-ai/cli -g -a codex
```

## Next steps

<CardGroup cols={1}>
  <Card title="Commands Reference" icon="terminal" href="/cli/commands">
    Full reference for every CLI command and flag
  </Card>
</CardGroup>
