Skip to content

Add delete command for removing saved accounts#2

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-remove-command-support
Draft

Add delete command for removing saved accounts#2
Copilot wants to merge 2 commits into
mainfrom
copilot/add-remove-command-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 2, 2026

Adds a dedicated delete command to remove saved account profiles, supporting both interactive and non-interactive modes (similar to use).

Changes

  • New delete command (src/commands/delete.ts): Accepts optional account name argument; launches interactive selector if omitted
  • AccountService.removeAccount(): Validates account exists, prevents deleting the active account, removes the account JSON file
  • CannotDeleteActiveAccountError: Clear error when attempting to delete the currently active account
  • README.md: Updated usage examples and command reference

Usage

# Delete by name
codex-auth delete my-account

# Interactive selection
codex-auth delete

Attempting to delete the active account returns an error prompting the user to switch first.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for a delete/remove command</issue_title>
<issue_description>First thank you for this small utility. Really helps when juggling between multiple OpenAI accounts.

Just wanted to recommend a small enhancement. We could add a dedicated remove/delete command to remove profiles. Bonus point if we can either do it interactively or not. Similar to the use command.

While we can still delete profiles manually by navigating to the .codex/accounts folder, having a dedicated command would make the user experience better.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Sls0n <102340248+Sls0n@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for a delete/remove command Add delete command for removing saved accounts Feb 2, 2026
Copilot AI requested a review from Sls0n February 2, 2026 05:20
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.

Add support for a delete/remove command

2 participants