Skip to content

Install shell completion from get.sh and get-edge.sh - #1189

Merged
cdalar merged 1 commit into
mainfrom
install-shell-completion
Oct 9, 2026
Merged

cdalar merged 1 commit into
mainfrom
install-shell-completion

Conversation

@cdalar

@cdalar cdalar commented Oct 9, 2026

Copy link
Copy Markdown
Owner

What

  • onctl.sh/get.sh and get-edge.sh now set up tab completion for the login shell (bash, zsh or fish), ported from boxctl.io/get.sh. They write the script to the per-user completion directory and, for bash and zsh, add one guarded line to ~/.bashrc / ~/.zshrc. ONCTL_NO_COMPLETION=1 skips it.
  • onctl completion <shell> no longer needs an initialized .onctl directory. Before this, it printed nothing and exited 0 on a fresh machine, which is exactly when the installer runs.
  • README and the onctl.sh docs get a "Tab completion" section mirroring the boxctl.io CLI docs.

Note on rollout

The tagged release that get.sh downloads today still has the old behaviour, so until the next release get.sh prints "could not generate completion; skipping" and installs the binary as before. get-edge.sh picks up the fix as soon as this merges.

Testing

  • New unit test for the pre-run hook (completion passes without config, an ordinary command still fails).
  • Ran get-edge.sh in throwaway HOMEs for zsh, bash and fish against a binary built from this branch: script written, rc line added once across two runs, compdef/complete -p show onctl registered.
  • Ran it against the currently published edge binary: warns and skips, nothing written.
  • Docs site build not run locally (no node_modules).

🤖 Generated with Claude Code

https://claude.ai/code/session_01VHSGn6gnEQjsKxg2QaHxD7

The install scripts now generate tab completion for the user's login
shell (bash, zsh, fish) with the binary they just downloaded, the same
way boxctl.io/get.sh does. ONCTL_NO_COMPLETION=1 skips it.

onctl completion <shell> no longer requires an initialized .onctl
directory, since the installer runs it before onctl init. Binaries
released before this change print nothing there, so the scripts treat an
empty script as a failure and skip with a warning.

Claude-Session: https://claude.ai/code/session_01VHSGn6gnEQjsKxg2QaHxD7
@cdalar
cdalar enabled auto-merge (squash) October 9, 2026 16:02
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.83%. Comparing base (adff60b) to head (e79c877).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1189      +/-   ##
==========================================
+ Coverage   39.66%   39.83%   +0.16%     
==========================================
  Files          67       67              
  Lines        7296     7298       +2     
==========================================
+ Hits         2894     2907      +13     
+ Misses       4402     4391      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdalar
cdalar merged commit 1ddff76 into main Oct 9, 2026
13 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

⌂ 换网址