Skip to content

Instantly share code, notes, and snippets.

@yeoweizheng
yeoweizheng / oc-profile.sh
Last active March 30, 2026 17:23
OpenCode Profile Switcher
#!/bin/sh
# Switch between different opencode auth profiles under ~/.local/share/opencode/auth.json
# Profiles are saved as auth-<profile_name>.json
# Current profile saved in current_profile.txt
die() {
printf '%s\n' "$1" >&2
exit 1
}