cli

command module
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 1 Imported by: 0

README

yolo

Yolo

Live environments for any repository. Running in your cloud provider account.
Currently available on Amazon Web Services and Hetzner.

... use it to deploy your app, as a remote development environment or even as a code sandbox. Honestly, it's up to you!
yolo aws init yolo-sh/api --instance-type t2.medium

Example of use of the Yolo CLI

... now that this environment is created, you can connect to it with your preferred editor using the edit command:
yolo aws edit yolo-sh/api
VSCode opened in a go repository

Table of contents

Requirements

The Yolo binary has been tested on Linux and MacOS. Support for Windows is theoretical (testers needed 💙).

Before using Yolo, the following dependencies need to be installed:

Before running the edit command, one of the following editors need to be installed:

Installation

The easiest way to install Yolo is by running the following command in your terminal:

curl -sf https://raw.githubusercontent.com/yolo-sh/cli/main/install.sh | sh -s -- -b /usr/local/bin latest

This command could be run as-is or by changing:

  • The installation directory by replacing /usr/local/bin with your preferred path.

  • The version installed by replacing latest with a specific version.

Once done, you could confirm that Yolo is installed by running the yolo command:

yolo --help

Usage

Yolo - Live environments for any repository in any cloud provider

To begin, run the command "yolo login" to connect your GitHub account.	

From there, the most common workflow is:

  - yolo <cloud_provider> init <repository>   : to initialize an environment for a specific GitHub repository

  - yolo <cloud_provider> edit <repository>   : to connect your preferred editor to an environment

  - yolo <cloud_provider> remove <repository> : to remove an unused environment
	
<repository> may be relative to your personal GitHub account (eg: cli) or fully qualified (eg: my-organization/api).

Usage:
  yolo [command]

Available Commands:
  aws         Use Yolo on Amazon Web Services
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  hetzner     Use Yolo on Hetzner
  login       Connect a GitHub account to use with Yolo

Flags:
  -h, --help      help for yolo
  -v, --version   version for yolo

Use "yolo [command] --help" for more information about a command.

Login

yolo login

To begin, you need to run the login command to connect your GitHub account.

Yolo requires the following permissions:

  • "Public SSH keys" and "Repositories" to let you access your repositories from your environments.

  • "GPG Keys" and "Personal user data" to configure Git and sign your commits (verified badge).

All your data (including the OAuth access token) are only stored locally in ~/.config/yolo/yolo.yml (or in XDG_CONFIG_HOME if set).

The source code that implements the GitHub OAuth flow is located in the yolo-sh/api repository.

Init

yolo <cloud_provider> init <repository> [--instance-type=<instance_type>]

The init command initializes an environment for a specific GitHub repository.

An --instance-type flag can be passed to specify the instance type that will power your environment. (See the corresponding cloud provider repository for default / valid values).

Examples
yolo aws init yolo-sh/api
yolo hetzner init yolo-sh/api --instance-type cx11

Edit

yolo <cloud_provider> edit <repository>

The edit command connects your preferred editor to an environment.

Example
yolo aws edit yolo-sh/api

Open port

yolo <cloud_provider> open-port <repository> <port>

The open-port command makes the specified port reachable from any IP address using the TCP protocol.

Example
yolo aws open-port yolo-sh/api 8000

Close port

yolo <cloud_provider> close-port <repository> <port>

The close-port command makes the specified port unreachable from all IP addresses.

Example
yolo aws close-port yolo-sh/api 8000

Remove

yolo <cloud_provider> remove <repository>

The remove command removes an existing environment.

Removing means that the underlying instance and all your data will be permanently removed.

Example
yolo aws remove yolo-sh/api

Uninstall

yolo <cloud_provider> uninstall

The uninstall command removes all the infrastructure components used by Yolo from your cloud provider account. (See the corresponding cloud provider repository for details).

Before running this command, all environments need to be removed.

Example
yolo aws uninstall

Environments configuration

All environments run in Docker containers built from the ghcr.io/yolo-sh/workspace-full image. You could see the source of this image in the yolo-sh/workspace-full repository.

In summary, Yolo is built on ubuntu 22.04 with systemd and most popular runtimes pre-installed. An user yolo is created and configured to be used as the default user. Root privileges are managed via sudo.

Your repositories will be cloned in /home/yolo/workspace.

Yolo uses the sysbox runtime to improve isolation and to enable containers to run the same workloads than VMs.

Runtimes

The following runtimes are pre-installed in all environments:

  • docker (latest)

  • docker compose (latest)

  • php (latest)

  • java 17.0 / maven 3.8

  • node 18.7 (via nvm)

  • python 3.10 (via pyenv)

  • ruby 3.1 (via rvm)

  • rust (latest)

  • go (latest)

License

Yolo is available as open source under the terms of the MIT License.

Documentation

Overview

Copyright © 2022 Jeremy Levy jje.levy@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
internal
aws
cmd
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
ssh

Jump to

Keyboard shortcuts

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