The bastide command line
The bastide command drives the platform from a terminal or a continuous integration script: sign in, link a folder to a project, deploy while following the log live, and call any operation in the registry. This page explains how to install it, how to sign in, and what a script can expect from its output.
Install
npm install -g bastide && bastide login
Without installing, npx bastide login does the same. Other ways to install, including a standalone binary that needs no Node, are described with their SHA-256 checksums at https://bastide.app/installer.
When a newer version exists, the command says so once a day on standard error, in a terminal only. It never updates itself: npm install -g bastide does.
Note. The old names
gsandglowsoftstill work for one more version, with a warning. Your scripts should move tobastide.
Sign in
bastide login uses device authorisation (RFC 8628): no password goes through the terminal.
- The command prints an address and an eight-letter code, and opens your browser if it can. With
--sans-navigateur(no browser), it only prints the address. - The console screen Autoriser la ligne de commande (Authorise the command line), at
https://console.bastide.app/appareil, shows the code. Check that it matches your terminal; if not, deny. Sign in first if needed, second factor included. - Choose Autoriser (Authorise). The terminal receives a personal token valid for 90 days, carrying your rank and every scope. The code expires after ten minutes.
- The command stores the token and reads your organisations.
Where the token goes: to the system keychain (security on macOS, secret-tool on Linux, the credential vault on Windows). On a machine without a keychain, it goes to an identifiants.json file readable by its owner only, and login says so. The token is stored per API address.
| Command | Effect |
|---|---|
bastide login | Sign in through the browser. |
bastide whoami | Say where the token comes from (environment, keychain or file) and which organisations it opens. |
bastide logout | Remove the token from this machine. It stays valid on the platform: revoke it from Compte (Account) if needed. |
The login token appears in Compte, section "Vos jetons" (your tokens), under the name "Ligne de commande bastide (date)".
Link a folder and deploy
bastide link --project-id prj_01JQ8ZK4M7NP2RSTVWXYZ34567
bastide deploy
link writes .glowsoft/project.json in the current folder, with the project and organisation identifiers. Any command run in that folder or below takes from it the project you do not name. --repertoire <path> starts from another folder.
deploy runs deployment.create on the production environment (or --environment-id), at reference --ref or the environment's branch, then follows the state and the build log until a final state, and prints the address being served. --sans-suivi (no follow) returns as soon as the deployment is created. Ctrl-C stops the following, never the deployment: it carries on on the platform. Following stops by itself after thirty minutes.
bastide logs reads the environment's runtime logs; with --suivre (follow), it keeps printing incoming lines. --since and --query narrow the read.
bastide doctor compares the local folder with the deployed environment: runtime version, package manager, framework, install, build and start commands, variables present on one side only, served commit, redirects and rewrites. For each difference it gives the command that brings both sides together, and exits with code 11 if it finds one. It compares variable names, never their values.
Generated commands
Every operation in the registry is a command, with no line written for it. The path comes from the operation name: bastide <resource> <action>, with as many words as segments.
| Operation | Command |
|---|---|
project.list | bastide project list --organization-id org_… |
deployment.log.read | bastide deployment log read --project-id prj_… --deployment-id dep_… |
env.write.nonproduction | bastide env write nonproduction --project-id prj_… --environment-id env_… … |
service_token.create | bastide service_token create --organization-id org_… … |
- Options are the input fields, written with hyphens:
projectIdbecomes--project-id. - A list is given by repeating the option, or at once as JSON:
--scopes project:read --scopes deploy:write, or--scopes '["project:read","deploy:write"]'. An object is given as JSON. bastide aide(help) lists every command;bastide aide <command>or--aidedescribes its options.- Write operations accept
--idempotency-key: see the API.
The full list, option by option, is in the command line reference.
Output and scripts
No command opens a prompt: nothing waits for keyboard input. Only login opens the browser.
- Without options, output is meant for a person and may change layout from one version to the next. Content reported by a third party (a project name, a commit message) is followed by "(rapporté)" (reported).
- With
--json, output is the response body as the API publishes it, on one line. Its schema is the OpenAPI document's: it is a stable contract. An error is then written to standard error as{"erreur": {"code", "cause", "suite", "message", "statut", "sortie"}}. deploy --jsonandlogs --jsonwrite one JSON line per event:{"evenement":"cree",…},{"evenement":"ligne","texte":…},{"evenement":"etat",…},{"evenement":"fin","deploymentId",…,"url"}.
Every error gives its cause and what to do next, most often the command to run.
Confirming an operation
A class E or I operation (see reversibility) needs --yes. Without it, the command does not send it and exits with code 12. An irreversible operation is also confirmed in two steps: the first call returns the confirmation_requise refusal with a nonce; run the same command again with --confirmation-nonce <nonce> within five minutes.
Exit codes
Codes follow the family of the cause, not the HTTP status. A number never changes meaning. bastide aide sorties lists them.
| Code | Meaning |
|---|---|
| 0 | The operation succeeded. |
| 1 | A fault in the command line itself. |
| 2 | The command or its options are malformed; nothing was sent. |
| 3 | The machine is not configured: token, API address or project link missing. |
| 4 | The platform does not recognise the token presented. |
| 5 | The platform recognised the caller and refused the operation. |
| 6 | The resource does not exist, or not for this caller. |
| 7 | The resource's current state does not allow the operation. |
| 8 | A rate or quantity cap is reached. |
| 9 | The platform failed or is not ready; the call can be retried. |
| 10 | The platform did not answer: address unreachable or timeout. |
| 11 | doctor found at least one difference between the machine and what is deployed. |
| 12 | The operation is destructive or irreversible and --yes was not given. |
| 13 | deploy followed the deployment to the end: it failed, or was not put live. |
A script retries on 9 and 10, and gives up on 2 to 7.
Environment variables
| Variable | Role |
|---|---|
BASTIDE_TOKEN | The token to present. It takes precedence over the keychain: in continuous integration nothing else is consulted. GLOWSOFT_TOKEN is accepted too. |
BASTIDE_API_URL | The API address, https://api.bastide.app by default. It must start with https://. GLOWSOFT_API_URL is accepted too. |
GLOWSOFT_DELAI | The timeout of one call, in seconds, from 1 to 600; 30 by default. |
BASTIDE_SANS_ANNONCE | When set, turns off the new-version notice. CI turns it off as well. |
A continuous integration example is in Service accounts and tokens.
Common errors
| Code | Cause | Fix |
|---|---|---|
jeton_absent | No token: neither variable nor keychain. | bastide login, or set BASTIDE_TOKEN. |
projet_non_lie | No link and no --project-id. | bastide link --project-id …, or pass the option. |
confirmation_absente | The operation needs --yes. | Run it again with --yes if you mean it. |
connexion_expiree | The login code was not approved in time. | Run bastide login again. |
unauthenticated | The token expired, was revoked or disabled. | bastide login again. |
operation_non_servie | The operation is declared but not served yet. | None: it is not available. |