GithubHelp home page GithubHelp logo

sts0mrg0 / vultr-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vultr/vultr-cli

0.0 1.0 0.0 6.66 MB

Official command line tool for Vultr services

License: Apache License 2.0

Go 99.41% Makefile 0.38% Dockerfile 0.21%

vultr-cli's Introduction

vultr-cli

The Vultr Command Line Interface

vultr-cli is a command line interface for the Vultr API

Usage:
  vultr-cli [command]

Available Commands:
  account        Retrieve information about your account
  api-key        retrieve information about the current API key
  apps           Display all available applications
  backups        display all available backups
  bare-metal     bare-metal is used to access bare metal server commands
  block-storage  block storage commands
  dns            dns is used to access dns commands
  firewall       firewall is used to access firewall commands
  help           Help about any command
  iso            iso is used to access iso commands
  kubernetes     kubernetes is used to access kubernetes commands
  load-balancer  load balancer commands
  network        network interacts with network actions
  object-storage object storage commands
  os             grab all available operating systems
  plans          get information about Vultr plans
  regions        get regions
  reserved-ip    reserved-ip lets you interact with reserved-ip
  script         startup script commands
  instance       commands to interact with instances on vultr
  snapshot       snapshot commands
  ssh-key        ssh-key commands
  user           user commands
  version        Display current version of Vultr-cli

Flags:
      --config string   config file (default is $HOME/.vultr-cli.yaml)
  -h, --help            help for vultr-cli
  -t, --toggle          Help message for toggle

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

Installation

There are three ways to install vultr-cli:

  1. Download a release from GitHub
  2. From source
  3. Package Manager
  • Arch Linux
  • Brew
  • Snap (Coming soon)
  • Chocolatey (Coming soon)
  1. Docker Hub

GitHub Release

If you are to visit the vultr-cli releases page. You can download a compiled version of vultr-cli for you Linux/MacOS/Windows in 64bit.

Building from source

You will need Go installed on your machine in order to work with the source (and make if you decide to pull the repo down).

go get -u github.com/vultr/vultr-cli

Another way to build from source is to

git clone [email protected]:vultr/vultr-cli.git or git clone https://github.com/vultr/vultr-cli.git
cd vultr-cli
make builds/vultr-cli_(pass name of os + arch, as shown below)

The available make build options are

  • make builds/vultr-cli_darwin_amd64
  • make builds/vultr-cli_darwin_arm64
  • make builds/vultr-cli_linux_386
  • make builds/vultr-cli_linux_amd64
  • make builds/vultr-cli_linux_arm64
  • make builds/vultr-cli_windows_386.exe
  • make builds/vultr-cli_windows_amd64.exe

Note that the latter method will install the vultr-cli executable in builds/vultr-cli_(name of os + arch).

Installing on Arch Linux

pacman -S vultr-cli

Installing via Brew

You will need to tap for formula

brew tap vultr/vultr-cli

Then install the formula

brew install vultr-cli

Using Vultr-cli

Authentication

In order to use vultr-cli you will need to export your Vultr API KEY

export VULTR_API_KEY=your_api_key

Examples

vultr-cli can interact with all of your Vultr resources. Here are some basic examples to get you started:

List all available instances

vultr-cli instance list

Create an instance

vultr-cli instance create --region <region-id> --plan <plan-id> --os <os-id> --hostname <hostname>

Create a DNS Domain

vultr-cli dns domain create --domain <domain-name> --ip <ip-address>

Utilizing a boolean flag

You should use = when using a boolean flag.

vultr-cli instance create --region <region-id> --plan <plan-id> --os <os-id> --hostname <hostname> --notify=true

Utilizing the config flag

The config flag can be used to specify the vultr-cli.yaml file path when it's outside the default location. If the file has the api-key defined, the CLI will use the vultr-cli.yaml config, otherwise it will default to reading the environment variable for the api key.

vultr-cli instance list --config /Users/myuser/vultr-cli.yaml

Example vultr-cli.yaml config file

Currently the only available field that you can use with a config file is api-key. Your yaml file will have a single entry which would be:

api-key: MYKEY

CLI Autocompletion

vultr-cli completion will return autocompletions, but this feature requires setup.

Some guides:

Bash:

$ source <(yourprogram completion bash) To load completions for each session, execute once: Linux: $ yourprogram completion bash > /etc/bash_completion.d/yourprogram macOS: $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram

Zsh:

If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once: $ echo "autoload -U compinit; compinit" >> ~/.zshrc To load completions for each session, execute once: $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" You will need to start a new shell for this setup to take effect.

fish:

$ yourprogram completion fish | source To load completions for each session, execute once: $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish

PowerShell:

PS> yourprogram completion powershell | Out-String | Invoke-Expression To load completions for every new session, run: PS> yourprogram completion powershell > yourprogram.ps1 and source this file from your PowerShell profile.

Contributing

Feel free to send pull requests our way! Please see the contributing guidelines.

vultr-cli's People

Contributors

ddymko avatar mamclaughlin avatar afady avatar dependabot-preview[bot] avatar dependabot[bot] avatar driusan avatar nickcao avatar samwhited avatar kpcyrd avatar shavit avatar lpmi-13 avatar gibeom-gwon avatar rmorey avatar jakimfett avatar nxnjz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.