> ## 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.

# CLI + Skills

> Set up AI agents to build and manage superglue tools via the CLI and superglue skill

AI coding agents work best when they understand your systems, APIs, and tools. The superglue CLI ships with a **skill** — a structured reference that teaches agents how to use every `sg` command, handle auth, build tools, and debug failures. Install once, works across [35+ agents](https://skills.sh).

***

## Installing the CLI

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

### Setup

**Interactive setup:**

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

Prompts for your API key (get one at [app.superglue.cloud/admin](https://app.superglue.cloud/admin?view=api-keys)), endpoint, and output preferences.

**Environment variables (CI, AI agents, non-interactive):**

```bash theme={null}
export SUPERGLUE_API_KEY="your-api-key"
export SUPERGLUE_API_ENDPOINT="https://api.superglue.cloud"  # optional, this is the default
```

**Verify:** `sg system list` — if you see `fetch failed` or auth errors, double-check your API key and endpoint.

***

## Installing the Skill

The skill gives your AI agent full CLI knowledge — commands, auth patterns, tool schemas, debugging, and deployment. Install once and the agent references it automatically.

### Universal Install (all agents)

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

Auto-detects your installed agents. Target a specific agent with `-g -a <agent>`:

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

### Agent-Specific Install

<Tabs>
  <Tab title="Claude Code">
    **From the Anthropic marketplace:**

    ```bash theme={null}
    /plugin install superglue@claude-plugins-official
    ```

    **Or load from local install:**

    ```bash theme={null}
    claude --plugin-dir $(npm root -g)/@superglue/cli
    ```
  </Tab>

  <Tab title="Codex">
    **Via the skill installer:**

    ```
    $skill-installer --repo superglue-ai/cli --path skills/superglue
    ```

    **Or manually:**

    ```bash theme={null}
    cp -r $(npm root -g)/@superglue/cli/skills/superglue ~/.agents/skills/superglue
    ```

    Check it into your repo at `.agents/skills/superglue/` so the whole team gets it.
  </Tab>

  <Tab title="Cursor">
    ```bash theme={null}
    cp -r $(npm root -g)/@superglue/cli/skills/superglue .cursor/skills/superglue
    ```

    Or global: `cp -r $(npm root -g)/@superglue/cli/skills/superglue ~/.cursor/skills/superglue`
  </Tab>
</Tabs>

***

## What the Skill Provides

* **All CLI commands** with flags, options, and usage patterns
* **Authentication patterns** — credential placeholders, OAuth flows, header formats
* **Tool configuration schema** — step configs, data selectors, transforms, pagination
* **Debugging workflows** — common errors, `--include-step-results`, `sg system call` for isolation
* **Deployment patterns** — SDK, REST API, webhooks (via `references/integration.md`)
* **Specialized references** for databases, file servers, and transforms (loaded on demand)

***

## Adding Project-Specific Context

The skill teaches the AI *how* to use superglue. Add a section to your project's AI config file (`CLAUDE.md`, `AGENTS.md`, or `.cursorrules`) so it knows to use the skill and discover your setup dynamically:

```markdown theme={null}
## Using Superglue

When working with superglue tools — via the CLI, SDK, or REST API:

1. Invoke the superglue skill and read the SKILL.md file before running any sg command
2. Read the relevant reference files for the task (e.g. http, postgres, file-handling, integration)
3. Ensure the CLI is configured (sg init has been run or env vars are set)
4. Run sg system list and sg tool list to discover the current setup before building or modifying anything
5. Never hardcode system IDs or tool IDs — always discover them dynamically
```

***

## Best Practices

### Always test systems before building tools

Have the agent run `sg system call` to verify auth and see the actual response shape before constructing a tool config:

```bash theme={null}
sg system call --system-id stripe \
  --url "https://api.stripe.com/v1/customers?limit=2" \
  --headers '{"Authorization":"Bearer <<stripe_api_key>>"}'
```

### Use `--include-step-results` when debugging

Shows the raw API response from each step — pinpoints whether the issue is auth, the endpoint, or a transform:

```bash theme={null}
sg tool run --draft <id> --payload '{}' --include-step-results
```

### Never paste secrets into chat

Use `--sensitive-credentials` when creating systems via the CLI so secrets are prompted securely:

```bash theme={null}
sg system create --id my_api --url https://api.example.com \
  --credentials '{"client_id":"abc"}' \
  --sensitive-credentials client_secret,api_key
```

***

## LLM-Readable Documentation

For agents that don't support skills, we provide full docs in LLM-friendly formats:

| File          | URL                                                         | Purpose                            |
| ------------- | ----------------------------------------------------------- | ---------------------------------- |
| **Index**     | [llms.txt](https://docs.superglue.cloud/llms.txt)           | Lightweight index of all pages     |
| **Full docs** | [llms-full.txt](https://docs.superglue.cloud/llms-full.txt) | Complete documentation in one file |

If your tool can fetch URLs — give it the URL. If it requires file uploads — download [llms-full.txt](https://docs.superglue.cloud/llms-full.txt) and upload directly.

***

## Support & Resources

* [skills.sh](https://skills.sh) — Install the superglue skill for any AI agent
* [CLI Reference](https://github.com/superglue-ai/cli) — Full command documentation
* [Discord Community](https://discord.gg/vUKnuhHtfW) — Get help from other developers
* [GitHub Issues](https://github.com/superglue-ai/cli/issues) — Report bugs or request features
