Summary
Running clickhousectl local server start with no installed version, no default set, and no --version flag should bootstrap automatically: install latest and start the server. Today it fails instead.
Current behaviour
start_server (crates/clickhousectl/src/local/mod.rs:294-300) only auto-installs when --version is passed:
let version = if let Some(spec_str) = &version_spec {
// server start --version <spec> → resolves + installs if missing
let spec = version_manager::parse_version_spec(spec_str)?;
let platform = version_manager::platform::Platform::detect()?;
version_manager::install::ensure_installed_local_first(&spec, &platform).await?
} else {
// bare `server start` → just reads the default, no install
version_manager::get_default_version()?
};
With nothing installed, get_default_version() returns Error::NoDefaultVersion, which prints:
No default version set. Run: clickhousectl local use <version>
and exits with code 1. No download happens. The only zero-to-running path right now is local server start --version latest, or the documented three-step local install stable && local use stable && local server start.
Proposed behaviour
When no --version is given and no default version is set (get_default_version() → NoDefaultVersion), fall back to installing latest and starting with it, rather than erroring. Effectively, the bare-start else branch should treat a missing default as "install latest" instead of a hard error.
Suggested shape:
- If a default exists → use it (unchanged).
- If no default is set → resolve
VersionSpec::Latest, ensure_installed_local_first, set it as the default (matching install's first-install-sets-default behaviour), then start. Emit a note to stderr that latest was installed so the auto-download isn't silent.
- A
VersionNotFound default (file points at a removed binary) should remain an error — only the no default at all case bootstraps.
Notes
- Do not set the default version to the version that was installed. This is deliberate; it means the user will keep getting the latest version if they dont pin.
- Doc update to
README.md to reflect that a bare server start now bootstraps.
- Update all docs that show using a tag like "stable" to use latest
Summary
Running
clickhousectl local server startwith no installed version, no default set, and no--versionflag should bootstrap automatically: installlatestand start the server. Today it fails instead.Current behaviour
start_server(crates/clickhousectl/src/local/mod.rs:294-300) only auto-installs when--versionis passed:With nothing installed,
get_default_version()returnsError::NoDefaultVersion, which prints:and exits with code 1. No download happens. The only zero-to-running path right now is
local server start --version latest, or the documented three-steplocal install stable && local use stable && local server start.Proposed behaviour
When no
--versionis given and no default version is set (get_default_version()→NoDefaultVersion), fall back to installinglatestand starting with it, rather than erroring. Effectively, the bare-startelsebranch should treat a missing default as "installlatest" instead of a hard error.Suggested shape:
VersionSpec::Latest,ensure_installed_local_first, set it as the default (matchinginstall's first-install-sets-default behaviour), then start. Emit a note to stderr thatlatestwas installed so the auto-download isn't silent.VersionNotFounddefault (file points at a removed binary) should remain an error — only the no default at all case bootstraps.Notes
README.mdto reflect that a bareserver startnow bootstraps.