wrangler-auth
v0.1.0
Published
CLI for saving and switching Wrangler auth accounts via ~/.wrangler/config/default.toml snapshots.
Maintainers
Readme
wrangler-auth
wrangler-auth is a small CLI for saving and switching between multiple Wrangler login sessions without repeatedly logging in and out.
It manages Wrangler's active auth file at ~/.wrangler/config/default.toml by saving named snapshots to ~/.wrangler/accounts/<name>.toml, then switching the active config to the snapshot you choose.
[!WARNING] This is not an official Cloudflare tool. It only manages
~/.wrangler/config/default.tomland does not touchlogs,registry, or other Wrangler files.
Requirements
- Node.js 18 or newer
Usage with npx
npx wrangler-auth save personal
npx wrangler-auth use personal
npx wrangler-auth use
npx wrangler-auth list
npx wrangler-auth currentIf the final published package uses a different npm name, replace wrangler-auth in the npx command with that published package name.
Command Reference
wrangler-auth save <name>saves the current~/.wrangler/config/default.tomlas~/.wrangler/accounts/<name>.toml.wrangler-auth use [name]activates a saved snapshot. On macOS/Linux it uses a symlink; on Windows it copies the file.wrangler-auth listshows saved accounts alphabetically and marks the active one with*.wrangler-auth currentprints the active account name, or a friendly empty state if none is active yet.
Local Development
npm install
npm run build
node dist/bin.js --help
npm testHow It Stores State
- Active Wrangler auth:
~/.wrangler/config/default.toml - Saved accounts:
~/.wrangler/accounts/<name>.toml - Active account marker:
~/.wrangler/accounts/.current
Publish Checklist
npm run build
npm publishBefore publishing, confirm that the target npm package name is available.
