Profile Switcher
Shopify developer tooling for managing and switching CLI development contexts.
Overview
Profile Switcher is a developer tooling extension for managing active Shopify CLI environments directly within VS Code. It allows Shopify developers working across multiple client stores to swap store credentials, target domains, and API environments without re-running OAuth authentication flows.
The problem
Shopify agency developers frequently switch between multiple development stores every day. Constantly logging out, opening browser OAuth popups, and selecting partner stores in the CLI breaks focus and wastes minutes on every context switch.
What I built
A VS Code extension that inspects the local Shopify CLI session cache, indexes active store profiles, and provides a quick Command Palette selector to swap the CLI's active session target pointer (`currentSessionId` / `SHOPIFY_FLAG_STORE`).
How it works
The extension updates active CLI target environments with zero token manipulation:
Key decisions
Swapped pointer metadata directly inside the native Shopify CLI session state file rather than storing raw OAuth tokens in the extension, ensuring security and compatibility with Shopify's native authentication routines.
Implementation
Core environment pointer swap logic:
function switchShopifyProfile(targetProfileKey) {
const profileConfig = loadLocalProfileConfig(targetProfileKey);
if (!profileConfig) throw new Error(`Profile "${targetProfileKey}" not found`);
process.env.SHOPIFY_FLAG_STORE = profileConfig.storeDomain;
console.log(`[Profile Switcher] Switched active environment to: ${profileConfig.storeDomain}`);
}
Result
Eliminated repetitive OAuth re-authentications during multi-store development sessions, reducing environment switching time from ~45 seconds to under 2 seconds.
What I learned
Building developer tooling directly around existing CLI configuration files yields a much cleaner, maintenance-free integration than wrapping CLI binary processes.