Step 1: Organize your directories by environment
Before you configure a shell plugin for context switching between environments, group the directories you want to use with the plugin by environment. For example, if you wanted to use the Terraform shell plugin in both development and production environments, you would organize your directories like this:Step 2: Configure default credentials for each environment
After you organize your directories by environment, you can set default credentials for your shell plugin to use in each directory and all its subfolders.-
Change directories to one of the environment-level folders you created. For example:
-
Sign in to the 1Password account where the credentials you want to use are stored:
-
Choose a plugin to initialize, or run
op plugin initto choose from a list of all available plugins. For example, to initialize the Terraform shell plugin: - Import or select the appropriate credentials for the environment.
- Select Use automatically when in this directory or subdirectories as the default credential scope.
- Repeat the process in other environment-level folders with their respective credentials.
Step 3: Use the plugin in multiple environments
After you set default credentials in all your environment-level folders, you can use the shell plugin in the working directories for each environment without needing to sign in or out.-
Enter the working directory for an environment. For example, to change directories into the development environment from the example above:
-
Run a job in that environment. For example:
-
Switch to a different environment. For example, to change to the production environment:
-
Run a job in that environment:
-
Exit the environment: