Commands for serverless environment management
CLI Client and PHP Library to access the NorthStack NorthStack APIs
There are two ways to install and run the NorthStack CLI. The primary means is a native install (which requires you to have PHP 7.2 installed) and a docker-based wrapper which does not. Both installation methods require you to have docker installed.
|OS||Linux or OSX||Linux|
The native install method is preferred and more performant, so it's best if you're able to install PHP >= 7.2 for your operating system. If you're running a modern Linux distro chances are you can just
$packageManager install php72. If you're using on OSX the easiest way to do this is use homebrew.
git clone https://github.com/northstack/northstack-client.git cd northstack-client ./bin/install.sh
Some installation settings are configurable via CLI arguments:
-a <path> Set the app directory (default = $HOME/northstack/apps) -p <path> Set the install prefix (default = $HOME/.local) -m docker|native Set the install method (default = auto) -d Install in dev mode (default = false) -n Don't prompt for any input (default = no)
The CLI is installed to
~/.local/bin), which may or may not already be in your
$PATH. The installer attempt to update your rc files for you if this is the case:
[2019-06-26 14:50:00] [warn] /home/ns/.local/bin is not in your $PATH Would you like us to update your .bashrc/.zshrc files? Enter yes/no (default = no): yes 101a102,104 > # NorthStack START > PATH=/home/ns/.local/bin:$PATH > # NorthStack END [2019-06-26 14:51:39] [info] Updating: /home/ns/.bashrc
Make sure to
source ~/.bashrc after this!
The CLI also supports tab-completion. The process for enabling this varies from platform to platform, but in a pinch you can also just add the completion hook to your bashrc:
$ ~/.local/bin/northstack _completion --generate-hook --program northstack >> ~/.bashrc
northstack auth:login email@example.com
This will save a login token to
~/.northstacklogin. The login will be good for 14 hours.
After that you will need to login again.
This file will automatically be read by all other commands and used for authorization to the NorthStack API.
You may also use your API keys to log in using the
When done, you may use the
auth:logout command or simply remove the
northstack command by itself will show the commands available.
To get usage help for any command, simply prefix the command name with
northstack help auth:login
You can get your account ID by logging into https://console.northstack.com and looking at the address in your browser. Your account ID will be displayed on the dashboard labeled
If you are a collaborator and need the ID for another account, log in to console (link above) and use the account switcher (click your name in the upper right) and switch to the organization in question. The
Account IDon the dashboardwill change to reflect the current organization that you are viewing.