CLI and server compatibility
The CLI and the server are released independently, so they need a way to know whether they fit. This page says how that works and what you should do.
Three version numbers
| Number | Of | Meaning |
|---|---|---|
Product version (product_version) | Server | The release of the whole set of services (web, API, sign-in, worker, AI). All services share one number; there is no separate number per service |
API version (api_version) | Server and CLI | The /v1 contract of the API. A CLI is generated to talk to one specific API version |
| CLI version | CLI | The release of the tmspec file |
The CLI is compatible with a server through the API version, not the product version. You can upgrade the server without upgrading the CLI, as long as the server still supports that CLI.
The server declares itself
GET /v1/meta, a public endpoint, tells a client before it signs in:
| Field | Meaning |
|---|---|
api_version | The server's API version |
product_version | The server's product version (0.0.0-dev for a build with no number) |
commit | The identifier of the build the server runs |
min_cli_version | The oldest CLI the server supports |
latest_cli_version | The newest CLI (absent when not set) |
issuer | The sign-in service address |
cli_client_id | The CLI's sign-in client |
web_url | The web app address (absent when not set) |
You can check from any machine:
curl -s https://<your team's API name>/v1/meta
What the CLI checks
Before talking to a host, the CLI reads /v1/meta (cached, at most once a day per host) and compares it with itself:
- CLI older than
min_cli_version: stops with exit code 12 and a reminder to upgrade, before sending anything else. Download the new version in Install the CLI. - Server API at a higher major version than the CLI: the CLI warns but still runs.
latest_cli_versionnewer than the CLI: the CLI reminds you, at most once a day.- If the server does not answer
/v1/meta, this check is skipped.
A dev build you made yourself is not checked.
tmspec version --json shows the version, commit, build_date and api_version of the CLI you are using.
For operators
min_cli_version and latest_cli_version are server settings (SPECD_CLI_MIN_VERSION and SPECD_CLI_LATEST_VERSION). The value must have the form MAJOR.MINOR.PATCH (a suffix such as -rc.1 is allowed, no v), and the latest version must not be older than the minimum, or the server does not start. Raise min_cli_version only when an old CLI really can no longer be used, because everyone using that old CLI will be stopped. See also Upgrade.
For integrators
An integration that generates a client from the OpenAPI specification should read the server's api_version and tolerate fields and enum values it does not know yet. Adding something new never breaks compatibility; see API.