Install the CLI
Deployed and supported. The fields and commands described here are stable within version v1alpha1.
Prebuilt binaries are not published yet: the CLI is built from source, in one command.
The sng CLI is a single binary, with no dependencies, written in Go. It talks to the StackNGO
API and stores its configuration in ~/.config/stackngo/config.yaml.
Prerequisites
- Go 1.27 or later (go.dev/dl) and
make. - A browser on the same machine, for interactive sign-in (
sng sso login). For a machine without a browser (server, CI), see Machine accounts.
Linux and macOS
git clone https://gitlab.com/stackngo/sng-cli.git
cd sng-cli
make build
sudo make install # installs bin/sng in /usr/local/bin
sng --version
Without administrator rights, install into a folder of your own:
make install BINDIR="$HOME/.local/bin"
make build embeds the address of the API (https://api.dev.stackngo.fr) and of the
authentication service in the binary: there is nothing to configure.
Windows
From a PowerShell terminal with Go and make (for example via
Scoop: scoop install go make):
git clone https://gitlab.com/stackngo/sng-cli.git
cd sng-cli
make build
Copy-Item .\bin\sng.exe "$env:LOCALAPPDATA\Programs\sng\sng.exe"
Add %LOCALAPPDATA%\Programs\sng to your PATH. The configuration file is then
%APPDATA%\stackngo\config.yaml.
Under WSL, simply follow the Linux procedure.
Check the installation
sng --version
sng --help
sng version dev
The displayed version is dev for a binary built from source.
Shell completion
# bash
sng completion bash | sudo tee /etc/bash_completion.d/sng > /dev/null
# zsh
sng completion zsh > "${fpath[1]}/_sng"
# fish
sng completion fish > ~/.config/fish/completions/sng.fish
# PowerShell
sng completion powershell | Out-String | Invoke-Expression
Update
cd sng-cli && git pull && make build && sudo make install
Going further
make build-allproduces archives for Linux, macOS and Windows (amd64 and arm64) with their checksums, if you want to distribute the binary within your team.- The global flags (
--config,--json,-v) and the configuration file are described in the reference.
Next step: Sign in.