6Codex account formats, from Cockpit Tools to CLIProxyAPI

CLIppet

Run Claude Code, Codex, QoderCLI, pi, Copilot CLI and Antigravity CLI as whichever account you choose: interactively, headless, or side by side.

CLIppet gives every run its own identity. An env is a real HOME directory with its own login, sessions and history, so switching accounts means switching envs instead of logging out. Bring the Codex accounts you already keep in Cockpit Tools, sub2api or CLIProxyAPI, pass any flag through to the agent, and drive it all from the terminal, a TUI or Python.

  • MITLicense
  • 3.10+Python
  • 6 agent CLIsClaude Code · Codex · Qoder · pi · Copilot · Antigravity
Walkthrough: choose the env work, run clippet -e work codex resume --last, watch CLIppet pull work's newest login, point CODEX_HOME at the env and hand the terminal to Codex, then send one prompt to three envs from the terminal UI and watch the three runs finish.
what a launch goes through
Your command
clippet -e work codex resume --last: resume --last goes to Codex as is
CLIppet
Finds the env, pulls its newest login, drops the variables that would point Codex elsewhere. Logins come from:
Cockpit Toolssub2apiCLIProxyAPIauth.json
~/.clippet/envs/work
.codex/auth.jsonalice · plus
.codex/config.tomlcopied from yours
.gitconfiglinked to yours
.codex/sessions/work's own
The agent, unchanged
claudecodexqoderclipicopilotagy
The real CLI, with its config folder in the env, or the env as its $HOME.
examples

Envs. An env is a HOME of its own: one login, its sessions, its history.

$ clippet env create work --from-current   # your config, none of your logins
$ clippet -e work codex login              # log in once, inside the env
$ clippet -e work codex                    # from now on, always this account
$ clippet -e work codex resume --last      # the rest goes to Codex as is

# two envs, two accounts, at the same time
$ clippet -e personal codex                # in one terminal
$ clippet -e work codex                    # and in another

Accounts. Put a Codex account from another tool into an env.

$ clippet auth list cockpit                       # what Cockpit Tools holds
$ clippet env import work cockpit --account 2     # linked to account #2
$ clippet env import bob ./backup.json --account bob   # an export
$ clippet -e work codex                           # Codex, logged in as #2

# or skip the env: a throw-away one for one run
$ clippet -c sub2api-account.json codex

Headless. Run once and print the answer.

$ clippet -e work codex -p "Explain the failing test"

# arguments after the prompt go to codex exec
$ clippet -e work codex -p "Fix it" -c model_reasoning_effort=high

# a project's .clippet.json can pick the env for you
$ clippet codex -p "Summarize the open TODOs"

Python. The same envs, side by side, with structured results.

from clippet import ClippetRunner, AgentRequest, get_environment
from clippet.config.detector import create_adapter_with_second_home

runner = ClippetRunner(max_workers=2)
for env in ("work", "personal"):            # two envs, two accounts
    home = get_environment(env)["home_dir"]
    runner.register(env, create_adapter_with_second_home(home, "codex"))

request = AgentRequest(task_prompt="Fix the flaky test", workspace_dir=".")
results = runner.execute_parallel({"work": request, "personal": request})
# each AgentResult: output_text, tool_calls, usage, session_id
6
agent CLIs: Claude Code, Codex, QoderCLI, pi, Copilot CLI, Antigravity CLI
6
Codex account formats it can read
1
HOME per env, with its own login
5
places in the terminal UI
How it works

There are three ways to run an agent. Each one picks who the agent is first.

01

Interactive

Hands your terminal to the agent, running in the env. Everything after the agent name, apart from CLIppet's own -p, goes to the agent unchanged, so its own subcommands and flags keep working.

Entry point
clippet -e work codex resume --last
02

Headless

Runs the agent once with -p and prints its final answer. Arguments after the prompt go to the agent's own headless command, such as codex exec.

Entry point
clippet -e work codex -p "Fix it"
03

From Python

One run() for every CLI and a structured result back: the answer from all four, plus tool calls, usage and session id from Codex and Claude Code. ClippetRunner runs several side by side, and run_async streams each line as it comes.

Entry point
runner.execute_parallel(
    {"work": req, "personal": req})

No env? Point -c at a credential file for a throw-away env, or pick base to run in your own HOME.

Codex accounts

Bring the accounts you already have, wherever you keep them.

CLIppet reads Codex logins from the tools people use to manage them, turns each into Codex's own auth.json, and puts it in an env or a throw-away one. Pick one with --account: an index, an e-mail, a label or an account id.

linked

Cockpit Tools store

cockpit

The live, encrypted account store, read only. An env linked to one of its accounts pulls the newest login before every launch from the CLI or the TUI.

Cockpit Tools export

cockpit_auto_backup_*.json

Backups and data-transfer files. Only the Codex accounts in them are read.

sub2api export

sub2api-account-*.json

Accounts with platform: openai. Claude and Gemini entries are left alone.

CLIProxyAPI

codex-*.json

The Codex token files CLIProxyAPI keeps, one account in each.

Codex auth.json

~/.codex/auth.json

A ChatGPT login or an API key, passed through as it is. A HOME or CODEX_HOME folder works too.

Token bundle

{"id_token", "access_token", "refresh_token"}

Bare tokens, also nested under tokens or credentials. The access token must be an OpenAI JWT.

Codex accounts from Cockpit Tools, a Cockpit export, sub2api, CLIProxyAPI or auth.json are imported into the env acct-a with clippet env import; the env then launches Codex logged in as that account.
  • Logins are not copied between envs unless you pass --with-auth. OAuth refresh tokens rotate, so the first copy that refreshes would break the others.
  • A linked env leaves refreshing to the account manager; clippet env sync pulls the newest login on demand.
  • When Codex refreshes a login during a run, CLIppet writes it back to its auth.json, or keeps it under ~/.clippet/refreshed/.
  • Accounts that need a new login, ChatGPT web-session tokens and non-OpenAI tokens are flagged or skipped.
Use cases

Things you can do without logging out.

01

Keep work and personal agents apart

Each env keeps its own login, sessions, MCP state and history. Two envs can run at once, as two different accounts.

$ clippet -e personal codex   # one terminal
$ clippet -e work codex       # another, at the same time
env create-e work
02

Use the accounts in Cockpit Tools

List its Codex accounts and link an env to one of them.

auth list cockpitenv import
03

Pin an env to a project

A .clippet.json holds only references, so plain clippet codex picks the right account there.

.clippet.json
04

Ask several accounts at once

Mark envs in the TUI, send one prompt, and watch every run stream in.

clippet tuiSpacei
05

Keep every agent flag

Subcommands and options after the agent name reach the agent unchanged. Only a -p right after the name is CLIppet's, and -- passes even that on.

resume --lastlogin-c key=value
06

Script agents from Python

Run any of the four CLIs with one interface, and watch Codex's events as they arrive.

run()run_async(on_output=…)execute_parallel
07

Pick up where an env left off

The TUI lists each env's recent Codex sessions and resumes one in its own folder.

rscodex resume
08

Use a gateway key

Point Codex at sub2api or another OpenAI-compatible gateway with its own key and config.

--codex-config
09

See who an agent will be

env status shows the account, plan, token expiry and source. The TUI's Checks place lists the agent versions and the variables isolation drops.

env listenv statusChecks
Run clippet --help for the launch options, and clippet env --help or clippet auth --help for the rest. Accounts and environments
Terminal UI

A terminal UI on the same paper.

Plain clippet in a terminal opens it: your envs and their accounts, recent Codex sessions, streamed runs, project pins and checks. T switches between ink and paper, ? lists every key.

The Envs place of clippet tui: a list of envs with their Codex accounts, plans and how much of their usage limits is left, and the selected env's details.

Envs: every env with its Codex account, plan and the quota it has left.

The Runs place of clippet tui: one prompt streamed in two envs, each with its steps and answer.

Runs: one prompt streamed in two envs.

  • 1

    Envs

    Each env's Codex account, plan, quota left, linked source and recent sessions.

    Enter launchr resumen newa import
  • 2

    Accounts

    Every account in Cockpit Tools and in the files you add, the quota it has left, and which env holds it.

    Enter into an envx export+ add a file
  • 3

    Runs

    Prompts you sent, streamed: commands, edits, the answer, tokens.

    c continueR againk stop
  • 4

    Project

    The workspace's .clippet.json and what each agent resolves to.

    p pin an enve edit
  • 5

    Checks

    Agent CLIs and versions, CLIppet's paths, and the variables isolation drops.

    Ctrl+R check again
Under the hood

A run goes down, its result comes back up.

Five parts, one question each: where the run starts, who it runs as, where that login comes from, how CLIppet talks to the agent, and where the agent runs.

CLIppet's architecture: the CLI, the TUI and the Python SDK pick an identity through config/ (Codex accounts come from auth/); an adapter turns the request into the agent's command; isolation.py prepares the sandbox HOME the agent runs in; parsers turn its output into an AgentResult.

Entry points

cli.py · tui/ · orchestrator.py

The CLI, the TUI and the Python SDK drive the same layers.

Identity

config/

An env, a credential file or a .clippet.json pin decides the env and the login.

Accounts

auth/

Codex logins in any supported format become one CodexCredential.

Adapters

adapters/ · parsers/

An AgentRequest becomes the agent's own command; its output becomes an AgentResult.

Sandbox

isolation.py

The agent's config folder (CODEX_HOME, …) or its $HOME points at the env, identity variables are dropped, credentials are written 0600 and refreshed logins are saved.

Quick start

Set it up and run Codex as a second account.

1

Install

Python 3.10 or newer, and the agent CLIs you already use. The extras add the terminal UI and reading the Cockpit Tools store.

bash
pip install "clippet[tui,cockpit] @ git+https://github.com/FanBB2333/CLIppet.git"
Python 3.10+Claude CodeCodexQoderCLIpiCopilot CLIAntigravity CLI

Install only the agents you want to run; CLIppet starts the CLIs you already have.

2

Make an env

Copy your agent configuration (not your logins) into a new env, then log in inside it, or import an account you already have.

bash
clippet env create work --from-current
clippet -e work codex login
# or: clippet env import work cockpit --account 2
3

Run as that account

Launch Codex in the env, pass any of its flags through, run it headless, or open the TUI to see every env at once.

bash
clippet -e work codex
clippet -e work codex -p "Explain this repository"
clippet
Limitations

What CLIppet can and can't do.

CLIppet chooses the HOME, the login and the environment an agent starts with. It is not a security sandbox, and it does not copy logins between envs unless you ask it to.

  • The agent still runs as you, so it can read files outside its workspace and outside its env.
  • Credential stores keyed by absolute paths, such as the macOS Keychain, are only as separate as each agent makes them.
  • A login copied into two envs breaks one of them when its refresh token rotates. Log in inside each env, or link envs to the account manager.
  • Importing accounts from other tools works for Codex only. Claude Code logs in inside an env or takes its own settings file with -c; the other agents log in inside an env.
  • Headless runs print the final answer; for Codex and Claude Code, tool calls, usage and session ids come back through the Python SDK.
How isolation works, and its limits
Get started

Try it with the accounts you already have.

$pip install "clippet[tui,cockpit] @ git+https://github.com/FanBB2333/CLIppet.git"

Then run clippet in a terminal: the TUI shows your envs, the Codex account in each, and their recent sessions.