### Quick Start: Install and Sign In to OpenCode Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md This is the initial setup for OpenCode. It installs the necessary package and initiates the login process to authenticate your account. ```bash npx -y oc-codex-multi-auth@latest opencode auth login ``` -------------------------------- ### Guided Onboarding Commands Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Useful commands for initial setup and diagnostics after installing the plugin. ```text codex-setup codex-help topic="setup" codex-doctor codex-next ``` -------------------------------- ### Local Development Setup with npm Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/CONTRIBUTING.md Clone the repository and install dependencies using npm. This is the initial setup for local development. ```bash git clone https://github.com/ndycode/oc-codex-multi-auth.git cd oc-codex-multi-auth npm ci ``` -------------------------------- ### Fastest Install and Run Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Use this command for the quickest installation and to run an initial command. It installs the latest version of the plugin and executes a sample task. ```bash npx -y oc-codex-multi-auth@latest opencode auth login opencode run "Explain this repository" --model=openai/gpt-5.5 --variant=medium ``` -------------------------------- ### Default Installer Mode Example Configuration Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FLOW.md This JSON structure represents the default configuration written by the installer, using modern base model entries and variants. It focuses on OAuth model families for the TUI picker. ```json { "plugin": ["oc-codex-multi-auth"], "provider": { "openai": { "options": { "reasoningEffort": "medium", "reasoningSummary": "auto", "textVerbosity": "medium", "include": ["reasoning.encrypted_content"], "store": false }, "models": { "gpt-5.4": { "name": "GPT 5.5 (OAuth)", "variants": { "medium": { "reasoningEffort": "medium" }, "high": { "reasoningEffort": "high" } } } } } } } ``` -------------------------------- ### Verify Setup with GPT-5.5-fast Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Run this command to verify the setup using the GPT-5.5-fast model with a medium variant. ```bash opencode run "Create a short TODO list for this repo" --model=openai/gpt-5.5-fast --variant=medium ``` -------------------------------- ### Verify Setup with GPT-5.5 Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Run this command to verify the setup using the recommended current GPT-5.5 path with a medium variant. ```bash opencode run "Create a short TODO list for this repo" --model=openai/gpt-5.5 --variant=medium ``` -------------------------------- ### Install from Source Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Clone the repository and install dependencies to develop or test the plugin locally. Ensure you use the built 'dist/' directory for OpenCode configuration. ```bash git clone https://github.com/ndycode/oc-codex-multi-auth.git cd oc-codex-multi-auth npm ci npm run build ``` -------------------------------- ### Install with Legacy Layout Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Use this flag to install the plugin with the older explicit-only layout. ```bash npx -y oc-codex-multi-auth@latest --legacy ``` -------------------------------- ### OpenCode Command Toolkit: Setup and Help Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md These commands are part of the initial setup and provide help for using OpenCode. `codex-setup` assists with first-run configuration, and `codex-help` lists available plugin commands. ```bash codex-setup codex-help codex-doctor codex-next ``` -------------------------------- ### Verify Setup with GPT-5-Codex Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Run this command to verify the setup using the GPT-5-Codex model with a high variant, inspecting retry logic. ```bash opencode run "Inspect the retry logic and summarize it" --model=openai/gpt-5-codex --variant=high ``` -------------------------------- ### Run Codex Setup Wizard Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Initialize or reconfigure your Codex environment. The --wizard flag provides an interactive setup experience. ```text codex-setup codex-setup --wizard codex-next ``` -------------------------------- ### Install oc-codex-multi-auth Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/ARCHITECTURE.md Run this command to install or refresh the oc-codex-multi-auth OpenCode plugin. Optional flags like --modern, --full, or --legacy can specify the installation type. ```bash npx -y oc-codex-multi-auth@latest [--modern|--full|--legacy] ``` -------------------------------- ### Installer Script Path Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/architecture.md The npm bin for oc-codex-multi-auth points to this installation script. ```text oc-codex-multi-auth -> scripts/install-oc-codex-multi-auth.js ``` -------------------------------- ### Perform Dry Run Installation Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/TESTING.md Execute a dry run of the oc-codex-multi-auth installation to verify setup without making actual changes. This is part of the install + config smoke check. ```bash npx -y oc-codex-multi-auth@latest --dry-run ``` -------------------------------- ### Install oc-codex-multi-auth Plugin Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md Use this command to install the latest version of the oc-codex-multi-auth OpenCode plugin. This command handles the installation and updates necessary configuration files. ```bash npx -y oc-codex-multi-auth@latest ``` -------------------------------- ### Modern Model Selection Example Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FIELDS.md Example command for selecting a model and variant in modern OpenCode templates. Ensure explicit GPT-5.5 preset IDs are used for reliable CLI verification. ```bash opencode run "task" --model=openai/gpt-5.5 --variant=high ``` -------------------------------- ### Run Task with Modern Model Variants Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/config/README.md Examples of running tasks using recommended compact UI selectors with different models and variants. ```bash opencode run "task" --model=openai/gpt-5.5 --variant=medium ``` ```bash opencode run "task" --model=openai/gpt-5.5-fast --variant=medium ``` ```bash opencode run "task" --model=openai/gpt-5-codex --variant=high ``` -------------------------------- ### Check Plugin Installation Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Verify that the plugin is installed in the expected cache location. If it's missing or corrupted, reinstalling can resolve the issue. ```bash ls ~/.cache/opencode/node_modules/oc-codex-multi-auth ``` ```bash npm view oc-codex-multi-auth version ``` ```bash npx -y oc-codex-multi-auth@latest ``` -------------------------------- ### Legacy Model Selection Example Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FIELDS.md Example command for selecting a model in legacy OpenCode templates. Use explicit model IDs like 'openai/gpt-5.5-high'. ```bash opencode run "task" --model=openai/gpt-5.5-high ``` -------------------------------- ### Install Full Explicit Preset IDs Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/config/README.md Command to install explicit preset IDs for scripts if you need direct selector IDs. ```bash npx -y oc-codex-multi-auth@latest --full ``` -------------------------------- ### Verify OpenCode Wiring and Configuration Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md These commands help verify the installation and configuration of OpenCode. They check the version, debug configuration, and initiate the authentication login flow. ```bash opencode --version opencode debug config opencode auth login ``` -------------------------------- ### Verify OpenCode Auth and Codex OAuth Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/skills/oc-codex-setup/SKILL.md Run this command after login to verify your setup. It sends a request to explain a repository using a specified model. ```bash opencode run "Explain this repository" --model=openai/gpt-5.5-medium ``` -------------------------------- ### Global Configuration Options for All Models Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/configuration.md Set global configuration options that apply to all models. This example demonstrates setting the plugin name and provider-specific options for OpenAI. ```json { "plugin": ["oc-codex-multi-auth"], "provider": { "openai": { "options": { "reasoningEffort": "high", "textVerbosity": "high", "store": false } } } } ``` -------------------------------- ### Run Task with Default Model and Variant Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FLOW.md Execute a task using a specific model and variant combination in the default installer mode. This command selects the 'gpt-5.5' model with the 'medium' variant. ```bash opencode run "task" --model=openai/gpt-5.5 --variant=medium ``` ```bash opencode run "task" --model=openai/gpt-5.5-fast --variant=medium ``` -------------------------------- ### Run Diagnostic Tools Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Use these commands for guided recovery and debugging. They can also output machine-readable JSON for automation. ```bash codex-setup codex-doctor codex-doctor --fix codex-next ``` ```bash codex-status format="json" codex-limits format="json" codex-health format="json" codex-next format="json" codex-list format="json" codex-dashboard format="json" codex-metrics format="json" codex-doctor deep=true format="json" ``` -------------------------------- ### Launch Visual Test UI Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/test/README.md Starts the Vitest visual test runner UI, providing an interactive interface for managing and running tests. ```bash npm run test:ui ``` -------------------------------- ### Run Task with Full Mode Model ID Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FLOW.md Execute a task using a specific model ID in full installer mode. This command selects a combined model ID, such as 'gpt-5.5-medium'. ```bash opencode run "task" --model=openai/gpt-5.5-medium ``` ```bash opencode run "task" --model=openai/gpt-5.5-fast-medium ``` -------------------------------- ### Run a Smoke Request with Specific Model and Variant Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md This command executes a test request to ensure OpenCode is functioning correctly with a specified model and variant. It's useful for validating the setup after installation. ```bash opencode run "Explain this repository" --model=openai/gpt-5.5 --variant=medium ``` -------------------------------- ### Enable Beginner Safe Mode (JSON) Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Configure beginner safe mode in JSON format for conservative retry behavior. ```json { "beginnerSafeMode": true } ``` -------------------------------- ### Modern Compact Install oc-codex-multi-auth Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/skills/oc-codex-setup/SKILL.md Use this command on OpenCode v1.0.210+ for the compact variant-based config. Ensure you have npx installed. ```bash npx -y oc-codex-multi-auth@latest --modern ``` -------------------------------- ### Enable Beginner Safe Mode (Environment Variable) Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Enable beginner safe mode using an environment variable for conservative retry behavior. ```bash CODEX_AUTH_BEGINNER_SAFE_MODE=1 opencode ``` -------------------------------- ### Interactive Beginner Commands Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/TESTING.md Execute beginner commands in an interactive session to verify their output and behavior, including checklist, wizard, doctor findings, and command listings. Ensure they render cleanly and degrade gracefully outside TTYs. ```text codex-setup codex-setup --wizard codex-doctor codex-doctor --fix codex-next codex-list ``` -------------------------------- ### Build Project Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/AGENTS.md Builds the project by cleaning the dist directory, running TypeScript compilation, and copying the oauth-success.html file. ```bash npm run build # clean dist + tsc + copy oauth-success.html ``` -------------------------------- ### Build Project Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/TESTING.md Compile and build the project. This is a standard part of the PR checklist. ```bash npm run build ``` -------------------------------- ### Codex Tool Factory Function Example Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/lib/tools/AGENTS.md Example of a factory function for a `codex-refresh` tool. It takes a `ToolContext` and returns a `ToolDefinition`. Ensure necessary imports from `@opencode-ai/plugin/tool` and the `ToolContext` type are included. ```typescript import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"; import type { ToolContext } from "./index.js"; export function createCodexRefreshTool(ctx: ToolContext): ToolDefinition { const { resolveUiRuntime, formatCommandAccountLabel } = ctx; return tool({ description: "…", args: {}, async execute() { const ui = resolveUiRuntime(); // … }, }); } ``` -------------------------------- ### Running Quality Gates with npm Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/CONTRIBUTING.md Execute the project's quality gates, including TypeScript type checking, ESLint linting, testing with Vitest, and building the project. ```bash npm run typecheck # strict TypeScript npm run lint # ESLint (no warnings allowed) npm test # Vitest full suite npm run build # Compile to dist/ ``` -------------------------------- ### Configure Plugin Name Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FIELDS.md Specify the plugin name in the OpenCode configuration. The installer normalizes this to an unpinned value. ```json { "plugin": ["oc-codex-multi-auth"] } ``` -------------------------------- ### Docs Directory Structure Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/DOCUMENTATION.md Detailed layout of the 'docs/' directory, containing site configuration and user/developer guides. ```text docs/ ├── _config.yml # docs site config ├── DOCUMENTATION.md # this repository documentation map ├── README.md # docs portal / navigation ├── index.md # documentation landing page ├── architecture.md # public architecture overview ├── getting-started.md # install + first-run guide ├── configuration.md # full config reference ├── troubleshooting.md # operational debugging guide ├── faq.md # short common answers ├── privacy.md # data handling notes ├── OPENCODE_PR_PROPOSAL.md # upstream OpenCode proposal notes ├── development/ │ ├── ARCHITECTURE.md # technical design and current module/docs layout │ ├── GITHUB_DISCOVERABILITY.md # repository description, topics, and search terms │ ├── CONFIG_FIELDS.md # config field semantics │ ├── CONFIG_FLOW.md # config resolution internals │ ├── TESTING.md # testing strategy and commands │ └── TUI_PARITY_CHECKLIST.md # auth dashboard UI parity checks └── audits/ ├── INDEX.md ├── 01-executive-summary.md ... 16-verdict.md ├── _findings/ # T01 through T16 detailed findings └── _meta/ # audit rubric, ledger, environment, verification ``` -------------------------------- ### Add Plugin to OpenCode Configuration Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Manually edit '~/.config/opencode/opencode.json' to add the plugin if not using the installer. This ensures OpenCode recognizes the plugin. ```json { "$schema": "https://opencode.ai/config.json", "plugin": ["oc-codex-multi-auth"] } ``` -------------------------------- ### Preview Import Safely Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Use the `dryRun=true` option to preview the effects of an import operation without actually modifying existing accounts. ```text codex-import path="~/backup/accounts.json" dryRun=true ``` -------------------------------- ### Running Vitest in Watch Mode Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/CONTRIBUTING.md Start Vitest in watch mode for iterative testing. This automatically re-runs tests when files change. ```bash npx vitest watch ``` -------------------------------- ### OpenCode Command Toolkit: Daily Use Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md Commands for daily interaction with OpenCode, including listing accounts, switching between them, checking status, viewing limits, and accessing the dashboard. ```bash codex-list codex-switch codex-status codex-limits codex-dashboard ``` -------------------------------- ### Verify OpenCode Configuration and Login Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md These commands are used to verify the OpenCode configuration and the authentication login process. They are part of the verification steps for LLM agents. ```bash opencode debug config opencode auth login opencode run "ping" --model=openai/gpt-5.5 --variant=medium ``` -------------------------------- ### Perform Account Import Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Execute the import command after a successful preview to import accounts from a JSON file. A backup is automatically created if existing accounts are present. ```text codex-import path="~/backup/accounts.json" ``` -------------------------------- ### Account Pool Health Check Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md To diagnose an unhealthy account pool, run these commands to get detailed health and diagnostic information in JSON format. ```bash codex-health format="json" codex-doctor deep=true format="json" ``` -------------------------------- ### Run OpenCode with Logging Enabled Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Enable request logging for verifying request routing. Logs are created under ~/.opencode/logs/codex-plugin/. ```bash ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "test" --model=openai/gpt-5.5 --variant=medium ``` -------------------------------- ### Run Codex Diagnostics Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Execute guided diagnostics and safe auto-remediation for Codex CLI issues. Use the --fix flag for automatic problem resolution. ```text codex-doctor codex-doctor --fix ``` -------------------------------- ### Verify OpenCode Configuration Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FIELDS.md Use 'opencode debug config' to view merged configurations. For runtime verification, use 'ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "ping" --model=openai/gpt-5.5-medium'. ```bash opencode debug config ``` ```bash ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "ping" --model=openai/gpt-5.5-medium ``` -------------------------------- ### Run Unit Tests Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/TESTING.md Execute the project's unit tests. This is a standard part of the PR checklist. ```bash npm test ``` -------------------------------- ### Run OS-keychain Backend Tests Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/CONTRIBUTING.md Execute tests for the OS-keychain backend, using the actual OS keychain instead of an in-memory mock. Ensure to unset any mocks before running. ```bash CODEX_KEYCHAIN=1 npm test -- test/storage-keychain.test.ts ``` -------------------------------- ### Verify OpenCode Configuration Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/CONFIG_FLOW.md Use `opencode debug config` to view merged provider models. To test runtime behavior with logging enabled, use `ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "ping" --model=openai/gpt-5.5 --variant=medium`. ```bash opencode debug config ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "ping" --model=openai/gpt-5.5 --variant=medium ``` -------------------------------- ### Account Switching Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md When the wrong account is selected, use these commands to list available accounts and then switch to the correct one. ```bash codex-list codex-switch ``` -------------------------------- ### Configure Fast Session Mode Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Enable fast-session mode to speed up interactive turns. The 'hybrid' strategy is recommended for balancing speed and prompt complexity. Configuration can be done via a JSON file or environment variables. ```json // ~/.opencode/openai-codex-auth-config.json { "fastSession": true, "fastSessionStrategy": "hybrid", "fastSessionMaxInputItems": 24 } ``` ```bash CODEX_AUTH_FAST_SESSION=1 opencode ``` -------------------------------- ### Run Release-Grade Commands Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/development/TESTING.md Execute these commands before opening a Pull Request to ensure code quality and stability. They cover linting, type checking, testing, coverage, building, and dependency auditing. ```bash npm run lint npm run typecheck npm run test npm run test:coverage npm run build npm run audit:ci ``` -------------------------------- ### Create Timestamped Backups Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/troubleshooting.md Run `codex-export` without a path to create timestamped backups of your accounts in the `backups/` directory. ```text codex-export ``` -------------------------------- ### Run Prompt with Compact Modern Selectors Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md Execute prompts using compact and modern model selectors. This allows for concise specification of the model and variant for your requests. ```bash opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.5 --variant=medium opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.5-fast --variant=medium ``` -------------------------------- ### Check OpenCode Version Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/config/README.md Command to check your current OpenCode version. ```bash opencode --version ``` -------------------------------- ### Run OpenCode Command Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/getting-started.md Execute a command with a specified model. Use --full to access explicit model entries like gpt-5.5-medium. ```bash opencode run "Create a short TODO list for this repo" --model=openai/gpt-5.5-medium ``` -------------------------------- ### Manage OS Keychain Backend for Credentials Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/README.md Commands to manage the OS-native keychain for storing account credentials. Falls back to JSON if keychain is unavailable. ```text codex-keychain status ``` ```text codex-keychain migrate ``` ```text codex-keychain rollback ``` -------------------------------- ### Check Project Storage Path Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/configuration.md When per-project accounts are not working, ensure you are in a project directory. The plugin auto-detects the project root and uses a namespaced file under `~/.opencode/projects/`. If no project root is found, it falls back to global storage. ```bash DEBUG_CODEX_PLUGIN=1 opencode # look for storage path in logs ``` -------------------------------- ### Test Per-Model Options with Logging Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/configuration.md Enable plugin request logging to compare the effects of different per-model options. This is useful for verifying that specific `reasoning.effort` settings are applied correctly. ```bash # default compact selectors ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "test" --model=openai/gpt-5.5 --variant=medium ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "test" --model=openai/gpt-5.5 --variant=high # direct selector IDs, only after installing with --full ENABLE_PLUGIN_REQUEST_LOGGING=1 opencode run "test" --model=openai/gpt-5.5-medium # compare reasoning.effort in logs cat ~/.opencode/logs/codex-plugin/request-*-after-transform.json | jq '.reasoning.effort' ``` -------------------------------- ### Check Config Validity Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/configuration.md Run the `opencode` command to check if the configuration is valid. Errors will be displayed if the configuration is invalid. ```bash opencode # shows errors if config is invalid ``` -------------------------------- ### Configuration Templates Source: https://github.com/ndycode/oc-codex-multi-auth/blob/main/docs/DOCUMENTATION.md Templates for different OpenCode configurations, located in the 'config/' directory. ```json config/opencode-modern.json - OpenCode v1.0.210+ variant-based template config/opencode-legacy.json - OpenCode v1.0.209 and below template config/minimal-opencode.json - minimal debug template config/README.md - template-selection guide ```