Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
368 changes: 337 additions & 31 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ ratatui = "0.29"
crossterm = "0.28"
jiff = { version = "0.2", default-features = false, features = ["std", "tz-system", "tzdb-zoneinfo"] }
tiktoken-rs = { version = "0.12", default-features = false }
jsonschema = { version = "=0.59.0", default-features = false, features = ["idna"] }

[target.'cfg(unix)'.dependencies]
libc = "=0.2.186"

[dev-dependencies]
tokio = { version = "1", features = ["test-util"] }
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,33 @@ The opt-in Images API returns base64 image data and consumes the signed-in accou
Run `claude-code-proxy models` for the current catalog or
`claude-code-proxy models --full` for every dynamic Cursor alias.

An additional **experimental, default-off native Antigravity Argon adapter** supports
only `antigravity/gemini-4-argon-low`, `antigravity/gemini-4-argon-medium`, and
`antigravity/gemini-4-argon-high`. It does not run or import credentials from `agy`.
Its default HTTP User-Agent is `claude-code-proxy/<package version>`. An explicit
provider-specific override affects only native generation/project discovery,
not OAuth; it is compatibility metadata, not verified official-client identity.
Use a fresh session for every model/tier/profile change. Real Google OAuth,
entitlement, native tool round trips and all three tiers remain live-validation
gates; offline tests are not evidence of account access. See the
[Antigravity limitations](docs/src/content/docs/reference/compatibility-and-limitations.md#experimental-native-antigravity-argon)
and [configuration](docs/src/content/docs/reference/configuration.md#experimental-antigravity)
before explicitly enabling it. Existing provider defaults and aliases are unchanged.

Antigravity login defaults to automatic browser/loopback completion. On Unix,
`claude-code-proxy antigravity auth login --manual` instead prints a browser URL
and accepts the **code displayed by the completion page** through visible input in
your local foreground terminal. The code is sensitive: keep your screen,
scrollback and recordings private. Short codes are fully visible; longer input
shows its end with a `<` marker and total character count. A known terminal width
of at least 10 columns is required; changing width cancels. It does not open a
browser or callback listener.
The explicitly configured OAuth client must permit
`https://antigravity.google/oauth-callback`; a loopback-only client may not work.
Cancel on browser errors or no displayed code; there is no automatic fallback.
Never paste a code/token into chat, shell arguments or logs. See the configuration
reference for PKCE/state distinctions, terminal bounds and unverified live gates.

> [!WARNING]
> The proxy accepts local requests without client authentication. It binds to
> `127.0.0.1` by default. Protect any non-loopback listener with a firewall or
Expand Down
50 changes: 49 additions & 1 deletion docs/src/content/docs/reference/command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ claude-code-proxy <provider> auth <action>
| `kimi` | Device code | Unsupported | User, expiry, scope, storage | Delete proxy credential |
| `grok` | Browser PKCE | Device code | Expiry and storage | Delete proxy credential |
| `cursor` | Browser polling flow | Unsupported | Source, claims, expiry | Delete proxy credential |
| `antigravity` (experimental) | Browser PKCE; opt-in Unix `--manual` paste-back | Unsupported | Safe local readiness, optional `--json` | Delete only Antigravity credential |

Examples:

Expand All @@ -80,7 +81,54 @@ claude-code-proxy kimi auth status
claude-code-proxy cursor auth logout
```

A missing credential makes `auth status` exit with status 1. Other provider command failures exit with status 2. Successful commands exit with status 0.
For existing providers, a missing credential makes `auth status` exit with status 1. Other provider command failures exit with status 2. Successful commands exit with status 0.

Antigravity auth commands work even while inference is disabled:

```sh
claude-code-proxy antigravity auth status --json
claude-code-proxy antigravity auth login
claude-code-proxy antigravity auth login --manual
claude-code-proxy antigravity auth logout
```

Configure your explicit OAuth client ID before login; see
[Antigravity configuration](/reference/configuration/#experimental-antigravity).
Without `--manual`, browser opening and the ephemeral loopback callback are
unchanged. Experimental `--manual` is Unix-only: it requires terminal stdin and a
foreground controlling terminal, prints the authorization URL there, and opens
neither a browser nor a callback listener. The configured client must permit the
exact hosted redirect `https://antigravity.google/oauth-callback`.

Open the URL in your browser, select the intended account, then copy the **code
displayed by the completion page** into the visible local terminal prompt. The
code is sensitive: keep screens, scrollback, screenshots and recordings private.
The input row shows a character count; short codes fit in full, while `<` marks
that only the end of longer input is visible. All entered characters remain part
of the completion, up to the unchanged 8192-byte limit. A known terminal width of
at least 10 columns is required; changing width cancels rather than risking
incorrect wrapped editing. Output modes that translate carriage returns or letter
case are refused, not silently changed.
The page removes `code` from its address bar; copying that address afterward does not
supply the code. Cancel if the browser reports an error (such as
`redirect_uri_mismatch`) or displays no code. There is no automatic callback,
client or endpoint fallback. Never put a code in command arguments, chat or logs.

Input is limited to 8192 printable ASCII bytes and 180 seconds, with at most
three empty-entry reprompts under the same deadline. Backspace edits; Enter
submits; Ctrl-C/Ctrl-D cancel. Pipes and non-Unix manual mode are rejected before
URL emission. Bare codes rely on server-enforced fresh S256 PKCE, **not returned
state validation**; a complete redirect URL, if separately available with its
code intact, additionally requires an exact matching state and redirect target.
See configuration for security and terminal-restoration limitations.

`status --json` is Antigravity-only and emits schema version 1, `provider:
antigravity`, plus the safe provider descriptor documented under
[model discovery](/reference/http-api/#get-v1models). A successfully emitted
report exits 0 even for missing/invalid/unready credentials. Inspection performs
no network, refresh, directory creation or writes. CLI readiness describes this
CLI's configuration, not a different running proxy, and never proves live access.
Auth invocation failures exit nonzero. No existing provider gains a `--json` flag.

Logout removes the local proxy-owned credential. It does not call the provider to revoke a refresh token.

Expand Down
Loading