Warp documentation
  • Getting Started
    • Quickstart Guide
    • What is Warp?
    • Supported shells
    • Migrate to Warp
    • Keyboard Shortcuts
    • Changelog
  • Agents
    • Warp AI
      • Agent Mode
  • Active AI
  • Generate
  • Voice
  • Terminal
    • Appearance
      • Themes
      • Custom Themes
      • Prompt
      • Input Position
      • Text, Fonts, & Cursor
      • Size, Opacity, & Blurring
      • Pane Dimming & Focus
      • Blocks Behavior
      • Tabs Behavior
      • App Icons
    • Blocks
      • Block Basics
      • Block Actions
      • Block Sharing
      • Block Find
      • Block Filtering
      • Background Blocks
      • Sticky Command Header
    • Modern Text Editing
      • Alias Expansion
      • Command Inspector
      • Syntax & Error Highlighting
      • Vim Keybindings
    • Command Entry
      • Command Corrections
      • Command Search
      • Command History
      • Synchronized Inputs
      • YAML Workflows
    • Command Completions
      • Completions
      • Autosuggestions
    • Command Palette
    • Session Management
      • Launch Configurations
      • Session Navigation
      • Session Restoration
    • Window Management
      • Global Hotkey
      • Tabs
      • Split Panes
    • Warpify
      • Subshells
      • SSH
    • More Features
      • Accessibility
      • Files, Links, & Scripts
      • Markdown Viewer
      • Working Directory
      • Smart-Select
      • Full-screen Apps
      • Notifications & Audible Bell
      • Settings Sync (Beta)
      • Quit Warning
      • URI Scheme
      • Linux
    • Comparisons
      • Performance
      • Terminal features
  • Integrations
  • Knowledge & Collaboration
    • Warp Drive
      • Notebooks
      • Workflows
      • Prompts
      • Environment Variables
      • Warp Drive on the Web
    • Model Context Protocol
    • Rules
    • Teams
    • Session Sharing
  • Privacy
    • Privacy
    • Secret Redaction
    • Network Log
  • Community
    • Refer a Friend & Earn Rewards
    • Warp Preview & Alpha Program
  • Support & Billing
    • Sending Feedback & Logs
    • Plans & Pricing
    • Updating Warp
    • Using Warp Offline
    • Logging out & Uninstalling
    • Known Issues
    • Troubleshooting Login Issues
    • Open Source Licenses
Powered by GitBook
On this page
  • What are Environment Variables in Warp?
  • How to create and edit environment variables
  • Managing individual environment variables
  • Static variables
  • Dynamic variables
  • How to create and edit dynamic environment variables
  • How to write a custom secret command
  • Using environment variables
  • Import and Export Environment Variables in Warp Drive

Was this helpful?

  1. Knowledge & Collaboration
  2. Warp Drive

Environment Variables

Save or sync environment variables to load into your terminal sessions.

PreviousPromptsNextWarp Drive on the Web

Last updated 2 months ago

Was this helpful?

Environment Variables are currently available in Free Preview.

What are Environment Variables in Warp?

Environment Variables in Warp are similar to .env files, except you can:

  • Load them into your terminal session with a click.

  • Use them in parameterized workflows.

  • Dynamically reference secrets from external managers.

How to create and edit environment variables

You can create new environment variables through:

  • , + → Environment variable

  • , create new team or personal environment variables

Any of these entry points will open the environment variables editor where you can name and describe your environment variables.

Managing individual environment variables

Warp supports two types of environment variables: static variables and dynamic variables.

Static variables

Static variables are similar to .env files. You create the variables by entering raw strings of text. Each variable has a variable name and a corresponding value.

After you save the environment variable, you can click it to load it into your terminal session.

When you use static variables, Warp stores them securely in Warp Drive. Note: Static variables should not be used to replace a secret manager. Please use dynamic variables for any sensitive information.

Dynamic variables

Warp never stores secrets used in dynamic variables. Warp only stores the command used to dynamically retrieve the secrets at runtime.

Dynamic variables let you reference secrets that are stored securely outside of Warp in external secret managers, such as 1Password or LastPass.

You can use custom commands to create dynamic variables for any system with a public API or CLI, such as AWS or Hashicorp Vault.

How to create and edit dynamic environment variables

To create a new dynamic variable:

  1. Open the environment variable editor.

  2. Use the key icon to reveal the dynamic variable menu.

  3. Select an integrated password manager or "Command" to write your own custom integration.

Integrated password managers

Before you get started, please ensure you have the CLI installed for your tool of choice and follow the instructions to enable the CLI:

Then, you can click the key icon and select your manager from the dropdown menu.

The CLI will require you to authenticate and then provide you with a list of available secrets.

Selecting a secret name never stores the actual secret. Warp uses your selection to generate a command that dynamically pulls in your selected secret at runtime.

How to write a custom secret command

Reference the documentation for your external secret manager. Then, write a custom command to retrieve secrets.

Your custom command should return the exact string you want loaded into your environment. Please make sure that you are selecting the exact field you want loaded as many secret manager CLIs provide additional formatting by default.

// vault kv get -field=password secret/staging/app/server/creds

Using environment variables

There are three ways to invoke your environment variables and load them into a terminal session:

Click to load into a current session

First, click your environment variable from Warp Drive or the Command Palette.

Then, review the confirmation block. If your environment variables are correct, hit enter to load them into your session.

These environment variables will now be present for the remainder of your session.

Click to load into a subshell

Loading an environment into a subshell reduces the risk of your environment variables accidentally contaminating your workspace. The subshell is clearly defined and once you exit it, any environment variables set by Warp Environment Variables will be cleared, unless they are already present in the parent session.

Select to load with a workflow

Any time you run a workflow, you can select from existing environment variables. This allows you to dynamically inject environment variables into a parameterized workflow so you can use a single workflow command in multiple environments, such as production and staging.

For example, you might have a workflow to create a new team that uses the environment variable $SERVER_URL. By using the environment variables dropdown in the workflow card, you can dynamically inject the necessary variables. This ensures the workflow references the appropriate values so the command runs with the relevant environment-specific information.

These environment variables will now be present for the remainder of your session until you clear them or overwrite them with a different environment.

Import and Export Environment Variables in Warp Drive

For example, you could write a command using the to retrieve and load the password field for the staging server. When using secret commands, Warp stores the command but never the actual secrets. The secrets will be referenced and loaded into a terminal session at runtime.

To load environment variables into a subshell, you will need to open and locate your environment variable in the Warp Drive index. You can then use the overflow menu to select "Load in subshell."

Please see our instructions.

1Password CLI
LastPass CLI
Hashicorp Vault CLI
Warp Drive
Click to load into a current section
Click to load into a subshell
Select to load in with a workflow
Warp Drive
Command Palette
Warp Drive Import and Export