brev-cli

command module
v0.6.58 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 2 Imported by: 0

README

Brev.dev

Brev.dev makes it easy to code on remote machines. Connects your local computer to a mesh network of remote machines. Use Brev.dev to start a project and share your development environment in under 15s, with zero setup.

Install

MacOS
brew install brevdev/homebrew-brev/brev
Linux
sudo sh -c "`curl -sf -L https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh`" && export PATH=/opt/brev/bin:$PATH && brev run-tasks -d

That's it 🎉 Run brev login to get started!

Usage

Create a workspace in your current organization

brev start https://github.com/brevdev/brev-cli

list all workspaces in an org

brev ls

stop a workspace

brev stop brevdev/brev-cli

delete a workspace from an org

brev delete brevdev/brev-cli

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
sudo mkdir -p /usr/local/share/bash-completion/completions
brev completion bash | sudo tee /usr/local/share/bash-completion/completions/brev
source /usr/local/share/bash-completion/completions/brev
fish
mkdir -p ~/.config/fish/completions && brev completion fish > ~/.config/fish/completions/brev.fish && autoload -U compinit && compinit

Development

Build

make fast-build builds a binary for your current machine used for testing/experimentation make ci runs all linters and tests make build runs a full release build (does not release)

example .env file

VERSION=unknown
BREV_API_URL=http://localhost:8080
# BREV_API_URL=<your backend>

adding new commands

https://github.com/spf13/cobra/blob/master/user_guide.md

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

make a patch release

make version-bump-patch

make a minor release

make version-bump-minor

make a major release

make version-bump-major

when releasing make sure to

  1. run full-smoke-test before cutting release to run through some common commands and make sure that they work

  2. release new version of workspace-images

  3. update brev's homebrew tap

Maintainance

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

Notable files:

Contributing

Simply create an issue or a pull request.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
cmd
Package cmd is the entrypoint to cli
Package cmd is the entrypoint to cli
cmd/healthcheck
Package healthcheck checks the health of the backend
Package healthcheck checks the health of the backend
cmd/invite
Package invite is for inviting
Package invite is for inviting
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/secret
Package secret lets you add secrests.
Package secret lets you add secrests.
cmd/set
Package set is for the set command
Package set is for the set command
cmd/setup
Package setup WE SHOULD SETUP THE USER HERE
Package setup WE SHOULD SETUP THE USER HERE
cmd/sshkeys
Package sshkeys gets your public ssh key to add to github/gitlab
Package sshkeys gets your public ssh key to add to github/gitlab
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
k8s
ssh
Package 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 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
terminal
Package terminal is for terminal outputting
Package terminal is for terminal outputting
uri
Package uri defines a simple uri type
Package uri defines a simple uri type
vpn

Jump to

Keyboard shortcuts

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