Skip to content

Published package missing bin/lib/actions/rename.cjs → cc-switch crashes with MODULE_NOT_FOUND #2

Description

@shackstack

Summary

After installing via npx claude-code-multi-accounts install, every cc-switch invocation crashes immediately with MODULE_NOT_FOUND, because the published package is missing bin/lib/actions/rename.cjs.

Reproduction

npx claude-code-multi-accounts install
node ~/.claude/multi-account-switch/bin/cc-switch.cjs   # or `cc-switch`

Output:

Error: Cannot find module './lib/actions/rename.cjs'
Require stack:
- ~/.claude/multi-account-switch/bin/cc-switch.cjs
    at Module._resolveFilename (node:internal/modules/cjs/loader)
    ...
  code: 'MODULE_NOT_FOUND'

Cause

bin/cc-switch.cjs:17 does:

const renameAction = require('./lib/actions/rename.cjs');

…and renameAction.runRenameAction is wired in (the --rename / rename path). But bin/lib/actions/ only ships:

list.cjs  remove.cjs  switch.cjs  sync.cjs  usage.cjs

rename.cjs is absent, so the require throws at load time and the whole CLI is unusable (not just the rename subcommand).

Suggested fix

Ship bin/lib/actions/rename.cjs exporting runRenameAction. It is called as:

runRenameAction(existingStore, renameIndex, aliasString, {
  writeStore, options, config,
  getEntryLabel, getDisplayAccounts,
  getStoredAccountsHeading, formatAccountSummary,
});

so it just needs to set/clear entry.alias on the indexed account, writeStore(...), then print the stored-account list — mirroring remove.cjs. (Likely the file just wasn't included in the npm files allow-list / publish.)

Environment

  • Installed via npx claude-code-multi-accounts install
  • Internal STORE_VERSION 0.2.9
  • macOS (Darwin), Node.js v25.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions