Skip to content

feat(update): simplify update command behavior and API#64

Merged
francoischalifour merged 4 commits into
mainfrom
fc/debug-install-version
Jul 15, 2026
Merged

feat(update): simplify update command behavior and API#64
francoischalifour merged 4 commits into
mainfrom
fc/debug-install-version

Conversation

@francoischalifour

Copy link
Copy Markdown
Member

Context

The update command had a Bun-like capability buried behind several flags:

altertable update --install --target-version 1.1.0

This made the common path verbose and exposed multiple installer, source, cache, and status options that were primarily implementation details. It also produced ambiguous messaging for explicit older versions and could resolve the wrong executable path when a compiled binary was invoked through PATH or a symlink.

Proposed solution

Simplify the public update interface to:

altertable update
altertable update --check
altertable update 1.1.0 --force

The upgrade alias remains available as a convenience.

This change:

  • Makes altertable update install the latest release by default.
  • Adds --check for check-only behavior.
  • Supports a single positional version.
  • Requires --force for downgrades or reinstalling the current version.
  • Rejects removed flags and extra positional arguments.
  • Removes the legacy CLI surface:
    • --install
    • --target-version
    • --source
    • --install-method
    • --target-path
    • --status
    • --clear-cache
    • --check-interval
  • Keeps automatic update configuration available through environment variables.
  • Preserves origin-aware installation:
    • Native binaries update from verified GitHub release assets.
    • Package-manager installations use the detected package manager.
    • Source checkouts install the published package without overwriting the working tree.
  • Fixes compiled executable detection for relative paths, PATH lookups, and symlinked invocations.
  • Updates shell completion to include command aliases without duplicating traversal logic.
  • Updates documentation and changelog to reflect the simplified workflow.

function validateUpdateArguments(rawArgs: readonly string[]): void {
let versionSeen = false;

for (let index = 0; index < rawArgs.length; index += 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably not need to do this and have readily available parsing library that translates to a structured JSON version

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will revisit the overhaul architecture of the commands for that

Comment thread cli/src/lib/updater.ts
if (comparison < 0) {
return [
renderDisplayText([
span(`Target version v${target} is older than installed altertable v${current}.`),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should just use https://github.com/vadimdemedes/ink or similar at this point

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't want to go in that direction yet. I think it might be too much for our UI ambitions today

@francoischalifour
francoischalifour merged commit 310acdf into main Jul 15, 2026
12 checks passed
@francoischalifour
francoischalifour deleted the fc/debug-install-version branch July 15, 2026 16:09
leonkenneth added a commit that referenced this pull request Jul 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.3.0](v1.2.0...v1.3.0)
(2026-07-16)


### Features

* **update:** simplify `update` command behavior and API
([#64](#64))
([310acdf](310acdf))


### Bug Fixes

* **cli:** ignore unrelated Altertable environment variables
([#67](#67))
([8fe9041](8fe9041))
* **release:** checkout merge commit for draft release verification
([#58](#58))
([988c95d](988c95d))
* **release:** run recovery with current publication code
([#63](#63))
([eab2c4a](eab2c4a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Léo-Paul Goffic <leo.goffic@altertable.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants