gh variable set MY_VAR --org myorg --body 'value' --visibility selected --repos myapp

Category: GitHub CLI

gh variable set MY_VAR --org myorg --body 'value' --visibility selected --repos myapp

Set an org variable for selected repos

Creates an organization-level variable shared across repositories, with --visibility selected restricting it to the repos listed in --repos. Org variables centralize config like shared registry URLs. Values are stored as plaintext.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.