Skip to content
Closed
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
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,52 @@ Cursor models still run through your Cursor account.
`UG_WORKSPACE` can provide the default workspace. An explicit `--workspace` or
`--profile` takes precedence.

## Claude Code in VS Code

The Claude Code VS Code extension doesn't start Claude through `ug claude`, so on its
own it signs in to Anthropic. Whenever `ug configure` sets up Claude Code, it also looks
for the extension and points every VS Code profile that has it at Unity Gateway:

- `ug` installs a small launcher, `ug-claude-vscode`, next to `ug`. The extension starts
Claude through it, and it adds `ug`'s gateway settings (`~/.claude/ucode-settings.json`).
- In the `settings.json` of each profile with the extension, `ug` sets:

```json
"claudeCode.claudeProcessWrapper": "<path to ug-claude-vscode>",
"claudeCode.disableLoginPrompt": true,
"claudeCode.initialPermissionMode": "default"
```

`initialPermissionMode` is added only when it isn't already set.
- On Windows, covers VS Code and VS Code Insiders (the default profile and named profiles).

Reload VS Code afterwards. `ug` leaves a `settings.json` alone when it contains comments
(it prints the lines to add instead) or when the extension already uses a different
wrapper. `ug revert` removes only the settings `ug` added.

In the extension you get the gateway, automatic token refresh, the admin's model list and
`ug`'s MCP servers. Smart routing needs `ug claude`. Run `ug configure` again after your
admin changes models. To see how the extension launches Claude, set
`UG_CLAUDE_VSCODE_LOG=<file>` through the `claudeCode.environmentVariables` setting.

## Codex in VS Code

The Codex VS Code extension (`openai.chatgpt`) runs its own copy of Codex, which reads
Codex's own config files but not `~/.codex/ucode.config.toml`, so on its own it asks for
a ChatGPT sign-in. On Windows, when `ug configure` finds the extension, it writes gateway
settings to `~/.codex/config.toml`: `model_provider = "Databricks"`, the admin's default
`model`, and `[model_providers.Databricks]`. Plain `codex` uses them too. It does not write
this fallback on macOS or Linux.

Reload VS Code afterwards. `ug` leaves `config.toml` alone when it already uses another
`model_provider`. `ug revert` removes only the keys `ug` added and restores a `model` you
had before.

In the extension you get the gateway, automatic token refresh, the admin's model list and
`ug`'s MCP servers. Smart routing needs `ug codex`. On Windows the extension asks to set up
its Agent sandbox the first time; choose "Continue without administrator access" if you
can't approve the admin prompt. It also needs an open folder.

## MCP Servers

Register Databricks MCP servers for configured MCP-capable agents. Cursor Agent
Expand Down Expand Up @@ -235,6 +281,8 @@ unchanged. Native daemon/background propagation of the plugin remains unverified
|------|---------------|
| Codex | `~/.codex/ucode.config.toml`, shared catalog reference in `~/.codex/config.toml`, `~/.ucode/codex-model-catalog.json`, `/etc/codex/managed_config.toml` (Linux and macOS) |
| Claude Code | `~/.claude/ucode-settings.json`, `~/.claude.json`, `/etc/claude-code/managed-settings.json` (Linux), `/Library/Application Support/ClaudeCode/managed-settings.json` (macOS) |
| Claude Code VS Code extension | the three `claudeCode.*` keys above in each profile's VS Code `settings.json`, and `~/.ucode/vscode-claude-extension.json` (what `ug` changed, for `ug revert`) |
| Codex VS Code extension (Windows) | `model_provider`, `model` and `[model_providers.Databricks]` in `~/.codex/config.toml`, and `~/.ucode/vscode-codex-extension.json` (what `ug` changed, for `ug revert`) |
| Gemini CLI | `~/.gemini/ucode.env`, `~/.ucode/.gemini-home/.gemini/settings.json` |
| OpenCode | `~/.ucode/opencode-xdg/opencode/opencode.json`, `~/.ucode/opencode-xdg/opencode/plugin/ucode-auth.js` |
| GitHub Copilot CLI | `~/.copilot/ucode.env`, `~/.copilot/ucode-mcp-config.json` |
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ dependencies = [
[project.scripts]
ug = "ucode.cli:main"
ucode = "ucode.cli:main"
# claudeCode.claudeProcessWrapper for the Claude Code VS Code extension; see ucode.vscode.
ug-claude-vscode = "ucode.vscode_wrapper:main"

[tool.hatch.build.targets.wheel]
# Keep the Python module and existing ~/.ucode configuration paths compatible.
Expand Down
Loading
Loading