Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svengau/gogo
A tool to run a command in a given environment๐บ๐ฟ๐๐บ๐๐ฟ
https://github.com/svengau/gogo
cli golang
Last synced: 3 days ago
JSON representation
A tool to run a command in a given environment๐บ๐ฟ๐๐บ๐๐ฟ
- Host: GitHub
- URL: https://github.com/svengau/gogo
- Owner: svengau
- License: mit
- Created: 2021-03-30T00:18:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-04T23:48:29.000Z (over 3 years ago)
- Last Synced: 2024-06-20T03:46:09.254Z (5 months ago)
- Topics: cli, golang
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐บ๐ฟ๐ Gogo ๐บ๐๐ฟ
> a simple tool to run a command in a given environment.
you don't like seeing environment variables in your history or in ~/.shrc ? ๐ญ
with production passwords and database urls in plain text ? ๐ ๐ฑ ๐ฅ
So here is gogo a simple tool to load vars from a `.gogo.yaml` file! ๐๐ฅณ
gogo will first read in the `./.gogo.yaml` file (for project specific config), and if no file, it will try to read `~/.gogo.yaml` (for more global config).
And last but not least, gogo can encrypt your file using AES.
## Installation
### Using brew```
brew install svengau/tap/gogo
```### From the source code
```
git clone [email protected]:svengau/gogo.git
make install
make build
./gogo --version
```### Manually
```
curl -Lo /usr/local/bin/gogo https://github.com/svengau/gogo/releases/download/v0.1.0/gogo
chmod +x /usr/local/bin/gogo
```## Usage
### Command line
```
NAME:
gogo - a tool to run a command in a given environmentUSAGE:
gogo command [command arguments...]
gogo [options]OPTIONS:
--list list variables
--encrypt encrypt .gogo.yaml
--decrypt decrypt .gogo.yaml
--version display version
--dry dry mode (default: false)
--verbose verbose mode (default: false)
--help show help (default: false)
```### Sample
With this sample config:
```
encrypted: false
envs:
demo:
MY_VAR: demo
MY_VAR2: demo2
TEST: sample
production:
MY_VAR: production
MY_VAR2: production2
```Some sample commands:
```
gogo --verbose demo node -e "console.log('MY_VAR=' + process.env.MY_VAR)"
# OUTPUT:
# MY_VAR=demogogo demo 'echo MY_VAR=$MY_VAR'
# OUTPUT:
# MY_VAR=demogogo demo node -e "let i = 0; const inter = setInterval(()=>{console.log('MY_VAR=' + process.env.MY_VAR); i++; if (i > 3) clearInterval(inter)}, 500)"
# STREAMLY OUTPUT:
# MY_VAR=demo```
## Alternative solutions
A couple of great solutions already exist, and may better fit your needs.
- [env-cmd](https://www.npmjs.com/package/env-cmd)
- [dotenv](https://www.npmjs.com/package/dotenv)
- [cross-env](https://www.npmjs.com/package/cross-env)