gh secret delete MY_SECRET --env production

Category: GitHub CLI

gh secret delete MY_SECRET --env production

Delete an environment-scoped secret

Removes MY_SECRET from the production environment, breaking any workflow that references it, so confirm nothing depends on it first. --env scopes the deletion to that environment. Without --env, the repo-level secret is removed.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.