sng CLI
sng is the StackNGO CLI. It applies your manifests, reads the state of your tenant, and
drives everyday operations. Everything it does goes through the HTTP API:
an sng command can always be reproduced with curl.
Installation: Install the CLI. Configuration and environment variables: Configuration.
Command tree
sng
├── sso login | logout | whoami Sign-in and identity
├── config create | show | use-cluster Local configuration file
├── template list | search | gen Catalog of manifest templates
├── apply [PATH] Apply manifests
├── validate [PATH] Check the structure
├── plan [PATH] Compare with the desired state
├── pull [DIR] Export the desired state
├── destroy FILE.yml Delete what a file describes
├── kind list | get | edit | delete Read, edit, delete by kind and name
├── detect [PATH] Detect programs, generate Dockerfile and App
├── run [DIR] -p PORT Run a folder over HTTPS, ephemeral
├── app list | create | describe | patch | scale | restart | logs | delete
├── secret list | describe | get | set | create | versions | rotate | restore | delete
├── cdn list | create | delete | upload | enable | disable | clear-cache
├── dns zone (list | create | describe | delete) · record (list | set | describe | delete)
├── registry login | create | pull | build | delete | access-key credentials
├── monitor list | create | delete
├── tenant list | create | use | assume | destroy
│ ├── policy list | get | create | update | delete | attach | detach | principals
│ ├── tier list | show | set
│ ├── oidc list | create | delete
│ └── billing get | set (administrators)
├── env list | checkout | refresh | restore | create-tenant
├── iam init | config | user | app | role | group Accounts of your end users
├── domain search | list | purchase | renew | remove (not available)
└── completion bash | zsh | fish | powershell
| Group | Status | Page |
|---|---|---|
sso, config | Available | sng sso, sng config |
template, apply, validate, plan, pull | Available | sng template, sng apply |
kind (list, get, edit, delete) | Available | sng kind |
destroy | Available | sng destroy |
detect | Beta | sng detect |
run | Beta | sng run |
app | Beta | sng app |
secret | Available | sng secret |
cdn | Beta | sng cdn |
dns | Beta | sng dns |
registry | Beta | sng registry |
monitor | Beta | sng monitor |
tenant (+ policy, tier, oidc, billing) | Available | sng tenant |
env | Available | sng env |
iam | Available | sng iam |
domain | Coming soon | sng domain |
Global flags
Available on every command.
| Flag | Default | Effect |
|---|---|---|
--config PATH | ~/.config/stackngo/config.yaml | Configuration file to use |
--json | disabled | Indented JSON output instead of text or tables |
-v, --verbose | disabled | Adds the HTTP method and URL to API error messages |
--version | — | Prints the binary's version and exits |
-h, --help | — | Command help |
Output
-
Text: aligned tables (
TENANT POLICIES CURRENT) orkey: valuelines. -
--json: the API response, as is, indented. This is the form to use in a script:sng tenant list --json | jq -r '.tenants[].tenant' -
YAML:
sng kind get TYPE NAME,sng template gen, and the--dry-runcommands write YAML (a manifest), not JSON.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Any error: invalid argument, not signed in, API refusal, network. The message is written to standard error. |
An API error is displayed as:
forbidden (no policy of this tenant allows it: see sng tenant policy list)
With -v:
forbidden (no policy of this tenant allows it: see sng tenant policy list) (GET https://api.dev.stackngo.fr/v1/secrets)
HTTP codes are explained in API errors.
Tokens and renewal
The CLI keeps two tokens: your identity (after sng sso login) and the session of the
current tenant (after sng tenant use). The session lasts one hour; when the API responds
401, the CLI opens a new one with your identity and replays the command. You have nothing
to do as long as your identity is valid. If it has expired: sng sso login.
Page conventions
Each group page describes its commands with: synopsis, description, arguments, flags (name,
type, default, effect), examples, --json output, and typical errors. Aliases (sng kind get TYPE
for sng kind list TYPE) are pointed out.