Skip to content

Commit 573ff88

Browse files
authored
Merge pull request #38 from ElcanoTek/codex/simplify-readme-and-update-dependencies
2 parents c1080ed + a5cdc9a commit 573ff88

File tree

4 files changed

+17
-431
lines changed

4 files changed

+17
-431
lines changed

dependencies/README.md

Lines changed: 16 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -1,188 +1,36 @@
1-
# Prerequisites Installer Scripts
1+
# Prerequisite Installer Scripts
22

3-
This repository contains three installer scripts that automatically install the required dependencies for your project across different operating systems.
3+
Scripts in this directory install the tools needed for the project:
44

5-
## Overview
5+
- **Python 3**
6+
- **uv** – fast Python package and project manager
7+
- **crush** – AI coding agent
68

7-
The installer scripts will install the following dependencies:
9+
## Scripts
810

9-
### Required Dependencies
10-
- **Git** - Version control system
11-
- **Python 3** - Programming language and runtime
12-
- **uv** - Fast Python package manager and project manager
13-
- **crush** - AI coding agent for terminal
11+
- `install_prerequisites_macos.sh`
12+
- `install_prerequisites_linux.sh`
13+
- `install_prerequisites_windows.ps1` (with wrapper `install_prerequisites_windows.bat`)
1414

15-
### Optional Dependencies
16-
- **ghostty** - Modern, fast terminal emulator (recommended but optional)
15+
Run the script that matches your platform:
1716

18-
## Platform-Specific Scripts
19-
20-
### 1. macOS Installer (`install_prerequisites_macos.sh`)
21-
22-
**Requirements:**
23-
- macOS 10.15 or later
24-
- Internet connection
25-
- Terminal access
26-
27-
**Installation Methods Used:**
28-
- **Homebrew** (primary method) - Automatically installs if not present
29-
- **Xcode Command Line Tools** (fallback for Git and Python)
30-
- **Standalone installers** (fallback for uv)
31-
- **Go installation** (fallback for crush)
32-
33-
**Usage:**
3417
```bash
35-
# Download and run the script
36-
curl -O https://raw.githubusercontent.com/your-repo/install_prerequisites_macos.sh
37-
chmod +x install_prerequisites_macos.sh
18+
# macOS
3819
./install_prerequisites_macos.sh
39-
```
40-
41-
**What it does:**
42-
1. Installs Homebrew if not present
43-
2. Installs Git via Homebrew or Xcode Command Line Tools
44-
3. Installs Python via Homebrew or Xcode Command Line Tools
45-
4. Installs uv via Homebrew or standalone installer
46-
5. Installs crush via Homebrew or Go
47-
6. Optionally installs ghostty via Homebrew or manual download
48-
49-
### 2. Linux Installer (`install_prerequisites_linux.sh`)
50-
51-
**Requirements:**
52-
- Linux distribution (Ubuntu, Debian, Fedora, RHEL, CentOS, Arch, openSUSE, Alpine)
53-
- Internet connection
54-
- sudo privileges
55-
- Terminal access
56-
57-
**Supported Distributions:**
58-
- **Ubuntu/Debian** - Uses apt package manager
59-
- **Fedora/RHEL/CentOS** - Uses dnf/yum package manager
60-
- **Arch Linux/Manjaro** - Uses pacman and AUR
61-
- **openSUSE/SLES** - Uses zypper package manager
62-
- **Alpine Linux** - Uses apk package manager
6320

64-
**Usage:**
65-
```bash
66-
# Download and run the script
67-
curl -O https://raw.githubusercontent.com/your-repo/install_prerequisites_linux.sh
68-
chmod +x install_prerequisites_linux.sh
21+
# Linux
6922
./install_prerequisites_linux.sh
70-
```
71-
72-
**What it does:**
73-
1. Detects your Linux distribution automatically
74-
2. Updates package manager repositories
75-
3. Installs Git via distribution package manager
76-
4. Installs Python via distribution package manager
77-
5. Installs uv via distribution packages or standalone installer
78-
6. Installs crush via distribution repositories or Go
79-
7. Optionally installs ghostty via distribution packages or community packages
80-
81-
### 3. Windows Installer (`install_prerequisites_windows.ps1`)
82-
83-
**Requirements:**
84-
- Windows 10 or later
85-
- PowerShell 5.1 or later
86-
- Internet connection
87-
- Administrator privileges (recommended)
8823

89-
**Installation Methods Used:**
90-
- **WinGet** (Windows Package Manager) - Primary method
91-
- **Scoop** - Alternative package manager
92-
- **Chocolatey** - Alternative package manager
93-
- **npm** - For crush installation
94-
- **Manual downloads** - Fallback method
95-
96-
**Usage:**
97-
```powershell
98-
# Download and run the script in PowerShell (Run as Administrator recommended)
99-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/your-repo/install_prerequisites_windows.ps1" -OutFile "install_prerequisites_windows.ps1"
100-
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
101-
.\install_prerequisites_windows.ps1
24+
# Windows (PowerShell)
25+
powershell -ExecutionPolicy RemoteSigned -File install_prerequisites_windows.ps1
10226
```
10327

104-
**What it does:**
105-
1. Installs WinGet if not present
106-
2. Installs Windows Terminal
107-
3. Installs Git via WinGet, Chocolatey, or Scoop
108-
4. Installs Python via WinGet, Chocolatey, or Scoop
109-
5. Installs uv via WinGet, Scoop, or standalone installer
110-
6. Installs crush via WinGet, Scoop, or npm
111-
7. Optionally installs ghostty via manual download
112-
113-
## Features
114-
115-
### Smart Detection
116-
- All scripts detect if dependencies are already installed
117-
- Skip installation if a dependency is already present
118-
- Provide version information for installed dependencies
119-
120-
### Multiple Installation Methods
121-
- Each script tries multiple installation methods
122-
- Falls back to alternative methods if primary method fails
123-
- Provides manual installation instructions as last resort
124-
125-
### User-Friendly Output
126-
- Color-coded status messages
127-
- Clear success/warning/error indicators
128-
- Progress information throughout installation
129-
130-
### Safety Features
131-
- Linux script prevents running as root
132-
- Windows script handles execution policy
133-
- All scripts use error handling to prevent partial installations
134-
135-
## Troubleshooting
136-
137-
### Common Issues
138-
139-
**macOS:**
140-
- If Homebrew installation fails, install Xcode Command Line Tools manually: `xcode-select --install`
141-
- If you get permission errors, ensure your user account has admin privileges
142-
143-
**Linux:**
144-
- If package manager updates fail, check your internet connection
145-
- For distribution-specific issues, ensure your system is up to date
146-
- Some distributions may require enabling additional repositories
147-
148-
**Windows:**
149-
- If PowerShell execution is blocked, run: `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
150-
- If WinGet is not available, the script will install alternative package managers
151-
- Run PowerShell as Administrator for best results
152-
153-
### Manual Installation
154-
155-
If the automated scripts fail, you can install dependencies manually:
156-
157-
1. **Git**: Visit [git-scm.com](https://git-scm.com/downloads)
158-
2. **Python**: Visit [python.org](https://www.python.org/downloads/)
159-
3. **uv**: Visit [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/)
160-
4. **crush**: Visit [github.com/charmbracelet/crush](https://github.com/charmbracelet/crush)
161-
5. **ghostty**: Visit [ghostty.org](https://ghostty.org/docs/install/binary)
162-
163-
## Verification
164-
165-
After running any installer script, verify the installations by running:
28+
After running, verify the installations:
16629

16730
```bash
168-
# Check versions of installed tools
169-
git --version
17031
python3 --version # or python --version on Windows
17132
uv --version
17233
crush --version
173-
ghostty --version # if installed
17434
```
17535

176-
## Support
177-
178-
If you encounter issues with these installer scripts:
179-
180-
1. Check the troubleshooting section above
181-
2. Ensure your system meets the requirements
182-
3. Try running the script again (it's safe to re-run)
183-
4. For persistent issues, install dependencies manually using the links provided
184-
185-
## License
186-
187-
These installer scripts are provided as-is for convenience. Please refer to the individual software licenses for each dependency being installed.
188-
36+
You can re-run the scripts safely if needed.

dependencies/install_prerequisites_linux.sh

Lines changed: 1 addition & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -84,45 +84,6 @@ update_package_manager() {
8484
esac
8585
}
8686

87-
# Function to install Git
88-
install_git() {
89-
if ! command_exists git; then
90-
print_status "Installing Git..."
91-
case $DISTRO in
92-
ubuntu|debian)
93-
sudo apt install -y git
94-
;;
95-
fedora)
96-
sudo dnf install -y git
97-
;;
98-
rhel|centos|rocky|almalinux)
99-
if command_exists dnf; then
100-
sudo dnf install -y git
101-
else
102-
sudo yum install -y git
103-
fi
104-
;;
105-
arch|manjaro)
106-
sudo pacman -S --noconfirm git
107-
;;
108-
opensuse*|sles)
109-
sudo zypper install -y git
110-
;;
111-
alpine)
112-
sudo apk add git
113-
;;
114-
*)
115-
print_error "Unsupported distribution for automatic Git installation"
116-
print_status "Please install Git manually using your package manager"
117-
return 1
118-
;;
119-
esac
120-
print_success "Git installed successfully"
121-
else
122-
print_success "Git is already installed ($(git --version))"
123-
fi
124-
}
125-
12687
# Function to install Python
12788
install_python() {
12889
if ! command_exists python3; then
@@ -270,72 +231,6 @@ gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
270231
fi
271232
}
272233

273-
# Function to install ghostty (optional)
274-
install_ghostty() {
275-
if ! command_exists ghostty; then
276-
print_status "Installing ghostty terminal (optional but recommended)..."
277-
278-
# Ask user if they want to install ghostty
279-
read -p "Do you want to install ghostty terminal? (y/N): " -n 1 -r
280-
echo
281-
if [[ $REPLY =~ ^[Yy]$ ]]; then
282-
case $DISTRO in
283-
arch|manjaro)
284-
sudo pacman -S --noconfirm ghostty
285-
print_success "ghostty installed via official repository"
286-
return 0
287-
;;
288-
alpine)
289-
# Enable testing repository
290-
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" | sudo tee -a /etc/apk/repositories
291-
sudo apk update
292-
sudo apk add ghostty
293-
print_success "ghostty installed via Alpine testing repository"
294-
return 0
295-
;;
296-
opensuse*|sles)
297-
sudo zypper install -y ghostty
298-
print_success "ghostty installed via openSUSE repository"
299-
return 0
300-
;;
301-
ubuntu|debian)
302-
print_status "Installing ghostty via community package..."
303-
print_status "Downloading from ghostty-ubuntu repository..."
304-
LATEST_URL=$(curl -s https://api.github.com/repos/ghostty-org/ghostty-ubuntu/releases/latest | grep "browser_download_url.*\.deb" | cut -d '"' -f 4 | head -1)
305-
if [ -n "$LATEST_URL" ]; then
306-
wget -O /tmp/ghostty.deb "$LATEST_URL"
307-
sudo apt install -y /tmp/ghostty.deb
308-
rm /tmp/ghostty.deb
309-
print_success "ghostty installed via community package"
310-
else
311-
print_error "Could not find ghostty package for Ubuntu/Debian"
312-
fi
313-
;;
314-
fedora|rhel|centos|rocky|almalinux)
315-
print_status "Installing ghostty via COPR..."
316-
if command_exists dnf; then
317-
sudo dnf copr enable -y scottames/ghostty
318-
sudo dnf install -y ghostty
319-
else
320-
print_warning "COPR not easily available on this system"
321-
print_status "Please visit: https://copr.fedorainfracloud.org/coprs/scottames/ghostty/"
322-
fi
323-
print_success "ghostty installed via COPR"
324-
;;
325-
*)
326-
print_warning "No automatic installation available for your distribution"
327-
print_status "Please visit: https://ghostty.org/docs/install/binary"
328-
print_status "Or try the universal AppImage from: https://github.com/ghostty-org/ghostty-appimage"
329-
;;
330-
esac
331-
else
332-
print_warning "Skipping ghostty installation"
333-
fi
334-
else
335-
print_success "ghostty is already installed"
336-
fi
337-
}
338-
339234
# Function to install Go (if needed for crush)
340235
install_go() {
341236
if ! command_exists go && ! command_exists crush; then
@@ -396,12 +291,9 @@ main() {
396291
echo
397292

398293
# Install core dependencies
399-
install_git
400-
echo
401-
402294
install_python
403295
echo
404-
296+
405297
install_uv
406298
echo
407299

@@ -412,23 +304,15 @@ main() {
412304
install_crush
413305
echo
414306

415-
# Install optional dependencies
416-
install_ghostty
417-
echo
418-
419307
print_success "All prerequisites have been installed successfully!"
420308
echo
421309
print_status "You may need to restart your terminal or run:"
422310
print_status "source ~/.bashrc # or ~/.zshrc if using zsh"
423311
echo
424312
print_status "To verify installations, run:"
425-
print_status "git --version"
426313
print_status "python3 --version"
427314
print_status "uv --version"
428315
print_status "crush --version"
429-
if command_exists ghostty; then
430-
print_status "ghostty --version"
431-
fi
432316
}
433317

434318
# Check if running as root

0 commit comments

Comments
 (0)