Add CLI commands to list and promote managed Codex accounts

Open
#3,191 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
54/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
swift

Research direction

Start by tracing the existing managed-account promotion path in the app target and how CodexBarCLI depends on CodexBarCore. Move only the reusable operation as needed, then add list/promote handling with temporary account stores and synthetic auth.json fixtures; done means safe, atomic, private switching, locking against concurrent promotions, and no credential output.

Written by the indexing model from the issue text.

Description

clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P3

CodexBar already supports multiple managed Codex accounts and lets the user promote one of them to the System Account from the app.

I would like to expose the same explicit operation through the bundled CLI. This would make it possible to change the account used by newly started Codex processes from a terminal or an SSH session on the same Mac.

Suggested command shape:

codexbar codex-accounts list
codexbar codex-accounts promote <id-or-email>

promote is intentional here. The command would change the system Codex authentication, not just the account selected for display in CodexBar.

Expected scope:

  • list shows the managed account label or email, its stable CodexBar ID, and which account currently matches the live system authentication
  • promote reuses the existing managed-account promotion behavior
  • the current, potentially refreshed live credentials are preserved in the matching managed account before switching
  • the live auth.json replacement remains atomic and private
  • ambiguous, missing, or unreadable account state fails without replacing the live authentication
  • app and CLI promotions cannot modify the account store concurrently

The commands must never print access tokens or other credential contents.

Existing Codex processes may retain the identity they started with. The command should not terminate or restart them automatically.

Adding accounts, OAuth login, automatic rotation, quota-based switching, and remote profile synchronization are out of scope. This is a manual operation only. It is related to #2851, but does not implement the automatic depletion policy requested there. It also follows the provider-specific switching direction described in #1843.

The promotion implementation currently lives in the app target, while CodexBarCLI depends on CodexBarCore. If this direction is welcome, the smallest implementation appears to be moving the reusable promotion path into Core, keeping app-specific refresh and UI handling in the app target, and adding a shared process lock around promotion.

Tests can use temporary account stores and synthetic auth.json fixtures only, without reading real credentials or triggering Keychain prompts.

Would this scoped CLI surface be welcome before I prepare a PR?

Dominant language
Swift
Stars
21.6k
Forks
2k
Avg merge
1d 9h
Merged PRs (30d)
385

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from steipete/CodexBar

All issues in steipete/CodexBar

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.