# @tejasa97/pi-cline-provider

Pi provider for **Cline's model gateway** — the `z-ai/*` models your Cline account can access (including **GLM 5.3 Flash**) by default, with the full Cline catalog (OpenAI, Anthropic, Google, Qwen, DeepSeek, and more) available via `CLINE_MODELS=all`.

Cline's API exposes one catalog to everyone; entitlements decide what actually runs. This extension defaults to the models that work on a standard Cline account today — currently Cline's free-tier lineup, which Cline can change at any time — and gracefully surfaces a "requires ClinePass" message for models gated behind the [$9.99/mo subscription](https://docs.cline.bot/getting-started/clinepass).

## Install

```sh
pi install npm:@tejasa97/pi-cline-provider
```

Or from git:

```sh
pi install git:github.com/tejasa97/pi-cline-provider
```

Local clone:

```sh
pi install /absolute/path/to/pi-cline-provider
```

After install, add your preferred model to `enabledModels` in `~/.pi/agent/settings.json` if you use that whitelist:

```json
"cline/z-ai/glm-5.3-flash"
```

## Usage

1. Sign in with the Cline CLI: `cline auth`
2. In Pi: `/login` → **Cline** (optional if CLI auth is already present)
3. Pick a model: `/model cline/z-ai/glm-5.3-flash`

One-liner:

```sh
pi --model cline/z-ai/glm-5.3-flash
```

### Model catalog

**Default:** only `z-ai/*` models are registered — the set that currently works without a subscription:

| Model ID | Name |
| --- | --- |
| `z-ai/glm-5.3-flash` | GLM 5.3 Flash |
| `z-ai/glm-5.2:free` | GLM 5.2 |
| `z-ai/glm-4.7-flash` | GLM 4.7 Flash |

**Full catalog:** set `CLINE_MODELS=all` (env var or in `~/.pi/agent/settings.json` under `env`) to register Cline's entire gateway catalog (~400 models: openai, anthropic, google, qwen, deepseek, minimax, …). Models your account isn't entitled to return a friendly ClinePass notice instead of a raw 403.

When authenticated, the catalog is refreshed dynamically from Cline's API; the table above is the offline fallback.

### Auth

The provider reuses credentials from, in order:

- `CLINE_API_KEY` env var
- Cline CLI `~/.cline/data/settings/providers.json` (from `cline auth`)
- Pi `~/.pi/agent/auth.json` (`cline` / `clinefree` / `clinepass` entries)

If you already use `pi-clinepass-provider`, your existing Cline CLI login works here too — no separate `/login` needed.

## Testing

```sh
npm test
npm run test:e2e   # requires pi + local install
```

## Related

- [Cline CLI](https://docs.cline.bot/) — `cline` provider id matches this extension
- [pi-clinepass-provider](https://www.npmjs.com/package/pi-clinepass-provider) — paid ClinePass `cline-pass/*` catalog
- [@tejasa97/pi-agentrouter-provider](https://www.npmjs.com/package/@tejasa97/pi-agentrouter-provider) — AgentRouter GLM/GPT/Opus models
- [@tejasa97/pi-nous-portal-provider](https://www.npmjs.com/package/@tejasa97/pi-nous-portal-provider) — Nous Research Portal

## History

Published as `@tejasa97/pi-cline-free-provider` (≤0.1.1) when it exposed only free models; renamed in 0.2.0 to reflect the full-gateway scope. Provider id changed `clinefree` → `cline`; stored `clinefree` credentials are still honored.
