Git Product home page Git Product logo

scaleway-cli's Introduction

CircleCI GoReportCard

Scaleway CLI (v2)

Scaleway CLI is a tool to help you pilot your Scaleway infrastructure directly from your terminal.

Installation

With a Package Manager (Recommended)

A package manager installs and upgrades the Scaleway CLI with a single command. We recommend this installation mode for more simplicity and reliability:

Homebrew

Install the latest stable release on macOS/Linux using Homebrew:

brew install scw

Arch Linux

Install the latest stable release on Arch Linux from official repositories. For instance with pacman:

pacman -S scaleway-cli

Chocolatey

Install the latest stable release on Windows using Chocolatey (Package):

choco install scaleway-cli

Manually

Released Binaries

We provide static-compiled binaries for darwin (macOS), GNU/Linux, and Windows platforms. You just have to download the binary compatible with your platform to a directory available in your PATH:

Linux

curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sh

Windows

You can download the last release here: https://github.com/scaleway/scaleway-cli/releases
This official guide explains how to add tools to your PATH.

Docker Image

You can use the CLI as you would run any Docker image:

docker run -i --rm scaleway/cli:latest

See more in-depth information about running the CLI in Docker here

Getting Started

Setup your configuration

After you installed the latest release just run the initialization command and let yourself be guided! ๐Ÿ’ƒ

scw init

It will set up your profile, the authentication, and the auto-completion.

Basic commands

# Create an instance server
scw instance server create type=DEV1-S image=ubuntu_focal zone=fr-par-1 tags.0="scw-cli"

# List your servers
scw instance server list

# Create a Kubernetes cluster named foo with cilium as CNI, in version 1.17.4 and with a pool named default composed of 3 DEV1-M and with 2 tags
scw k8s cluster create name=foo version=1.17.4 pools.0.size=3 pools.0.node-type=DEV1-M pools.0.name=default tags.0=tag1 tags.1=tag2

Environment

You can configure your config or enable functionalities with environment variables.

Variables to override config are describe in config documentation. To enable beta features, you can set SCW_ENABLE_BETA=1 in your environment.

Reference documentation

Namespace Description Documentation
account User related data CLI / API
applesilicon Apple silicon API CLI / API
autocomplete Autocomplete related commands CLI
baremetal Baremetal API CLI / API
billing Billing API CLI / API
cockpit Cockpit API CLI / API
config Config file management CLI
container Serverless Container API CLI / API
documentdb DocumentDB API CLI
dns DNS API CLI / API
feedback Send feedback to the Scaleway CLI Team! CLI
flexibleip Flexible IP API CLI / API
function Serverless Function API CLI / API
iam IAM API CLI / API
info Get info about current settings CLI
init Initialize the config CLI
instance Instance API CLI / API
iot IoT API CLI / API
ipam IPAM API CLI / API
k8s Kapsule API CLI / API
lb Load Balancer API CLI / API
marketplace Marketplace API CLI
mnq Messaging and Queueing API CLI / API
object Object-storage utils CLI / API
rdb Database RDB API CLI / API
redis Redis API CLI / API
registry Container registry API CLI / API
secret Secret manager API CLI / API
shell Start Shell mode CLI
tem Transactional Email API CLI / API
vpc-gw VPC Gateway API CLI / API
vpc VPC API CLI / API

Build it yourself

Build Locally

If you have a >= Go 1.13 environment, you can install the HEAD version to test the latest features or to contribute. Note that this development version could include bugs, use tagged releases if you need stability.

go install github.com/scaleway/scaleway-cli/v2/cmd/scw@latest

Dependencies: We only use go Modules with vendoring.

Build with Docker

You can build the scw CLI with Docker. If you have Docker installed, you can run:

docker build -t scaleway/cli .

Once built, you can then use the CLI as you would run any image:

docker run -i --rm scaleway/cli

See more in-depth information about running the CLI in Docker here

Development

This repository is at its early stage and is still in active development. If you are looking for a way to contribute please read CONTRIBUTING.md.

Reach Us

We love feedback. Don't hesitate to open a Github issue or feel free to reach us on Scaleway Slack community, we are waiting for you on #opensource.

scaleway-cli's People

Contributors

aerialls avatar angristan avatar clement-gilbert avatar codelax avatar dependabot[bot] avatar dri42 avatar jawher avatar jeansebastienh avatar jerjako avatar jerome-quere avatar jremy42 avatar jtherin avatar kindermoumoute avatar laure-di avatar loicbourgois avatar lpmi-13 avatar mia-cross avatar monitob avatar ojroques avatar onsagerhe avatar oursin avatar quantumsheep avatar quentinbrosse avatar remyleone avatar scaleway-bot avatar seblu avatar sh4d1 avatar shillaker avatar thorerik avatar yfodil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scaleway-cli's Issues

golang: flush cache

  • on scw rm, remove server entry
  • on scw rmi, remove image||bootscript||volume||snapshot entry
  • on GET /resource without filter, replace resource-type cache
  • on scw rename, update entry

Basic skeleton of a go CLI

This is the first step of the Go implementation of scaleway-cli, it consists of creating a skeleton on top of which we can add commands. Since scaleway-cli is highly inspired from the docker-cli which is written in go, we can probably get some inspiration from Docker's repository.

  • add facilities to setup the CLI scw login --token=XXXXX --organization=YYYYY
  • add a usage message similar to the current CLI
  • add basic interaction with the API
  • add basic actions (ps)
  • add a shared cache for uuids (should handle concurrency)

No error when scw exec fails

To reproduce: Try to exec something when the server is starting

โžœ  ~  scw create Ubuntu_Utopic_14_10
29ba8d8f-5b6c-49a8-8100-cef936aa336b
โžœ  ~  scw start 29ba8d8f-5b6c-49a8-8100-cef936aa336b
29ba8d8f-5b6c-49a8-8100-cef936aa336b
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b
usage: scw exec [OPTIONS] SERVER COMMAND [ARGS...]. See 'scw exec --help'.
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b ls
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b ls -l
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b ls -la
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b bash
root@determined-thompson:~#
root@determined-thompson:~#
root@determined-thompson:~# exit
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b ls -la
total 28
drwx------  4 root root 4096 Jun  5 14:52 .
drwxr-xr-x 21 root root 4096 Mar 17 15:18 ..
-rw-r--r--  1 root root 3106 Feb 20  2014 .bashrc
drwx------  2 root root 4096 Jun  5 14:52 .cache
-rw-r--r--  1 root root  140 Feb 20  2014 .profile
-rw-rw-r--  1 root root 1240 Mar 17 14:45 .s3cfg.sample
drwx------  2 root root 4096 Jun  5 14:51 .ssh
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b ls -la
total 28
drwx------  4 root root 4096 Jun  5 14:52 .
drwxr-xr-x 21 root root 4096 Mar 17 15:18 ..
-rw-r--r--  1 root root 3106 Feb 20  2014 .bashrc
drwx------  2 root root 4096 Jun  5 14:52 .cache
-rw-r--r--  1 root root  140 Feb 20  2014 .profile
-rw-rw-r--  1 root root 1240 Mar 17 14:45 .s3cfg.sample
drwx------  2 root root 4096 Jun  5 14:51 .ssh
โžœ  ~  scw exec 29ba8d8f-5b6c-49a8-8100-cef936aa336b bash
root@determined-thompson:~#

[meta] support docker commands

  • attach
  • build
  • commit
  • cp
  • create
  • events
  • exec
  • export
  • history
  • images
  • import
  • info
  • inspect
  • kill
  • load
  • login
  • logout
  • logs
  • port
  • pause
  • ps
  • pull
  • push
  • rename
  • restart
  • rm
  • rmi
  • run
  • save
  • search
  • start
  • stats
  • stop
  • tag
  • top
  • unpause
  • version
  • wait

show examples from command line

It'd be cool to have some common examples (like those in the README) accessible from command line, with scw --show-examples for instance.

Add timeouts used by sync commands

The following command:

  • scw start --sync

Can hang forever if there's a boot issue ; in some scenarii, it is nice to have the ability to set timeouts:

  • one for the API state of the server to become OK
  • one for the SSH port to be open

These timeouts could be disabled by default, and enabled via CLI options or environment variables or via the config file.

Handle concurrent access to the datastore

It seems that the // support is not fully complete, sometimes when spawning multiple scw create ..., I get the following stacktraces:

/usr/local/lib/node_modules/scaleway-cli/node_modules/nedb/lib/datastore.js:67
    if (err) { throw err; }
                     ^
Error: ENOENT, rename '/tmp/scw.db~'
    at Error (native)
/usr/local/lib/node_modules/scaleway-cli/node_modules/nedb/lib/datastore.js:67
    if (err) { throw err; }
                     ^
Error: ENOENT, unlink '/tmp/scw.db~'
    at Error (native)

golang: add a version and commit id

Maybe we can generate a version.go file from the Makefile with commit ID and version from a somewhere

Then we need to put the information in scw -v and scw version

Consider having -k as the default behavior

Currently:

scw exec $uuid 'ls -l'

Prompts to add the SSH key to known hosts (we need to add -k to bypass this check).

Since the usage of this command is primarily for scripting, it would be cool to have -k as the default behavior, and introduce a --safe (or equivalent) extra argument to force the check.

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.