feat: initial public release of the hyperlift CLI - #1
Conversation
Manage Hyperlift applications over the Spaceship External API: auth, apps list/get and the build, start, stop and restart verbs with --wait, env read-modify-write, logs with --follow, metrics, and self-update.
… is behind by a major-version
|
One another thing, is it easily possible to fetch openapi spec file dynamically while building (or maybe part of the CI to verify if its identical)? So that, we will never be able to forget updating it |
|
@yunussandikci So now the CI uses the same script The pin is also reduced to the Hyperlift subset now, so a domains or other unrelated schema change can't fail our PRs, so we check purely Hyperlift schema drift. Btw the script is only slightly complex because unfortunately But to summarize, it was a good idea and now we cannot forget to update the OpenAPI spec file :) |
What it does
hyperliftis the command-line client for Hyperlift container applications.It talks to the public Spaceship External API and signs in with an
API key and secret.
Main commands
apps: list, get, build, start, stop, restart, with--waitto polluntil the operation really finishes rather than when the API accepts it.
env: get, set, unset, as read-modify-write, since the API replaces thewhole map.
logs: runtime and build logs, cursor-paged;--followpolls becausethe API has no streaming endpoint.
metrics: time series in each series' own unit.auth: login, whoami, logout, with the secret in the OS keyring.update: checksum-verified self-update that refuses to touch a binary apackage manager owns (package manager install is tbd)
Try it
The repo ships a mock of the API, so no credentials are needed:
The mock holds a transient state for a few seconds, so e.g.
--waitvisibly polls.For the real API, use a shell without those exports, or the base URL override
sends you straight back to the mock. Create a key and secret in the
API Manager with the
hyperlift:read,hyperlift:executeandhyperlift:managescopes, thenmake installandhyperlift auth login. For details, see the README.Some details
internal/cmd/:apps,auth,env,logs,metrics,updateandversion. None build their own dependencies.internal/cmdutilholds the exit-code mapping and theFactory, which handsout the API client, config, streams and prompter lazily.
internal/cmd/rootassembles the tree and registers the persistent flags.internal/client, with its own transport for auth headers, retries and a debug trace.internal/keyringandinternal/config: OS keyring,with a file fallback when there is no keyring.
published OpenAPI document so it cannot quietly drift.
internal/testapi/testdatamake refresh-specscripts/install.shMakefilefor the everyday targets:build,install,test,lint,fmt,mock,run-mockandrefresh-spec.