GH-SECRET-SET(1) GitHub CLI manual GH-SECRET-SET(1) (NAME) gh-secret-set - (SYNOPSIS) gh secret set [flags] (DESCRIPTION) : - repository (): GitHub Actions Agents Dependabot - environment: GitHub Actions - organization: GitHub Actions Agents Dependabot Codespaces - user: Codespaces . . (OPTIONS) -a, --app : {actions|agents|codespaces|dependabot} -b, --body ( ) -e, --env -f, --env-file dotenv --no-repos-selected --no-store base64 -o, --org -r, --repos -u, --user -v, --visibility (default "private") : {all|private|selected} (OPTIONS INHERITED FROM PARENT COMMANDS) -R, --repo <[HOST/]OWNER/REPO> [HOST/]OWNER/REPO (EXIT CODES) 0: 1: 2: 4: : . . (EXAMPLES) # $ gh secret set MYSECRET # $ gh secret set MYSECRET --body "$ENV_VALUE" # $ gh secret set MYSECRET --repo origin/repo --body "$ENV_VALUE" # $ gh secret set MYSECRET < myfile.txt # $ gh secret set MYSECRET --env myenvironment # $ gh secret set MYSECRET --org myOrg --visibility all # $ gh secret set MYSECRET --org myOrg --repos repo1,repo2,repo3 # $ gh secret set MYSECRET --org myOrg --no-repos-selected # Codespaces $ gh secret set MYSECRET --user # Dependabot $ gh secret set MYSECRET --app dependabot # ".env" $ gh secret set -f .env # (stdin) $ gh secret set -f - < myfile.txt (SEE ALSO) gh-secret(1) Sep 2026 GH-SECRET-SET(1)