Skip to content

v0.1.7 — 装完顺手把 Tab 补全也装好

Choose a tag to compare

@shiftu shiftu released this 28 Aug 11:25
· 5 commits to main since this release

补全一直是「给你一行命令,你自己照抄」。多一步就少一批人装。

aivet completion --install:认出你在用哪个 shell,把脚本写到该在的地方,再往 rc 文件里补上加载它的那几行。install.sh / install.ps1 装完二进制会顺手跑一次,所以一般你不用自己敲。

重复跑是安全的 —— rc 里那几行用 # >>> aivet completion >>> 框着,升级时整段换掉,不会越叠越多。不想让它碰 rc 文件就照旧:aivet completion zsh > 你说了算的路径。

几个坑已经处理掉了:

  • zsh 加载顺序:那几行加在 .zshrc 末尾,也就是 oh-my-zsh 跑完 compinit 之后。写成「compdef 有了就直接 source、没有就自己开一次 compinit」,两种顺序都活。
  • PowerShell 的 $PROFILE:OneDrive 会把「文档」整个重定向走,所以不自己拼 Documents\PowerShell\...,改成跑 pwsh -Command $PROFILE 问它本人要。
  • macOS 的 bash:登录 shell 只读 ~/.bash_profile。改的是对的文件但不会被念到 —— 这种只提醒,不替你改 .bash_profile。

补全没装上不算安装失败:认不出 shell、rc 只读、找不到家目录一律当成跳过并返回 0。

装:

curl -fsSL https://raw.githubusercontent.com/shiftu/aivet/main/install.sh | bash