Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>State SwitcherNew to Visual Studio Code? Get it now.
State Switcher

State Switcher

Berhiber Studio

|
1 install
| (0) | Free
Status bar button that cycles through configurable states and executes actions
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

State Switcher

A VS Code extension that adds a status bar button to cycle through configurable states and execute associated actions.

Features

  • Status bar button with a colored dot (no text)
  • Configurable states via VS Code settings
  • Click to cycle through states in order
  • Executes a bash command/script for each state transition
  • Color changes based on current state (reverts on failure)
  • Hover tooltip shows current active state name
  • Defaults to grey when no states are defined

Configuration

Add states in your VS Code settings (settings.json):

{
  "stateSwitcher.states": [
    {
      "name": "Local",
      "color": "#008000",
      "action": "./scripts/local.sh"
    },
    {
      "name": "Staging",
      "color": "#FFA500",
      "action": "./scripts/staging.sh"
    },
    {
      "name": "Production",
      "color": "#FF0000",
      "action": "./scripts/prod.sh"
    }
  ]
}

Development

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch mode
npm run watch

# Run tests
npm test

Extension Settings

Setting Type Description
stateSwitcher.states array Array of state objects with name, color, and action properties

Requirements

  • VS Code ^1.85.0
  • Node.js >= 18

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft