Skip to content

feat: One-Click Installer for Heidi CLI#92

Merged
heidi-dang merged 1 commit intomainfrom
user-experience-improvements
Mar 10, 2026
Merged

feat: One-Click Installer for Heidi CLI#92
heidi-dang merged 1 commit intomainfrom
user-experience-improvements

Conversation

@nguyenhhluong
Copy link
Collaborator

🚀 One-Click Installer System

Users can now install Heidi CLI with a single command!

✅ Complete Installation System:
• Single command: ./install
• Automatic cloning from latest main branch
• Dependency installation and virtual environment setup
• Build and install Heidi CLI system-wide
• Installation verification and cleanup

🖥️ Cross-Platform Support:
• Linux/macOS: Bash script (install)
• Windows: PowerShell script (install.ps1)
• Automatic permission handling and PATH setup
• User and system-wide installation options

📋 Installation Process:

  1. System requirements validation (Python 3.10+, Git, pip)
  2. Repository cloning from GitHub main branch
  3. Virtual environment setup and activation
  4. Dependency installation with pip
  5. Heidi CLI build and installation
  6. Installation verification and testing
  7. Post-installation setup guidance

🎯 User Experience:
• Beautiful colored output with progress indicators
• Clear error messages and troubleshooting guidance
• Automatic PATH configuration for user installations
• Detailed installation logs and status updates
• Success confirmation with next steps

📚 Complete Documentation:
• INSTALL.md with comprehensive installation guide
• System requirements and troubleshooting section
• Post-installation quick start guide
• Update and uninstallation instructions

🔧 Usage Examples:

Quick install (Linux/macOS):

curl -fsSL https://raw.githubusercontent.com/heidi-dang/heidi-cli/main/install | bash

Download and run:

wget https://raw.githubusercontent.com/heidi-dang/heidi-cli/main/install
chmod +x install
./install

Windows PowerShell:

Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/heidi-dang/heidi-cli/main/install.ps1' -OutFile 'install.ps1'
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\install.ps1

🎉 Benefits:
• Zero-configuration installation
• Professional-grade installer experience
• Works on all major platforms
• No manual dependency management
• Production-ready installation

This makes Heidi CLI accessible to everyone with a single command!

🚀 Complete One-Click Installation System:
• Single command installation: ./install
• Automatic cloning from latest main branch
• Dependency installation and virtual environment setup
• Build and install Heidi CLI system-wide
• Installation verification and cleanup

🖥️ Cross-Platform Support:
• Linux/macOS: Bash script (install)
• Windows: PowerShell script (install.ps1)
• Automatic permission handling and PATH setup
• User and system-wide installation options

📋 Comprehensive Installation Process:
• System requirements validation (Python 3.10+, Git, pip)
• Temporary directory creation and cleanup
• Repository cloning from GitHub main branch
• Virtual environment setup and activation
• Dependency installation with pip
• Heidi CLI build and installation
• Installation verification and testing
• Post-installation setup guidance

🎯 User Experience:
• Beautiful colored output with progress indicators
• Clear error messages and troubleshooting guidance
• Automatic PATH configuration for user installations
• Detailed installation logs and status updates
• Success confirmation with next steps

📚 Complete Documentation:
• INSTALL.md with comprehensive installation guide
• System requirements and troubleshooting section
• Post-installation quick start guide
• Update and uninstallation instructions
• Cross-platform compatibility notes

🔧 Features:
• Permission detection and handling
• Virtual environment isolation
• Automatic cleanup of temporary files
• Installation verification with heidi --version
• Error handling with helpful messages
• Force installation option for updates

🎉 Benefits:
• Zero-configuration installation
• Professional-grade installer experience
• Works on all major platforms
• No manual dependency management
• Production-ready installation

Users can now install Heidi CLI with a single command!
curl -fsSL https://raw.githubusercontent.com/heidi-dang/heidi-cli/main/install | bash
@heidi-dang heidi-dang merged commit b79bf17 into main Mar 10, 2026
3 of 6 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user onboarding experience for Heidi CLI by introducing a robust, cross-platform one-click installer. The new system automates all necessary steps from dependency management to final installation and verification, making the CLI more accessible and easier to set up for new and existing users. This change aims to reduce friction and potential errors during the initial setup phase, allowing users to quickly get started with Heidi CLI's features.

Highlights

  • One-Click Installer System: Introduced a comprehensive one-click installer for Heidi CLI, simplifying the installation process across different operating systems.
  • Cross-Platform Support: Provided dedicated installer scripts for Linux/macOS (Bash) and Windows (PowerShell), ensuring broad compatibility.
  • Automated Installation Workflow: The installers automate repository cloning, dependency installation, virtual environment setup, building, system-wide or user-specific installation, verification, and temporary file cleanup.
  • Enhanced User Experience: The installation process features colored output, progress indicators, clear error messages, automatic PATH configuration, and detailed post-installation guidance.
  • Comprehensive Documentation: Added a detailed INSTALL.md file covering system requirements, installation steps, options, troubleshooting, verification, and update/uninstallation instructions.
Changelog
  • INSTALL.md
    • Added comprehensive documentation for the new one-click installer, including system requirements, installation methods, post-installation steps, options, troubleshooting, and verification.
  • install
    • Added a new Bash script to provide a one-click installation experience for Heidi CLI on Linux and macOS systems.
    • Implemented functions for checking system requirements, cloning the repository, setting up a virtual environment, installing dependencies, building, installing, and verifying Heidi CLI.
    • Included colored output, error handling, and temporary file cleanup for a smooth installation process.
  • install.ps1
    • Added a new PowerShell script to provide a one-click installation experience for Heidi CLI on Windows systems.
    • Implemented functions for checking system requirements, cloning the repository, setting up a virtual environment, installing dependencies, building, installing, and verifying Heidi CLI.
    • Included colored output, error handling, and temporary file cleanup for a smooth installation process.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a one-click installer for Heidi CLI on both Linux/macOS (bash) and Windows (PowerShell), along with comprehensive documentation. The scripts are well-structured and cover the main installation steps, from checking requirements to cleaning up. However, I've identified a few critical and high-severity issues in both scripts that need to be addressed. These include incorrect logic for system-wide installations in the bash script, flawed dependency checks, and broken error handling in the PowerShell script. I've also noted a documentation inconsistency. My feedback includes specific code suggestions to resolve these issues.

Comment on lines +57 to +60
if [[ $EUID -eq 0 ]]; then
print_warning "Running as root - installing system-wide"
INSTALL_PREFIX="/usr/local"
PIP_INSTALL_ARGS="--user"

Choose a reason for hiding this comment

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

critical

When running as root for a system-wide installation, PIP_INSTALL_ARGS is incorrectly set to --user. The --user flag forces installation into the root user's home directory, which defeats the purpose of a system-wide installation to /usr/local. For a true system-wide installation as root, this variable should be empty.

Suggested change
if [[ $EUID -eq 0 ]]; then
print_warning "Running as root - installing system-wide"
INSTALL_PREFIX="/usr/local"
PIP_INSTALL_ARGS="--user"
print_warning "Running as root - installing system-wide"
INSTALL_PREFIX="/usr/local"
PIP_INSTALL_ARGS=""

print_step "Building Heidi CLI..."

# Check if build tools are available
if command -v python3 -m build &> /dev/null; then

Choose a reason for hiding this comment

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

high

The check command -v python3 -m build is incorrect for verifying if the build module is available. command -v checks for an executable in the PATH, and python3 -m build is not a single command name. This check will always fail, causing the script to fall back to the legacy setup.py build method. A correct way to check for the module is to try executing it.

Suggested change
if command -v python3 -m build &> /dev/null; then
if python3 -m build --version &> /dev/null; then


try {
# Check if build tools are available
if (Get-Command "python -m build" -ErrorAction SilentlyContinue) {

Choose a reason for hiding this comment

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

high

The check Get-Command "python -m build" is incorrect for verifying if the build module is available. Get-Command looks for a command with that exact name, which doesn't exist. This will always cause the script to fall back to the legacy setup.py build method. A better approach is to try to execute python -m build --version and check its success.

        if ($(try { & python -m build --version 2>$null; $true } catch { $false })) {

Comment on lines +293 to +295
if ($TempDir) {
Remove-TempFiles -TempDir $TempDir
}

Choose a reason for hiding this comment

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

high

The error handling logic is flawed due to variable scoping. The $TempDir variable is defined within the Main function's scope. When an error is caught by the top-level try/catch block, Handle-Error is called but cannot access $TempDir, so the cleanup of temporary files fails. To ensure cleanup always runs, $TempDir should be a script-scoped variable.

    if ($script:TempDir) {
        Remove-TempFiles -TempDir $script:TempDir
    }


# Run installation steps
Test-Requirements
$tempDir = New-TempDirectory

Choose a reason for hiding this comment

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

high

To fix the error handling scope issue, this variable should be declared in the script scope so it's accessible to the Handle-Error function during cleanup.

    $script:tempDir = New-TempDirectory

### **User vs System Installation**

**User Installation (Default)**
- Installs to `~/.local/bin` (Linux/macOS) or `%USERPROFILE%\AppData\Local\Programs` (Windows)

Choose a reason for hiding this comment

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

medium

The documentation states that the default user installation path for Windows is %USERPROFILE%\AppData\Local\Programs. However, the install.ps1 script defaults to installing in $env:USERPROFILE\heidi-cli. This discrepancy should be corrected to avoid confusing users.

Suggested change
- Installs to `~/.local/bin` (Linux/macOS) or `%USERPROFILE%\AppData\Local\Programs` (Windows)
- Installs to `~/.local/bin` (Linux/macOS) or `%USERPROFILE%\heidi-cli` (Windows)

# Add ~/.local/bin to PATH if not already there
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

Choose a reason for hiding this comment

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

medium

This command appends the PATH export to ~/.bashrc every time the script is run, which can lead to duplicate entries. Additionally, it only targets bash, while many users (especially on macOS) now use other shells like zsh (~/.zshrc). A more robust approach would be to check if the line already exists before adding it and to inform the user about other shell configuration files.

Suggested change
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
grep -qF 'export PATH="$HOME/.local/bin:$PATH"' ~/.bashrc || echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

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