Skip to content

Cli dx improvements#932

Merged
xav-db merged 4 commits into
mainfrom
cli-dx-improvements
Jun 4, 2026
Merged

Cli dx improvements#932
xav-db merged 4 commits into
mainfrom
cli-dx-improvements

Conversation

@xav-db

@xav-db xav-db commented Jun 4, 2026

Copy link
Copy Markdown
Member

Greptile Summary

This PR delivers a set of CLI developer-experience improvements: renames helix run to helix start (keeping run as a backward-compatible alias), removes the Dashboard command, adds a new helix skills subcommand for managing agent skills, makes helix chef work without Cloud auth in non-interactive / headless environments, and adds branded help styling and a 24 h skills-update-check alongside the existing binary update check.

  • helix runhelix start: All internal call sites updated; #[command(alias = "run")] preserves backward compatibility with scripts and agent muscle memory.
  • helix skills command: New install / update / list subcommands wrapping npx skills; helix update and helix init / chef automatically refresh skills after install, with a 24 h GitHub-SHA–based staleness check surfaced on the welcome screen.
  • Go SDK conflict handling: ErrConflict sentinel, StatusCode on HelixError, and IsConflict helper added; empty Returning() now serializes as [] instead of null (bug fix in returningVars).
  • Rust SDK: Comprehensive rustdoc coverage added to all public types and methods with no logic changes.

Important Files Changed

Filename Overview
helix-cli/src/main.rs Major CLI DX overhaul: renames run to start (with backward alias), removes Dashboard, adds Skills command, adds branded help styling, adds hidden removed-command stubs with friendly errors, and parallelizes update checks sequentially (minor latency concern).
helix-cli/src/update.rs New skills-update-check subsystem: GitHub commits API polling with 24h cache, HELIX_NO_UPDATE_CHECK opt-out, skills_installed() lockfile probe, and record_skills_refreshed() cache reset — all mirroring the existing binary update-check pattern.
helix-cli/src/commands/chef.rs Cloud auth is now optional in non-interactive / HELIX_SKIP_CLOUD_AUTH environments; snapshot upload is skipped gracefully when credentials are absent, unblocking headless agent runs.
helix-cli/src/commands/skills.rs New helix skills subcommand (install / update / list) delegating to npx skills; checks for npx presence and returns a helpful error when Node.js is absent.
sdks/go/client.go Adds ErrConflict sentinel, StatusCode field on HelixError, and IsConflict helper; operator precedence in IsConflict is correct but explicit parentheses would improve readability.
sdks/go/dsl.go Extracts returningVars helper to ensure empty Returning() calls serialize as [] instead of null — bug fix confirmed by new test.
sdks/go/README.md Adds conflict-retry guidance and parameter documentation; the ExecWithConflictRetry example has a dead return nil after the loop that is unreachable and potentially misleading.
sdks/rust/src/lib.rs Comprehensive rustdoc coverage added to all public types and methods; no logic changes.
helix-cli/src/lib.rs Adds SkillsAction enum and --skills/--no-skills flags to both InitTarget variants, with skills_override() to resolve subcommand-level flags over parent-level flags.
helix-cli/src/setup.rs Adds list_skills / skills_list_args and updates warning messages to reference helix start; well-tested with new unit tests.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[helix CLI invoked] --> B{top-level help?}
    B -- yes --> C[print_help / exit]
    B -- no --> D[check_for_updates]
    D --> E[check_skills_update]
    E --> F[Cli::parse]
    F --> G{command?}
    G -- none --> H[display_welcome\nupdate + skills notices]
    G -- start / run alias --> I[commands::start::run]
    G -- skills install/update/list --> J[commands::skills::run\nnpx skills ...]
    G -- init local/cloud --> K[commands::init::run\nmaybe_install_tooling]
    G -- chef --> L[commands::chef::run\nskip auth if non-interactive]
    G -- update --> M[commands::update::run\nrefresh_skills_if_installed]
    G -- compile/check/deploy --> N[friendly removed-command error]
    J --> O[crate::setup::install_skills\nor list_skills]
    O --> P[record_skills_refreshed\ndelete skills_cache.toml]
Loading

Comments Outside Diff (1)

  1. helix-cli/src/main.rs, line 659-661 (link)

    P2 Sequential network calls add latency to every command

    check_for_updates and check_skills_update are awaited sequentially before Cli::parse(). On a cache-miss day each can block up to 10 s (the reqwest timeout), meaning any command — not just the welcome screen — could stall for up to 20 s once every 24 h. These two independent futures could be parallelized with tokio::join! to cap the overhead at one network round-trip instead of two.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "Enhance Go SDK error handling and query ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

xav-db added 4 commits June 4, 2026 10:24
This commit updates the helix-db package to version 2.0.4 in the Cargo.lock file. Additionally, it refines the CLI documentation, replacing references to the `helix run` command with `helix start` for consistency. The README and contributors' guide have been updated to reflect these changes, improving clarity on building and running local instances. The dashboard command has been removed to streamline the CLI functionality.
This commit introduces a new `skills` command group to the Helix CLI, allowing users to install, update, and list Helix agent skills. The `SkillsAction` enum has been added to define the available actions, and corresponding functionality has been implemented in the `skills` module. Additionally, the CLI now checks for updates to installed skills and provides notifications when updates are available. Tests have been added to ensure proper parsing and functionality of the new commands.
This commit introduces a new error type for handling HTTP 409 conflicts in the Go SDK, along with a function to check for conflict errors. The `HelixError` struct has been updated to include a `StatusCode` field, and the `Exec` method now populates this field when a conflict occurs. Additionally, a new test has been added to validate the conflict error handling. The `Returning` method in the DSL has been refactored to improve the serialization of empty return values. The README has been updated to document these changes, including guidance on handling conflicts in client requests.
Comment thread sdks/go/README.md
Comment on lines +124 to +133
func ExecWithConflictRetry(ctx context.Context, client *helix.Client, build func() helix.Request, out any) error {
for attempt := 0; attempt < 3; attempt++ {
err := client.Exec(ctx, build(), out)
if err == nil || !helix.IsConflict(err) || attempt == 2 {
return err
}
time.Sleep(time.Duration(attempt+1) * 50 * time.Millisecond)
}
return nil
}

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.

P2 Unreachable return nil after the retry loop

On the third iteration (attempt == 2) the condition attempt == 2 is always true, so return err is always hit from inside the loop. The return nil after the loop is dead code and can mislead readers into thinking a third failed conflict can silently succeed — if the last call still errors, that error should be returned.

Suggested change
func ExecWithConflictRetry(ctx context.Context, client *helix.Client, build func() helix.Request, out any) error {
for attempt := 0; attempt < 3; attempt++ {
err := client.Exec(ctx, build(), out)
if err == nil || !helix.IsConflict(err) || attempt == 2 {
return err
}
time.Sleep(time.Duration(attempt+1) * 50 * time.Millisecond)
}
return nil
}
func ExecWithConflictRetry(ctx context.Context, client *helix.Client, build func() helix.Request, out any) error {
const maxAttempts = 3
var err error
for attempt := 0; attempt < maxAttempts; attempt++ {
err = client.Exec(ctx, build(), out)
if err == nil || !helix.IsConflict(err) {
return err
}
if attempt < maxAttempts-1 {
time.Sleep(time.Duration(attempt+1) * 50 * time.Millisecond)
}
}
return err
}

@xav-db xav-db merged commit dd7e250 into main Jun 4, 2026
10 checks passed
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.

1 participant