Skip to content

Instantly share code, notes, and snippets.

@nyobe
nyobe / README.md
Created March 3, 2026 20:12
pws — Pulumi Workspace Selector: pin backend + stack selection per directory using direnv

pws — Pulumi Workspace Selector

A tiny shell script that uses direnv to pin Pulumi backend + stack selection per directory, eliminating surprises from global state.

The problem

Pulumi's pulumi stack select is global — it changes which stack every terminal window targets. If you have multiple terminals open, or switch between projects, it's easy to accidentally deploy to the wrong stack. Similarly, pulumi login switches your backend globally, which is problematic when you work with multiple Pulumi service instances or need different credentials for different orgs.

Using direnv to isolate stacks