Replaces the fish-only plugin with one portable binary — completions for bash/zsh/fish/PowerShell via `ccswitch completions <shell>`. Same UX (save/add/use/list/current/rm/isolate/seed/search + bare-name switch-and-launch). - Fixes the auth-loss bug: the OAuth token is per-account (org lives only in ~/.claude.json), so switching between same-login/different-org profiles left the sibling holding a rotated, dead refresh token. A switch now propagates the refreshed credential to every profile sharing the account. - Adds `save --force` / `add --force` to overwrite a profile without rm first. - macOS Keychain via `security` (shim); file-based creds on Linux/Windows. - Ports-and-adapters; 100% line / 98.86% region coverage; clippy + fmt clean. - Homebrew formula (auto-installs completions) + cask + release workflow. - Old fish plugin preserved under legacy-fish/ (also at lei-wego/ccswitch-fish). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
45 lines
1.7 KiB
Ruby
45 lines
1.7 KiB
Ruby
# Auto-generated by .github/workflows/release.yml on each tag. Do not edit by hand.
|
|
# This committed copy is a template until the first release fills in real checksums.
|
|
class Ccswitch < Formula
|
|
desc "Cross-shell switcher for multiple Claude Code accounts"
|
|
homepage "https://github.com/mysqto/ccswitch"
|
|
version "0.0.0"
|
|
|
|
on_macos do
|
|
on_arm do
|
|
url "https://github.com/mysqto/ccswitch/releases/download/v#{version}/ccswitch-v#{version}-aarch64-apple-darwin.tar.gz"
|
|
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
|
end
|
|
on_intel do
|
|
url "https://github.com/mysqto/ccswitch/releases/download/v#{version}/ccswitch-v#{version}-x86_64-apple-darwin.tar.gz"
|
|
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
|
end
|
|
end
|
|
on_linux do
|
|
on_arm do
|
|
url "https://github.com/mysqto/ccswitch/releases/download/v#{version}/ccswitch-v#{version}-aarch64-unknown-linux-gnu.tar.gz"
|
|
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
|
end
|
|
on_intel do
|
|
url "https://github.com/mysqto/ccswitch/releases/download/v#{version}/ccswitch-v#{version}-x86_64-unknown-linux-gnu.tar.gz"
|
|
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
|
|
end
|
|
end
|
|
|
|
livecheck do
|
|
url :url
|
|
strategy :github_latest
|
|
end
|
|
|
|
def install
|
|
bin.install "ccswitch"
|
|
# Runs `ccswitch completions {bash,zsh,fish}` and installs each script so
|
|
# tab-completion works immediately — the piece a cask can't do.
|
|
generate_completions_from_executable(bin/"ccswitch", "completions")
|
|
end
|
|
|
|
test do
|
|
assert_match "ccswitch", shell_output("#{bin}/ccswitch --help")
|
|
end
|
|
end
|