Skip to content

Add CLI flags, default NeoVim to PPA, and install LazyGit - #12

Merged
yorch merged 3 commits into
mainfrom
update-nvim
Feb 2, 2026
Merged

Add CLI flags, default NeoVim to PPA, and install LazyGit#12
yorch merged 3 commits into
mainfrom
update-nvim

Conversation

@yorch

@yorch yorch commented Mar 23, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add CLI argument parsing with --help and --nvim-deb flags
  • Default NeoVim installation to PPA unstable (matching previous main behavior)
  • Add --nvim-deb flag to opt into installing NeoVim from GitHub releases .deb package instead
  • Add LazyGit TUI installation from GitHub releases
  • Add build-essential to apt tools list

Test plan

  • bash bootstrap.sh --help prints usage and exits
  • bash bootstrap.sh installs NeoVim from PPA (default)
  • bash bootstrap.sh --nvim-deb installs NeoVim from GitHub releases .deb
  • bash bootstrap.sh --unknown prints error, shows usage, exits non-zero
  • CI passes for ubuntu:22.04 and ubuntu:24.04
  • nvim --version works after bootstrap
  • lazygit --version works after bootstrap
  • vi and vim resolve to nvim via alternatives

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added --nvim-deb CLI option to choose NeoVim installation source.
    • LazyGit is now installed as part of setup.
    • Added help documentation for available options.
  • Improvements

    • Added build-essential to installed development tools.

✏️ Tip: You can customize this high-level summary in your review settings.

@yorch
yorch force-pushed the update-nvim branch 2 times, most recently from 8cfd5b7 to 3fce5b8 Compare April 7, 2025 12:13
Copilot AI review requested due to automatic review settings February 2, 2026 02:59
@coderabbitai

coderabbitai Bot commented Feb 2, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@yorch has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

The pull request adds a new --nvim-deb CLI option to enable NeoVim installation from GitHub .deb releases instead of the PPA, introduces a new LazyGit installation step, adds build-essential to the base tools, and implements argument-parsing logic to handle these new configurations.

Changes

Cohort / File(s) Summary
CLI Argument Parsing
bootstrap.sh
Added --nvim-deb and --help flag handling with a new usage() function; argument parsing logic is duplicated in two sections.
LazyGit Installation
bootstrap.sh
Introduced stepInstallLazyGit() function to install LazyGit from GitHub releases; wired into STEPS array.
NeoVim Installation
bootstrap.sh
Updated NeoVim installation logic to support .deb installation from GitHub when NVIM_USE_DEB flag is set; preserves existing PPA installation as default.
Base Tools Installation
bootstrap.sh
Added build-essential to the list of tools installed by stepInstallTools().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A hop, a skip, through bootstrap land,
Lazy Git now at our command!
NeoVim dances—GitHub's release so bright,
Build-essential joins the installation night,
Shell scripts bloom with features new,
Options galore for old and new! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding CLI flags, keeping NeoVim defaulting to PPA, and adding LazyGit installation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-nvim

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Switch NeoVim from PPA to .deb from GitHub releases
  (neovim/neovim-releases), removing PPA dependency
- Use update-alternatives --install instead of --set for
  vi/vim registration
- Add LazyGit TUI installation from GitHub releases
- Add build-essential to apt tools list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Copilot AI left a comment

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.

Pull request overview

This PR enhances the bootstrap script by adding build-essential, installing LazyGit from GitHub releases, and switching NeoVim installation to use the latest GitHub release and properly manage vi/vim alternatives.

Changes:

  • Add build-essential to the common CLI tools installed via apt.
  • Introduce stepInstallLazyGit to download and install LazyGit from its latest GitHub release and hook it into the main STEPS pipeline.
  • Replace the NeoVim PPA-based installation with downloading the latest .deb from GitHub releases and configuring update-alternatives to set nvim as the default vi and vim.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bootstrap.sh
Comment on lines +399 to +407
local LAZYGIT_VERSION
LAZYGIT_VERSION=$(getLatestReleaseForRepo "${LAZYGIT_REPO}")
# Remove v prefix from version string
LAZYGIT_VERSION="${LAZYGIT_VERSION#v}"
local LAZYGIT_ASSET="lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
downloadLatestReleaseArtifact \
"${LAZYGIT_REPO}" \
"${LAZYGIT_ASSET}" \
"${LAZYGIT_TMP_FILE}"

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

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

In stepInstallLazyGit, you call getLatestReleaseForRepo directly to build LAZYGIT_ASSET and then call downloadLatestReleaseArtifact, which internally calls getLatestReleaseForRepo again to compute the release tag. If a new LazyGit release is published between these two calls, the asset name (derived from the first version value) may no longer exist under the tag returned by the second call, causing a 404/download failure. To avoid this potential version mismatch and the redundant API call, refactor so that the version is resolved exactly once (either by passing a version into the download helper or by having the helper return both tag and asset name), and ensure the asset name and release tag are always computed from the same version value.

Copilot uses AI. Check for mistakes.
Comment thread bootstrap.sh Outdated
Comment on lines +425 to +436
local NVIM_TMP_FILE="/tmp/nvim.deb"
downloadLatestReleaseArtifact \
"neovim/neovim-releases" \
"nvim-linux-x86_64.deb" \
"${NVIM_TMP_FILE}"
runCmdAndLog ${APT_INSTALL} "${NVIM_TMP_FILE}"
# Set neovim as default vim
local NVIM_BIN
NVIM_BIN="$(command -v nvim)"
runCmdAndLog update-alternatives --install /usr/bin/vi vi "${NVIM_BIN}" 110
runCmdAndLog update-alternatives --install /usr/bin/vim vim "${NVIM_BIN}" 110
runCmdAndLog rm -f "${NVIM_TMP_FILE}"

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

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

stepInstallNeoVim now installs NeoVim by downloading a .deb from the neovim/neovim-releases GitHub repository via downloadLatestReleaseArtifact and passing it directly to apt-get install, but the downloaded artifact is neither pinned to a specific version nor verified via checksum or signature. If the GitHub repo or its releases/latest endpoint is compromised, a malicious .deb (including attacker‑controlled maintainer scripts) could be served and executed as root during installation, leading to remote code execution on any system where this bootstrap runs. Prefer installing from a trusted signed APT repository or pinning to a specific release and validating its integrity before handing it to apt-get rather than blindly installing whatever the current latest artifact is.

Copilot uses AI. Check for mistakes.
Comment thread bootstrap.sh
Comment on lines +395 to +410
local LAZYGIT_REPO="jesseduffield/lazygit"
local LAZYGIT_TMP_FILE="/tmp/lazygit.tar.gz"
if ! [ -e "${LAZYGIT_BIN}" ]; then
logStep "Installing LazyGit..."
local LAZYGIT_VERSION
LAZYGIT_VERSION=$(getLatestReleaseForRepo "${LAZYGIT_REPO}")
# Remove v prefix from version string
LAZYGIT_VERSION="${LAZYGIT_VERSION#v}"
local LAZYGIT_ASSET="lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
downloadLatestReleaseArtifact \
"${LAZYGIT_REPO}" \
"${LAZYGIT_ASSET}" \
"${LAZYGIT_TMP_FILE}"
runCmdAndLog tar xf "${LAZYGIT_TMP_FILE}" -C /tmp lazygit
runCmdAndLog install /tmp/lazygit -D -t "${USR_BIN_DIR}/"
runCmdAndLog rm -rf "${LAZYGIT_TMP_FILE}" /tmp/lazygit

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

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

stepInstallLazyGit downloads the latest lazygit release artifact from the third‑party GitHub repo jesseduffield/lazygit via downloadLatestReleaseArtifact and installs the extracted binary system‑wide as root, without pinning to a specific version or verifying the artifact’s integrity. If the upstream GitHub repository, the releases/latest pointer, or the download path is compromised, an attacker can ship a malicious lazygit binary that will be transparently installed and later executed with user privileges, effectively enabling remote code execution on machines using this bootstrap script. To reduce this supply‑chain risk, pin to a specific trusted release (or commit) and verify its checksum or signature before installation instead of always installing the moving "latest" artifact.

Copilot uses AI. Check for mistakes.
@yorch yorch changed the title Update nvim and install lazygit Install NeoVim from GitHub releases and add LazyGit Feb 2, 2026
@yorch yorch changed the title Install NeoVim from GitHub releases and add LazyGit Add CLI flags, default NeoVim to PPA, and install LazyGit Feb 2, 2026
yorch and others added 2 commits February 1, 2026 22:16
Default NeoVim back to PPA unstable and add --nvim-deb flag to opt
into GitHub releases .deb install. Add --help flag with usage output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Ubuntu 20.04 and SpaceVim references from README
- Add lazygit, build-essential, and neovim description to tools list
- Document --nvim-deb and --help CLI flags with usage examples
- Update AGENTS.md line count and mention CLI flags

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@yorch
yorch merged commit 3de04c2 into main Feb 2, 2026
4 checks passed
@yorch
yorch deleted the update-nvim branch February 2, 2026 03:24
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