brev-cli

command module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 2 Imported by: 0

README

brev CLI

Keep a Changelog GitHub Release Go Reference go.mod LICENSE Build Status Go Report Card Codecov

Star this repository if you find it valuable and worth maintaining.

Watch this repository to get notified about new releases, issues, etc.

Install

Linux & Mac

curl -sf -L https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh  -o install-brev.sh
chmod +x install-brev.sh
sudo ./install-brev.sh

or

sudo sh -c "`curl -sf -L https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh`"

check that you have installed brev successfully by running

$ brev --version

Current version: v0.1.5

You're up to date!

Uninstall

sudo rm -rf /usr/local/bin/brev /tmp/brev ~/.brev

Usage

Completion

zsh
mkdir -p ~/.zsh/completions && brev completion zsh > ~/.zsh/completions/_brev && echo fpath=~/.zsh/completions $fpath >> ~/.zshrc && fpath=(~/.zsh/completions $fpath) && autoload -U compinit && compinit
bash
brev completion bash | sudo tee /usr/local/share/bash-completion/completions/brev
source /usr/local/share/bash-completion/completions/brev

Development

Build

make build runs a full release build make fast-build builds a binary for your current machine only

example .env file

VERSION=unknown
BREV_API_URL=http://localhost:8080
# BREV_API_URL=https://ade5dtvtaa.execute-api.us-east-1.amazonaws.com

adding new commands

pkg/cmd/logout/logout.go is a minimal command to go off of for adding new commands.

commands for the cli should follow <VERB> <NOUN> pattern.

Don't forget to add a debug command to .vscode/launch.json

Terminal
  • make - execute the build pipeline.
  • make help - print help for the Make targets.
Visual Studio Code

F1Tasks: Run Build Task (Ctrl+Shift+B or ⇧⌘B) to execute the build pipeline.

Release

The release workflow is triggered each time a tag with v prefix is pushed.

when releasing make sure to

  1. update bin/install-latest.sh
  2. release new version of workspace-images

CAUTION: Make sure to understand the consequences before you bump the major version. More info: Go Wiki, Go Blog.

Maintainance

Remember to update Go version in .github/workflows, Makefile and devcontainer.json.

Notable files:

Contributing

Simply create an issue or a pull request.

Distribute to Homebrew

Step 1: bump version (see top of Makefile)

Step 2: create homebrew distribution

> make dist-homebrew

Step 3: create GitHub release

Step 4: upload resultant tar.gz to GitHub release

Step 5: copy sha256 (output from step 2) and use it in a new update to https://github.com/brevdev/homebrew-tap

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
brev_ssh
Package brev_ssh exists to provide an api to configure and read from an ssh file brev ssh host file entry format: Host <workspace-dns-name Hostname 0.0.0.0 IdentityFile /home//.brev/brev.pem User brev Port <some-available-port> also think that file stuff should probably live in files package TODO migrate to using dns name for hostname
Package brev_ssh exists to provide an api to configure and read from an ssh file brev ssh host file entry format: Host <workspace-dns-name Hostname 0.0.0.0 IdentityFile /home//.brev/brev.pem User brev Port <some-available-port> also think that file stuff should probably live in files package TODO migrate to using dns name for hostname
cmd
Package cmd is the entrypoint to cli
Package cmd is the entrypoint to cli
cmd/completions
completions provides completions
completions provides completions
cmd/delete
Package link is for the ssh command
Package link is for the ssh command
cmd/get
Package get is for the get command TODO: delete this file if getmeprivatekeys isn't needed
Package get is for the get command TODO: delete this file if getmeprivatekeys isn't needed
cmd/link
Package link is for the ssh command
Package link is for the ssh command
cmd/login
Package login is for the get command
Package login is for the get command
cmd/logout
Package logout is for the logout command
Package logout is for the logout command
cmd/ls
Package ls lists workspaces in the current org
Package ls lists workspaces in the current org
cmd/refresh
Package refresh lists workspaces in the current org
Package refresh lists workspaces in the current org
cmd/reset
Package start is for starting Brev workspaces
Package start is for starting Brev workspaces
cmd/set
Package set is for the set command
Package set is for the set command
cmd/start
Package start is for starting Brev workspaces
Package start is for starting Brev workspaces
cmd/stop
Package stop is for stopping Brev workspaces
Package stop is for stopping Brev workspaces
config
config
config
k8s
k8s.
k8s.
terminal
Package terminal is for terminal outputting
Package terminal is for terminal outputting

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL