Altostra CLI Introduction

Yevgeni Krupetsky
Altostra
Published in
3 min readOct 15, 2020

Originally published on Altostra.

Altostra is a developer-first platform, and as such, it’s important to us to provide developers with a CLI to carry out whatever task they need to, right from their terminal.

The Altostra CLI has three primary functions. First and foremost, to be the main tool developers use while working on projects. Then, to serve the automation needs for processes such as CI/CD and scripting. To complete the Altostra experience, provide management capabilities of projects, deployments, environments and policies right in the terminal.

Setting Up

Before installing the Altostra CLI, make sure you have Node.js installed.

The Altostra CLI is available as an NPM package:

$ npm install -g @altostra/cli

Logging in

The CLI requires access to your Altostra account for many of the operations you will use it for. So, let’s login first:

$ alto login

The login process is straightforward. It opens a login page in a browser — if you have logged in to the Altostra Web Console already, you’ll be logged in automatically.

Look around

Let’s now do some common operations to get familiar with the Altostra CLI.

What can you do

Let’s first see what the CLI has to offer:

$ alto --help

For brevity, I’m omitting the output of the command. Go ahead and run it in your terminal to see the full list of commands. You can also read the CLI documentation.

You can quickly access the Altostra docs by running:

$ alto docs

What do we have

Let’s see what environments we have set up on our account:

These are the environments available to our developers for use when deploying. No need for cloud account names and numbers — we like simplicity.

How about the deployments for our website project:

We can see the deployments, or “instances”, of our website project in two different environments, the time of update and version deployed.

What if you want to create a new project from a template? Let’s list the publicly available templates:

$ alto templatesPublicly available templates:
* static-website
* simple-crud-service-nodejs
* scalable-webhook-nodejs
* hello-world-nodejs

Starting fresh

Let’s now demonstrate a simple workflow using the Altostra CLI to deploy a static website. We already know that there’s a template for it called static-website, so let use it:

# create the project
$ alto new my-website --template static-website
$ cd my-website
# push a deployable image
$ alto push v1.0
# deploy to the Daylong enviroment
# where deployments are automatically removed after a day
$ alto deploy blog:v1.0 --env Daylong
# show the details for the "blog" deployment including its status
$ alto deployments blog
# upload the website content files
$ alto sync -a --public

We create, deploy the infrastructure, and upload the website content files for a new project with just a few simple commands.

Automation and CI/CD

To use the Altostra CLI in automation scripts and pipelines, you must first generate an authentication token, which you then use in your scripts.

Then, after you’ve run your unit tests and build steps, create an Altostra image using the alto push command.

You can then deploy that image to an integration test environment using the alto deploy command and run your integration tests there.

The image is the same for deployments to any environment and differs only in the configuration. After the CI stage is complete and the CD stage begins, you can use the alto deploy command again to deploy the same image you tested during the CI stage to the production environment.

In Conclusion

The CLI is your companion when it comes to wielding the power of Altostra, and we want it to help you in your everyday development, automation and configuration work.

If you feel that something is missing or can be improved, let us know so we can make your development experience even better.

To learn more, visit us at https://altostra.com, read our blog and our documentation.

Happy clouding!

--

--