Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chelnak/gh-environments
A gh-cli extension for managing environments.
https://github.com/chelnak/gh-environments
gh-extension
Last synced: 17 days ago
JSON representation
A gh-cli extension for managing environments.
- Host: GitHub
- URL: https://github.com/chelnak/gh-environments
- Owner: chelnak
- License: mit
- Created: 2022-01-14T16:05:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-28T15:41:45.000Z (almost 3 years ago)
- Last Synced: 2024-10-03T09:47:14.780Z (about 1 month ago)
- Topics: gh-extension
- Language: Go
- Homepage:
- Size: 279 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-environments
[![ci](https://github.com/chelnak/gh-environments/actions/workflows/ci.yml/badge.svg)](https://github.com/chelnak/gh-environments/actions/workflows/ci.yml) [![Release](https://img.shields.io/github/release/chelnak/gh-environments.svg)](https://github.com/chelnak/gh-environments/releases/latest)
A gh-cli extension for managing environments.
## Installation and Upgrades
```bash
gh extension install chelnak/gh-environments
``````bash
gh extension upgrade chelnak/gh-environments
```## Usage
``` bash
gh environments --help
```## Setting aliases
It's possible to set command aliases with `gh alias set`. Here are some examples for the `gh environments` extension:
```bash
# Set a short name for the command
gh alias set env environments# Or save a complex jq query
gh alias set myalias "environments list --json -q '.[] | select(.name | contains(""\"te""\"))'"
```## Advanced usage
Remove multiple environments at once
```bash
#! /bin/bashset -e
envs=$(gh environments list --json -q '.[] | select(.name | contains("temp-")) | .name')
for row in $(echo "${envs}" | jq -r '.[]'); do
echo "Removing environment $row"
gh environments delete $row --force
done
```