CodexGate

A self-hosted tool by KomodoDev

Your workspace.
Connected.

Bring Codex, your devices, and everyday tools together through a gateway you run on your own machine.

macOS and Ubuntu · Web Admin and Web User · Local configuration

One gateway. Your tools.
# Prepare your environment$ uv run codexgate setup# Run it as a user service$ uv run codexgate service start# Connect a device$ uv run codexgate pair --qr

Command directory

Find the command first.

Choose a command below, then jump to its explanation and examples. Commands run from your gateway installation.

Read the reference

Use codexgate --help after binary installation, or append --help to a command for its exact options. approve is an alias of verify.

One place to connect

Your tools, without the extra distance.

01

Reach your Codex workspace

Connect through Web User while Web Admin handles local gateway management, pairing, and configuration.

02

Bring your integrations

Use configured plugin profiles, Cloudflare tunnels, WhatsApp, storage, and automation from a shared gateway.

03

Keep the controls close

Run gateway processes under your OS user. Manage devices, credentials, services, and migrations explicitly.

Installation

One command. Install or update.

Run in Terminal as your normal OS user. The installer detects your operating system and processor, downloads the latest release, and installs or updates CodexGate. Existing settings and data are preserved.

Before you begin

Supports macOS and Ubuntu on Intel/AMD 64-bit and ARM64. curl must already be available. On Ubuntu, the installer prepares missing system dependencies and asks for your sudo password when needed.

curl -fsSL https://github.com/komododevapp/codexgate/releases/latest/download/install.sh | sh

The same command handles future updates, including migrations and managed service restarts. Initial application configuration is described in the setup reference.

Check service status

Use service status to see the current state and service addresses.

codexgate service status
codexgate admin service status

CLI reference

A command for each job.

Examples below use codexgate from the source checkout. The command name is codexgate; uv run selects its project environment. Commands that print structured output support --json where noted.

setup [component]

Prepare an installation or a selected dependency. Omitting the component selects all. Existing configuration is reused; setup is not a gateway service restart.

Setup components
ComponentPurpose
allPrepare Codex, PostgreSQL and migrations, Centrifugo, Evolution, Garage, and plugins.
codexCheck or install the supported local Codex CLI. Login remains a separate operator action.
postgresPrepare the local PostgreSQL login/database and apply migrations.
centrifugoPrepare realtime configuration; a shared service may require a separate reload.
evolutionConnect or prepare the native Evolution API used for WhatsApp.
garagePrepare local S3-compatible storage and its connection profile.
blender · remotionPrepare the selected local application's requirements.
pluginsInstall gateway plugin packages; repeat --plugin to select plugins.
instructionsPrepare gateway-managed workspace instructions.
nginxGenerate a proxy template, or explicitly prepare an inactive site configuration.
checkInspect setup status without installing components.
codexgate setup check
codexgate setup postgres
codexgate setup plugins --plugin codexgate-tool
codexgate setup centrifugo --centrifugo-config /path/to/config.toml
codexgate setup nginx --domain gateway.example.com

--yes uses existing settings/defaults without the wizard; review configuration first. Nginx options include --target gateway|storage|garage, --mode template|install, --output, upstreams, listen port, and TLS certificate/key paths. Use setup --help before preparing a site; generation is not proxy activation.

migrate

Apply pending Alembic migrations to the configured database. Setup runs this as part of PostgreSQL preparation; updates should run it explicitly after stopping gateway services.

codexgate migrate

A database connection and the migration files from the installed version must be available. If migration fails, resolve the reported error before starting that version.

service <action>

Manage the gateway's native user service. macOS uses launchd; Ubuntu uses the user's systemd service. Registration and startup are separate actions.

Gateway service actions
ActionBehavior
installRegister without starting. Optional --project-dir selects the installation directory.
start · stop · restartStart, stop, or restart the gateway supervisor and its owned processes.
statusShow service status. Add --json for machine-readable output.
restart-apiRestart only the API workers.
restart-runtimeRestart only Runtime Codex.
restart-whatsappRestart only Runtime WhatsApp.
restart-automationRestart only Runtime Automation.
restart-toolsRestart only Runtime Tools.
restart-third-partyRestart only Runtime Third Party.
uninstallRemove the native gateway service registration; not a database deletion.
codexgate service status --json
codexgate service restart-api

All listed service actions accept --json. restart-runtime controls the gateway runtime, not the separate Codex App Server daemon. Web Admin has its own service below.

admin

admin serve runs Web Admin in the foreground. admin service manages its independent native user service.

codexgate admin service install
codexgate admin service start
codexgate admin service status --json
codexgate admin service restart

Available service actions: install, start, stop, restart, status, and uninstall. Each accepts --json; install also accepts --project-dir. Restarting Admin does not restart the gateway API or its runtimes.

web

web setup installs exact frontend dependencies with npm. web build builds the selected React application without restarting services.

codexgate web setup
codexgate web build --target user
codexgate web build --target admin --install

--target accepts user or admin and defaults to user. --install forces dependency installation before build. Source builds need Node.js 22.12+ and npm.

pair

Create a short-lived pairing invitation. Use --qr to display a QR in the terminal, or --json for structured output; the two flags are mutually exclusive.

codexgate pair --qr

pairings

List pairing history and IDs. Filter with --status all|pending|approved|revoked; default is all. Optional --json returns structured output.

codexgate pairings --status pending

devices

devices and devices list show registered devices. Grant or remove gateway-management permission without re-pairing using an exact device UUID.

codexgate devices list
codexgate devices grant <device_id> --manage-gateway true
codexgate devices grant <device_id> --manage-gateway false

Device listing and grant accept --json. Grant explicitly requires --manage-gateway true|false.

verify <pairing_id> alias: approve

Approve one exact pending pairing. Add --manage-gateway only when management access is intended. Optional --json returns the result.

codexgate verify <pairing_id>
codexgate approve <pairing_id> --manage-gateway

reject <pairing_id>

Reject one pending pairing request. Accepts --json.

suspend <device_id>

Suspend an existing device's gateway access. Accepts --json.

revoke <device_id>

Revoke the selected device's gateway access. Confirm the exact device before executing. Accepts --json.

reactivate <device_id>

Create a new pairing invitation for an existing device. This is not immediate approval. Accepts --json.

app-servers

Discover local Codex App Servers without stopping or restarting them. Add --json for structured discovery, --pid for one process, or --use-socket to save a discovered local Unix endpoint into .env.

codexgate app-servers --json
codexgate app-servers --use-socket

Advanced option --show-token requires --pid and can reveal a private token. Do not use it for ordinary discovery or share its output.

s3

Manage encrypted S3 connection profiles. Private JSON files are read locally; do not put credentials in shell arguments or public documentation.

S3 profile commands
CommandPurpose
s3 key-initInitialize the local master key without printing or replacing an existing key.
s3 profilesList profile metadata without credentials.
s3 put <name> --file <path>Create a profile from an owned private JSON file. Gateway generates its stable ID; duplicate names are rejected.
s3 delete <profile_id>Remove the stored profile through the gateway lifecycle; provider resources are left unchanged.

The input file must be an owned private regular file, at most 64 KiB. --file - reads JSON from standard input.

plugins settings

Inspect and patch provider configuration stored in PostgreSQL. Secret values remain hidden when reading configuration.

Plugin configuration commands
CommandPurpose
plugins settings listList provider configuration metadata.
plugins settings show <plugin_id>Read configuration with secret values hidden.
plugins settings set <plugin_id> --file <path>Patch values from a private JSON file; - selects standard input.
plugins settings import-envImport missing legacy provider settings. Optional --remove-env removes migrated legacy keys from local .env only after successful import.

These are configuration commands, not Codex plugin package installation. Use setup plugins to install plugin packages. Use Web Admin for profile connection/OAuth where supported.

Foreground processes

Use these for explicit foreground operation and diagnostics. Do not run duplicate processes against an already-managed installation. Normal installations should prefer service start.

Foreground commands
CommandRuns
superviseThe gateway supervisor and its owned API/runtime processes.
serveThe HTTP API using configured settings.
runtimeThe singleton Codex runtime on its private Unix socket.
whatsapp-runtimeThe isolated WhatsApp runtime.
automation-runtimeThe isolated automation runtime.
third-party-runtimeThe isolated third-party application runtime.
tools-runtimeThe allowlisted runtime-tools process.

Web Admin's foreground equivalent is admin serve. Gateway runtimes and the external Codex App Server are separate lifecycle owners.

Updates

Use the same installer.

Run the install.sh command above to get the latest release. Your configuration and data stay in place. The installer runs migrations and restarts managed services; an up-to-date installation is left unchanged.

Distribution

One CLI. Four native targets.

Use the installer to select the correct latest bundle automatically. Archives include the complete application bundle and are accompanied by SHA256SUMS. Homebrew and APT channels are being prepared; no package-manager install command is advertised before publication.

GitHub Releases