gh-variable - Man Page
Manage GitHub Actions variables
Examples (TL;DR)
- List variables for the current repository:
gh variable [ls|list] - List variables for a specific organization:
gh variable [ls|list] [-o|--org] organization - Get a variable for the current repository:
gh variable get name - Set a variable for the current repository (user will be prompted for the value):
gh variable set name - Set a variable for a deployment environment in the current repository:
gh variable set name [-e|--env] environment_name - Set an organization variable visible to all repositories:
gh variable set name [-o|--org] organization [-v|--visibility] all - Set multiple variables from a dotenv file:
gh variable set [-f|--env-file] path/to/file.env - Delete a variable for the current repository:
gh variable delete name
Synopsis
gh variable <command> [flags]
Description
Variables can be set at the repository, environment or organization level for use in GitHub Actions or Dependabot. Run gh help variable set to learn how to get started.
Available Commands
- gh-variable-delete(1)
Delete variables
- gh-variable-get(1)
Get variables
- gh-variable-list(1)
List variables
- gh-variable-set(1)
Create or update variables
Options
- -R, --repo <[HOST/]OWNER/REPO>
Select another repository using the [HOST/]OWNER/REPO format
Exit Codes
0: Successful execution
1: Error
2: Command canceled
4: Authentication required
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.
See Also
Referenced By
gh(1), gh-variable-delete(1), gh-variable-get(1), gh-variable-list(1), gh-variable-set(1).
Oct 2025 GitHub CLI manual