Skip to content

Repository files navigation

CGswitch logo

CGswitch

An open-source all-in-one desktop manager for OpenAI Codex.
Switch provider profiles in one click, manage your ChatGPT accounts, and centrally manage MCP servers, plugins, and Skills.

中文 · Latest release · Changelog · Issues

Latest release MIT License Tauri 2 Windows and macOS

CGswitch is built for developers who use OpenAI Codex and works with the local Codex environment on their computer. It brings provider profiles, ChatGPT OAuth accounts, MCP servers, plugins, and Skills into one desktop app, reducing the need to move between configuration files and separate tools.

How CGswitch fits into your Codex workflow

Provider preset or existing Codex configuration
                         ↓
                  Saved as a profile
                         ↓
            Edit · test · apply · restore

CGswitch backs up relevant Codex files before applying a profile. Provider profiles stay separate from global MCP, Plugins, and Skills, so switching providers does not require reconfiguring those resources.

Features

Provider profiles

  • Start from a built-in provider preset, capture the current ~/.codex/config.toml, or create a custom provider.
  • Edit config.toml, models.json, and auth.json with TOML/JSON validation.
  • Fetch available models from a provider's /models endpoint and select them in the profile editor.
  • Rename, duplicate, reorder, delete, and apply profiles.
  • Keep unrelated Codex configuration such as MCP and plugin sections when applying provider-specific changes where possible.
  • Set a custom display name, provider icon, administration URL, and optional ChatGPT account binding.

Supported provider presets

The current built-in presets are ChatGPT, DeepSeek, MiniMax, Zhipu, OpenCode, OpenRouter, Xiaomi MiMo, Kimi, Qwen, Tencent Hunyuan, Volcengine Doubao, Baidu Qianfan, xAI (Grok), and Custom.

Custom providers can use the Responses API-compatible configuration supported by Codex, with their own endpoint, API key, and model catalog.

ChatGPT accounts and usage

  • Sign in to ChatGPT in the system browser via OAuth.
  • Manage multiple accounts, choose a default account, and bind an account to a provider profile.
  • Test ChatGPT authentication and inspect quota information when available.
  • Test third-party provider connectivity, including response status and latency.
  • View provider balance or usage indicators for supported providers; ChatGPT quota is handled separately.

MCP management

  • Manage the global [mcp_servers.*] configuration in ~/.codex/config.toml.
  • Configure local STDIO servers and remote HTTP / Streamable HTTP servers.
  • Edit commands, arguments, URLs, bearer-token environment variables, headers, environment variables, and timeouts.
  • Test server connectivity and inspect the tools a server provides; probes go through the system proxy.
  • Switch between a structured form and TOML source editing with validation and formatting.
  • Compare the live Codex configuration with CGswitch's database mirror before syncing either direction.

Plugins and Skills

  • List installed Codex plugins and inspect their versions, capabilities, contents, source, and install path.
  • Browse bundled and external plugin marketplaces.
  • Install states in marketplace catalogs stay consistent with the Codex desktop app — plugins installed here are recognized there directly.
  • Installed plugins are listed first in marketplace catalogs; search matches plugin names only via Ctrl/Cmd+K.
  • Installing a plugin that requires sign-in prompts you to authorize it in the Codex desktop app.
  • Add marketplaces from GitHub shorthand, Git, SSH, or a local marketplace directory.
  • Preview and install a plugin from a GitHub repository, optionally using a branch or subdirectory.
  • Check and upgrade third-party marketplace plugins, or uninstall plugins through the Codex CLI.
  • Import local Skills, preview their SKILL.md, detect updates and conflicts, and enable, disable, or delete managed Skills.
  • Scan Skills from ~/.codex/skills and ~/.agents/skills while keeping the CGswitch Skill registry separate from plugin-contained Skills.

Desktop experience

  • Windows and macOS desktop builds powered by Tauri 2.
  • Light, dark, and system theme modes.
  • English and Simplified Chinese interface languages, with system-language detection.
  • Optional launch at login, silent start, and minimize-to-tray behavior.
  • System tray menu with quick actions: switch profiles, open settings, jump to accounts, and show the main window. Single-click on the tray icon can be set to either show the main window or open the tray menu.
  • Optional Codex restart after applying a profile.
  • Optional automatic update checks with release notes before installation, with an "updated to vX" notification on the next launch.
  • Local backups of the database, configuration files, and Codex files are created automatically; database backups can be browsed and restored from Settings.

Settings

The settings page is organized into four tabs:

  • General — theme, language, launch-at-login, silent start, and minimize-to-tray.
  • Application — single-click tray action, restart Codex after switching, and automatic update checks.
  • Advanced — database backup management with immediate backup, import/export, auto-backup (frequency and retention), and collapsible backup records.
  • About — application info card with version, GitHub / changelog links, and the data-path list.

MCP differences

When the live Codex config.toml and CGswitch's MCP mirror drift apart, MCP opens a dedicated diff page that lists every divergent server with a red/green LCS diff and supports batch or single-row adopt / revert actions.

Download and installation

Download the latest build from the GitHub Releases page.

Platform Recommended asset Notes
Windows x64 CGswitch-v{VERSION}-Windows-setup.exe Standard installer.
Windows x64 CGswitch-v{VERSION}-Windows.msi Useful for deployment or MSI-based installation.
macOS Apple Silicon CGswitch-v{VERSION}-macOS-arm64.dmg For Apple Silicon Macs.
macOS Intel CGswitch-v{VERSION}-macOS-x64.dmg For Intel Macs.

macOS first launch

Open the DMG, drag CGswitch to Applications, and launch it. If macOS blocks the app, first allow it in System Settings → Privacy & Security. If it still reports that the app cannot be opened, run:

xattr -cr /Applications/CGswitch.app

Replace the path if you installed the app somewhere else. Official packages are currently published for Windows and macOS; Linux packages are not included.

Quick start

  1. Open Providers, add a built-in preset or Custom, enter the credentials or bind a ChatGPT account, then apply.
  2. Enable the optional Codex restart behavior in Settings → Application if you want CGswitch to restart Codex after applying a profile.
  3. Use MCP, Plugins, or Skill in the sidebar to manage the corresponding global Codex resources.

Data and privacy

CGswitch keeps its application data under the current user's home directory. The exact files and folders depend on which features have been used:

~/.cgswitch/
├── settings.json
├── cgswitch.db
├── balance-cache.json
├── logs/
│   └── cgswitch.log
├── update-marker
└── backups/
    ├── config/
    ├── database/
    └── codex-files/

CGswitch keeps its run logs under ~/.cgswitch/logs/ (1MB × 10 rotation).

The live Codex files remain under ~/.codex:

~/.codex/
├── config.toml
├── models.json
├── auth.json
├── plugins/
└── skills/

API keys, OAuth credentials, profiles, and backups are local data. CGswitch creates backups before relevant configuration writes, but you should still avoid committing or sharing .cgswitch, auth.json, API keys, or backup files.

FAQ and troubleshooting

What happens when I apply a profile?

CGswitch backs up the relevant files, updates the provider-related Codex configuration, and preserves unrelated configuration areas where possible. Whether Codex restarts afterward is controlled by Settings → Application.

Are profiles, MCP, Plugins, and Skills the same thing?

No. Profiles describe model/provider settings; MCP describes tool servers; Plugins are Codex extension packages; Skills are reusable instruction directories. They are managed in separate areas of the application.

Why can a third-party plugin still fail after a provider is configured?

A model provider configuration does not guarantee that every App or MCP connector plugin can load. Some connector plugins also require compatible official ChatGPT authentication or their own dependencies. Check the plugin's requirements if its package is installed but a connector is unavailable.

Why did a connection test fail?

For a third-party provider, check the endpoint and API key first. For the official ChatGPT profile, sign in through the account settings and make sure the selected account is still valid.

If the problem persists, search existing Issues or open a new report with the platform, CGswitch version, and a redacted error message. Do not include API keys or authentication files.

Development

Requirements

Install and run

pnpm install
pnpm dev:tauri

pnpm dev:tauri starts the Vite frontend and a real Tauri desktop window. For frontend-only browser development, use:

pnpm dev

Checks and builds

pnpm typecheck
pnpm test:unit
pnpm check
pnpm build
pnpm build:debug

pnpm check runs the frontend and Rust quality checks. pnpm build creates the web build; pnpm build:debug creates a debug Tauri bundle. To package release installers locally:

pnpm tauri build

Release bundles are written under src-tauri/target/release/bundle/.

Architecture

CGswitch is built with Tauri 2 + Rust for native file access and Codex integration, with a React frontend and a local SQLite database.

The main source areas:

src/
├── main.tsx     React entry point
├── style.css    global tokens, layout conventions, and styles
├── presets.ts   built-in provider display metadata
├── icons.ts     bundled provider icon registry
├── types.ts     shared TypeScript types
├── utils.ts     shared frontend utilities
├── api/         typed IPC methods and browser mock
├── app/         shell, navigation, state, polling, and management data cache
├── assets/      bundled provider icons and resources
├── components/  shared UI components (AppDialog, AppSelect, ConfigTextEditor, …)
├── features/    profiles, mcp, plugins, skills, settings, updates
└── i18n/        English and Simplified Chinese messages

src-tauri/src/
├── main.rs       executable entry point
├── lib.rs        Tauri runtime, command registration, and plugin setup
├── commands.rs   Tauri command boundary
├── error.rs      typed application errors
├── fsutil.rs     filesystem helpers (atomic write, …)
├── services/     AppContext and use cases (profiles, mcp, plugins, accounts, …)
├── codex/        Codex config files and process management
├── auth/         OAuth and account authentication
├── database.rs   SQLite connection, schema, and migrations
├── models.rs     Rust domain models and command DTOs
├── builtin.rs    built-in provider assets and templates
└── paths.rs      filesystem path helpers

Contributing

Bug reports, feature ideas, documentation improvements, and pull requests are welcome. For code changes, run the relevant checks above and keep credentials, local databases, and generated bundles out of commits.

License

CGswitch is released under the MIT License. Some provider icons (ChatGPT, DeepSeek, MiniMax, OpenCode, Qwen, xAI, Zhipu) are sourced from thesvg.org; the rest are in-house or sourced separately. Each SVG keeps its own source notice.

About

CGswitch — config profile manager for Codex / ChatGPT desktop apps. Save models, API providers, and ChatGPT accounts as profiles and switch in one click; auto-writes ~/.codex and restarts Codex as needed. Tauri 2 · Windows / macOS.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages