← 返回命令列表

Linux command

gh-environment 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Install the gh-environments extension

gh extension install katiem0/gh-environments

List environments for a repository

gh environments list [owner] --repo [repo]

List environments across all repos for an owner

gh environments list [owner]

Create environments from a CSV file

gh environments create [owner] --from-file [envs.csv]

List environment secrets to CSV

gh environments secrets list [owner] --repo [repo] -o [secrets.csv]

List environment variables to CSV

gh environments variables list [owner] --repo [repo] -o [vars.csv]

Create environment secrets from a CSV file

gh environments secrets create --from-file [secrets.csv]

说明

gh-environments is a GitHub CLI extension for managing repository deployment environments in bulk. It is not a built-in `gh` command; install it with `gh extension install katiem0/gh-environments`. Environments represent deployment targets (production, staging, etc.) with optional protection rules and environment-specific secrets and variables. The extension reads and writes CSV files, making it suitable for auditing or replicating environment configuration across many repositories. For inspecting the environment variables that control the `gh` CLI itself, run `gh help environment`.

参数

-t, --token _token_
GitHub Personal Access Token (overrides `gh auth`).
--hostname _host_
GitHub Enterprise Server hostname.
-o, --output-file _file_
Output CSV filename for list commands.
-f, --from-file _file_
Path to CSV file used by create commands.
-d, --debug
Enable debug logging.
--help
Show help information.

FAQ

What is the gh-environment command used for?

gh-environments is a GitHub CLI extension for managing repository deployment environments in bulk. It is not a built-in `gh` command; install it with `gh extension install katiem0/gh-environments`. Environments represent deployment targets (production, staging, etc.) with optional protection rules and environment-specific secrets and variables. The extension reads and writes CSV files, making it suitable for auditing or replicating environment configuration across many repositories. For inspecting the environment variables that control the `gh` CLI itself, run `gh help environment`.

How do I run a basic gh-environment example?

Run `gh extension install katiem0/gh-environments` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --token _token_ do in gh-environment?

GitHub Personal Access Token (overrides `gh auth`).