A CLI based GitHub Secrets Manager.
ghs provides a command line interface to manage GitHub Secrets for your projects.
Note: You will need a GitHub Personal Access Token with the repo
scope. Detailed instructions available in their docs
You can Click Here to quickly set up a key with the required permissions.
$ npm install -g @anomalyhq/github-secrets-cli
$ ghs COMMAND
running command...
$ ghs (-v|--version|version)
@anomalyhq/github-secrets-cli/1.2.0 darwin-x64 node-v14.15.4
$ ghs --help [COMMAND]
USAGE
$ ghs COMMAND
...
ghs config:get
ghs config:set
ghs help [COMMAND]
ghs secrets:get
ghs secrets:remove
ghs secrets:set
ghs secrets:sync FILE
Outputs your configuration.
USAGE
$ ghs config:get
See code: src/commands/config/get.ts
Update your configuration
USAGE
$ ghs config:set
OPTIONS
-o, --org=org Organisation the repo belongs to.
-r, --repo=repo Name of the repo.
-t, --personalAccessToken=personalAccessToken Your GitHub Personal Access Token.
See code: src/commands/config/set.ts
display help for ghs
USAGE
$ ghs help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Fetch a list of set secrets (cannot read secret values)
USAGE
$ ghs secrets:get
OPTIONS
-h, --help show CLI help
-o, --org=org Organisation the repo belongs to.
-r, --repo=repo Name of the repo.
-t, --personalAccessToken=personalAccessToken Your GitHub Personal Access Token.
See code: src/commands/secrets/get.ts
Remove a secret
USAGE
$ ghs secrets:remove
OPTIONS
-h, --help show CLI help
-o, --org=org Organisation the repo belongs to.
-r, --repo=repo Name of the repo.
-s, --secret=secret (required) GitHub Secret to remove.
-t, --personalAccessToken=personalAccessToken Your GitHub Personal Access Token.
-y, --autoYes Skips user confirmation.
See code: src/commands/secrets/remove.ts
Update/Create a secret
USAGE
$ ghs secrets:set
OPTIONS
-b, --base64 base64 the string before encoding.
-f, --file=file Location of a file to create a secret from.
-h, --help show CLI help
-i, --input=input String to create a secret from.
-o, --org=org Organisation the repo belongs to.
-r, --repo=repo Name of the repo.
-s, --secret=secret (required) GitHub Secret to update/create.
-t, --personalAccessToken=personalAccessToken Your GitHub Personal Access Token.
See code: src/commands/secrets/set.ts
Add/Update multiple secrets from one file.
USAGE
$ ghs secrets:sync FILE
ARGUMENTS
FILE Path to the file to read from.
OPTIONS
-b, --base64 base64 the values before encoding.
-f, --format=env|json|yaml (required) File format to parse secrets from.
-h, --help show CLI help
-o, --org=org Organisation the repo belongs to.
-r, --repo=repo Name of the repo.
-t, --personalAccessToken=personalAccessToken Your GitHub Personal Access Token.
See code: src/commands/secrets/sync.ts
Distributed under the Apache 2.0 License. See LICENSE
for further information.