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

# OneCLI Plugin for Claude Code

> Install the OneCLI plugin for Claude Code to connect to external APIs with zero credential management. No CLI required.

The OneCLI plugin gives Claude Code transparent access to external APIs through the OneCLI gateway. Every session automatically configures `HTTPS_PROXY` so all outbound requests (curl, gh, language HTTP clients) route through the gateway, which injects stored credentials at the proxy boundary.

No `onecli` CLI installation required. The plugin talks directly to OneCLI Cloud.

<Info>
  If you prefer the CLI wrapper approach, see [Coding Agents](/guides/coding-agents) for `onecli run -- claude`.
</Info>

## Getting started

### Prerequisites

* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (terminal or desktop app)
* An [OneCLI](https://app.onecli.sh) account with at least one connected service

### Installation

Install from the Claude Code Directory:

1. Open Claude Code
2. Go to **Customize > Directory > Plugins**
3. Search for **OneCLI**
4. Click **Install**

### Setup

After installation, run the setup command in Claude Code:

```text theme={null}
/onecli-setup
```

This will prompt you to:

1. Open **[app.onecli.sh/projects](https://app.onecli.sh/projects)**
2. Select your project (or create one)
3. Copy your **API Key** from the Overview page (starts with `oc_`)
4. Paste it when prompted

Start a new session. The gateway activates automatically on every future session.

<Tip>
  If you already use the `onecli` CLI, the plugin automatically reuses your existing credentials from `~/.onecli/credentials/api-key`. No setup needed.
</Tip>

## What the plugin provides

| Component                 | Description                                                                 |
| ------------------------- | --------------------------------------------------------------------------- |
| **Session-start hook**    | Auto-configures `HTTPS_PROXY` and CA certificates on every session          |
| **Gateway skill**         | Teaches Claude how to make API requests through the proxy and handle errors |
| **Providers reference**   | Lists all 40+ supported services with endpoints and auth patterns           |
| **Integration architect** | Specialist agent for designing multi-service API workflows                  |
| **2 slash commands**      | `/onecli-setup` and `/onecli-status`                                        |

## How it works

On every session start, the plugin:

1. Reads your API key from `~/.onecli/credentials/api-key` (or other configured locations)
2. Calls OneCLI Cloud to get the gateway proxy configuration
3. Writes a CA certificate bundle to `~/.onecli/ca-bundle.pem`
4. Exports `HTTPS_PROXY` and CA trust environment variables into the session
5. Injects gateway instructions into the conversation context

All HTTP clients honor `HTTPS_PROXY` automatically. When Claude runs `curl`, `gh`, `aws`, or any tool that makes HTTPS requests, the traffic routes through `gateway.onecli.sh`, which injects the right credentials.

## Connecting services

When Claude makes a request to a service that isn't connected, the gateway returns an error with a `connect_url`. Claude shows you the link. Click it, authorize the service in your browser, and Claude retries automatically.

You can also connect services from your [OneCLI dashboard](https://app.onecli.sh/projects).

## Slash commands

| Command          | Purpose                                                |
| ---------------- | ------------------------------------------------------ |
| `/onecli-setup`  | Configure your API key and verify gateway connectivity |
| `/onecli-status` | Show gateway status and list connected services        |

## Supported services

The gateway supports 40+ services including:

| Category      | Services                                                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **Google**    | Gmail, Calendar, Drive, Docs, Sheets, Slides, Tasks, Forms, Meet, Photos, Admin, Analytics, Search Console, Classroom, YouTube |
| **GitHub**    | REST API, Git HTTPS, Raw content, GraphQL API                                                                                  |
| **Atlassian** | Jira, Confluence                                                                                                               |
| **AWS**       | All services (SigV4 signing), AssumeRole                                                                                       |
| **Microsoft** | Outlook Mail, Outlook Calendar, Microsoft Word                                                                                 |
| **Other**     | Stripe, Datadog, Notion, Cloudflare, Todoist, Resend, Vertex AI                                                                |
| **Custom**    | Any API via custom secrets in the dashboard                                                                                    |

For the full list with endpoints, see [App Connections](/integrations/app-connections).

## Plugin vs `onecli run`

Both approaches give Claude Code gateway access. Choose based on your preference:

|                   | Plugin                    | `onecli run`                                 |
| ----------------- | ------------------------- | -------------------------------------------- |
| **Install**       | One-click from Directory  | Install `onecli` CLI                         |
| **Session start** | Automatic (hook)          | Manual (`onecli run -- claude`)              |
| **Requires CLI**  | No                        | Yes                                          |
| **Works with**    | Claude Code only          | Claude Code, Cursor, Codex, Hermes, OpenCode |
| **Cloud gateway** | Yes (`gateway.onecli.sh`) | Yes (cloud or local)                         |

## Troubleshooting

### Gateway not active after setup

The plugin configures the proxy at session start. After running `/onecli-setup`, you need to **start a new session** for the gateway to activate.

### Requests not going through the proxy

Check that the proxy environment variables are exported:

```text theme={null}
env | grep -i proxy
```

If `HTTPS_PROXY` is not set, the session-start hook may have failed. Run `/onecli-status` to diagnose.

### Service returns 401/403

The service may not be connected. Check the error response for a `connect_url` and open it in your browser to authorize. After connecting, retry the request.

### Policy blocking a request

If you see a `blocked_by_policy` error, a policy rule in your [OneCLI dashboard](https://app.onecli.sh) is blocking the request. Check **Rules** in the sidebar to review and adjust.

## Source code

The plugin is open source: [github.com/onecli/onecli-plugin](https://github.com/onecli/onecli-plugin)
