Skip to content

feat(commands): add Commands.Plugin and Commands.Queue - #179

Merged
joshrotenberg merged 2 commits into
mainfrom
feat/158-plugin-queue
Nov 10, 2026
Merged

joshrotenberg merged 2 commits into
mainfrom
feat/158-plugin-queue

Conversation

@joshrotenberg

Copy link
Copy Markdown
Collaborator

Closes #158.

Plan

Wrap the two top-level subcommands codex-cli 0.165.0 has that raw/2 is the only route to today.

  • CodexWrapper.Commands.Plugin: list/2 (:marketplace, :available), add/3 and remove/3 (:marketplace), marketplace_add/3 (:ref, :sparse), marketplace_list/2, marketplace_upgrade/3 (optional name) and marketplace_remove/3. Every call passes --json and returns the decoded JSON; each also takes :config, :enable and :disable. A non-zero exit returns {:error, {:exit, code, output}} as raw/2 does; output that does not decode returns {:error, {:json, output}}.
  • CodexWrapper.Commands.Queue.add/4: codex queue --thread <thread> --message <text> with :remote, :remote_auth_token_env, :images and the session options the help lists (:model, :profile, :sandbox, :cd, :add_dir, :worktree, :approve_for_me, ...). Returns the trimmed output.
  • Values go as --flag=value and positionals after --, so a value starting with - is not parsed as a flag. mix codex.contract learns to read --flag=value tokens.
  • mix codex.contract covers every new subcommand.
  • Arg-list tests and fake-binary tests for the JSON and exit paths.

Measured with an isolated CODEX_HOME (no plugins installed): plugin list --json prints {"installed": [], "available": []}, plugin marketplace list --json prints {"marketplaces": []}, and codex queue for an unknown thread exits 1 with failed to queue session message: thread/queue/add failed: failed to read thread: invalid thread-store request: no rollout found for thread id .... Queueing to a live session was not run, since it needs a paid session; the docs say what the command reads (the local thread store) and that the message text is visible in the process table.

Commands.Plugin wraps codex plugin list/add/remove and plugin
marketplace add/list/upgrade/remove, passing --json and returning the
decoded document. Commands.Queue.add/4 wraps codex queue. Values go as
--flag=value and positionals after --, so values starting with - are
not read as flags. codex queue rejects --image and --worktree at run
time on codex-cli 0.165.0, so Queue has no options for them.

mix codex.contract covers both subcommands and reads --flag=value
tokens.

Closes #158
@joshrotenberg
joshrotenberg marked this pull request as ready for review November 10, 2026 21:45
@joshrotenberg
joshrotenberg merged commit 26e203d into main Nov 10, 2026
5 checks passed
@joshrotenberg
joshrotenberg deleted the feat/158-plugin-queue branch November 10, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Commands.Plugin and Commands.Queue

1 participant