larksuite/cli · info

%s → %s available

Error message

%s → %s available

What it means

This warning is emitted by `lark-cli doctor` when the CLI update check succeeds and update.IsNewer determines that the latest version published on the npm registry is newer than the running build's version (build.Version). It means your installed CLI is out of date; the check result carries the hint "run: lark-cli update". It is informational in nature — the CLI works, but a newer release exists.

Source

Thrown at cmd/doctor/doctor.go:254

	resp, err := client.Do(req)
	if err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}

// checkCLIUpdate actively queries the npm registry for the latest version.
// Unlike the root-level async check, this does a synchronous fetch with timeout
// and works regardless of build version (dev builds included).
func checkCLIUpdate() []checkResult {
	latest, err := fetchLatestForDoctor()
	if err != nil {
		return []checkResult{warn("cli_update", "check failed: "+err.Error(), "")}
	}
	current := build.Version
	if update.IsNewer(latest, current) {
		return []checkResult{warn("cli_update",
			fmt.Sprintf("%s → %s available", current, latest),
			"run: lark-cli update")}
	}
	return []checkResult{pass("cli_update", latest+" (up to date)")}
}

var fetchLatestForDoctor = update.FetchLatest

func finishDoctor(f *cmdutil.Factory, checks []checkResult) error {
	allOK := true
	for _, c := range checks {
		if c.Status == "fail" {
			allOK = false
			break
		}
	}

	result := map[string]interface{}{

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Run `lark-cli update` to upgrade the CLI to the latest published version.
  2. Alternatively reinstall via your package manager (e.g. `npm install -g lark-cli@latest`) if you manage the binary outside the built-in updater.
  3. Re-run `lark-cli doctor` afterwards and confirm the check reports "(up to date)".
  4. If you must stay on the current version (e.g. pinned CI), acknowledge or filter this warning; it does not affect the doctor exit code unless other checks fail.

Example fix

// before
$ lark-cli doctor
  cli_update: warn - 1.0.0 → 1.2.3 available (run: lark-cli update)
// after
$ lark-cli update
$ lark-cli doctor
  cli_update: pass - 1.2.3 (up to date)
Defensive patterns

Strategy: validation

Validate before calling

# Compare installed vs latest before/after running doctor
lark-cli --version
npm view lark-cli version

Try / catch

// Skip or auto-resolve the outdated warning when updates are managed externally
for _, r := range results {
    if r.Check == "cli_update" && r.Status == "warn" && strings.Contains(r.Message, "available") {
        continue // outdated CLI: handle via scheduled `lark-cli update`, not doctor gating
    }
}

Prevention

When it happens

Trigger: Running `lark-cli doctor` when fetchLatestForDoctor returns a version string for which update.IsNewer(latest, build.Version) is true — i.e., the npm registry has a release newer than the currently installed binary.

Common situations: An install made weeks/months ago while newer releases shipped; a dev build (version "dev" or an old pinned version) compared against a released registry version; a frozen/pinned CLI version in CI that has since been superseded upstream.

Related errors


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/7f97b5f64b4fc309. Report an issue: GitHub.