Skip to content

Commit 27df9b0

Browse files
author
avadakedavra-wp
committed
Initial commit: Complete fazrepo CLI tool with cross-platform support
- Core CLI functionality with clap argument parsing - Package manager version checking (npm, yarn, pnpm, bun) - Cross-platform support (Linux, macOS, Windows) - Installation scripts for all platforms - GitHub Actions CI/CD for automated releases - Homebrew formula for macOS/Linux distribution - Comprehensive documentation and testing - Windows-specific optimizations and guides
1 parent d6d7d3c commit 27df9b0

File tree

12 files changed

+766
-66
lines changed

12 files changed

+766
-66
lines changed

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
- os: macos-latest
2929
target: aarch64-apple-darwin
3030
binary_extension: ""
31+
- os: windows-latest
32+
target: x86_64-pc-windows-msvc
33+
binary_extension: ".exe"
34+
- os: windows-latest
35+
target: aarch64-pc-windows-msvc
36+
binary_extension: ".exe"
3137

3238
steps:
3339
- uses: actions/checkout@v4

β€ŽCargo.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ categories = ["command-line-utilities"]
1212

1313
[[bin]]
1414
name = "fazrepo"
15-
path = "src/master.rs"
15+
path = "src/main.rs"
1616

1717
[dependencies]
1818
clap = { version = "4.0", features = ["derive"] }

β€ŽMakefileβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ release:
3737
cargo build --release --target x86_64-apple-darwin
3838
# macOS aarch64
3939
cargo build --release --target aarch64-apple-darwin
40+
# Windows x86_64
41+
cargo build --release --target x86_64-pc-windows-msvc
42+
# Windows aarch64
43+
cargo build --release --target aarch64-pc-windows-msvc
4044
@echo "Release builds completed!"
4145
@echo "Binaries are in target/<target>/release/"
4246

@@ -46,3 +50,5 @@ add-targets:
4650
rustup target add aarch64-unknown-linux-gnu
4751
rustup target add x86_64-apple-darwin
4852
rustup target add aarch64-apple-darwin
53+
rustup target add x86_64-pc-windows-msvc
54+
rustup target add aarch64-pc-windows-msvc

β€ŽREADME.mdβ€Ž

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ A fast CLI tool to check package manager versions on your system.
77
- πŸš€ Check versions of npm, yarn, pnpm, and bun
88
- 🎨 Beautiful colored output
99
- ⚑ Fast and lightweight
10-
- πŸ”§ Easy installation via Homebrew or curl
10+
- πŸ”§ Easy installation via Homebrew, curl, or PowerShell
11+
- 🌍 Cross-platform support (Linux, macOS, Windows)
1112

1213
## Installation
1314

14-
### Quick Start (Development Install)
15+
### Windows (PowerShell)
16+
17+
```powershell
18+
# Install via PowerShell (recommended for Windows)
19+
irm https://raw.githubusercontent.com/avadakedavra-wp/fazrepo/main/install.ps1 | iex
20+
```
21+
22+
### Quick Start (Development Install - All Platforms)
1523

1624
```bash
1725
# Install from source (works immediately)
18-
curl -fsSL https://raw.githubusercontent.com/avadakedavra-wp/fazrepo/master/install-dev.sh | bash
26+
curl -fsSL https://raw.githubusercontent.com/avadakedavra-wp/fazrepo/main/install-dev.sh | bash
1927
```
2028

2129
### Homebrew (macOS/Linux) - Coming Soon
@@ -50,6 +58,19 @@ fazrepo
5058
fazrepo check
5159
```
5260

61+
### Advanced options
62+
63+
```bash
64+
# Check specific package managers only
65+
fazrepo check --only npm,bun
66+
67+
# Show detailed information with full paths
68+
fazrepo check --detailed
69+
70+
# List all supported package managers
71+
fazrepo list
72+
```
73+
5374
### Initialize fazrepo in current directory
5475

5576
```bash
@@ -64,6 +85,15 @@ fazrepo version
6485
fazrepo --version
6586
```
6687

88+
### Windows-specific usage
89+
90+
```powershell
91+
# PowerShell examples
92+
fazrepo check
93+
fazrepo check --only npm,pnpm
94+
fazrepo list
95+
```
96+
6797
## Sample Output
6898

6999
```
@@ -77,10 +107,20 @@ fazrepo --version
77107

78108
## Package Managers Supported
79109

80-
- **npm** - Node Package Manager
81-
- **yarn** - Yet Another Resource Negotiator
82-
- **pnpm** - Performant npm
83-
- **bun** - Bun JavaScript runtime and package manager
110+
fazrepo automatically detects package managers across all platforms:
111+
112+
- **npm** - Node Package Manager (detects `npm`, `npm.cmd` on Windows)
113+
- **yarn** - Yet Another Resource Negotiator (detects `yarn`, `yarn.cmd` on Windows)
114+
- **pnpm** - Performant npm (detects `pnpm`, `pnpm.cmd` on Windows)
115+
- **bun** - Bun JavaScript runtime and package manager (detects `bun`, `bun.exe` on Windows)
116+
117+
### Platform Support
118+
119+
- βœ… **Linux** (x86_64, ARM64)
120+
- βœ… **macOS** (Intel, Apple Silicon)
121+
- βœ… **Windows** (x86_64, ARM64)
122+
123+
For Windows-specific installation and usage instructions, see [WINDOWS.md](WINDOWS.md).
84124

85125
## Contributing
86126

β€ŽWINDOWS.mdβ€Ž

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
# πŸͺŸ Windows Installation Guide for fazrepo
2+
3+
This guide covers all the ways to install and use fazrepo on Windows.
4+
5+
## πŸš€ Installation Methods
6+
7+
### Method 1: PowerShell (Recommended)
8+
9+
Open PowerShell and run:
10+
11+
```powershell
12+
irm https://raw.githubusercontent.com/avadakedavra-wp/fazrepo/main/install.ps1 | iex
13+
```
14+
15+
This will:
16+
- βœ… Download the latest Windows binary
17+
- βœ… Install to `%USERPROFILE%\bin`
18+
- βœ… Add to your PATH automatically
19+
- βœ… Verify the installation
20+
21+
### Method 2: Git Bash / WSL
22+
23+
If you're using Git Bash or Windows Subsystem for Linux:
24+
25+
```bash
26+
curl -fsSL https://raw.githubusercontent.com/avadakedavra-wp/fazrepo/main/install.sh | bash
27+
```
28+
29+
### Method 3: Manual Download
30+
31+
1. Go to [Releases](https://github.com/avadakedavra-wp/fazrepo/releases)
32+
2. Download `fazrepo-x86_64-pc-windows-msvc.exe`
33+
3. Rename to `fazrepo.exe`
34+
4. Place in a directory in your PATH
35+
36+
### Method 4: From Source
37+
38+
```bash
39+
# Install Rust first: https://rustup.rs/
40+
git clone https://github.com/avadakedavra-wp/fazrepo.git
41+
cd fazrepo
42+
cargo build --release
43+
copy target\release\fazrepo.exe C:\Users\%USERNAME%\bin\
44+
```
45+
46+
## πŸ”§ Package Manager Support on Windows
47+
48+
fazrepo automatically detects Windows-specific command variations:
49+
50+
### Supported Package Managers
51+
52+
| Package Manager | Windows Command | Detection |
53+
|----------------|----------------|-----------|
54+
| **npm** | `npm.cmd` | βœ… Automatic |
55+
| **yarn** | `yarn.cmd` | βœ… Automatic |
56+
| **pnpm** | `pnpm.cmd` | βœ… Automatic |
57+
| **bun** | `bun.exe` | βœ… Automatic |
58+
59+
### Command Examples
60+
61+
```powershell
62+
# Check all package managers
63+
fazrepo
64+
65+
# Check specific managers
66+
fazrepo check --only npm,bun
67+
68+
# Detailed output with paths
69+
fazrepo check --detailed
70+
71+
# List supported managers
72+
fazrepo list
73+
```
74+
75+
## πŸ› οΈ Troubleshooting
76+
77+
### "fazrepo is not recognized as an internal or external command"
78+
79+
**Solution 1: Restart your terminal**
80+
After installation, restart PowerShell/CMD to refresh the PATH.
81+
82+
**Solution 2: Add to PATH manually**
83+
```powershell
84+
$env:PATH += ";$env:USERPROFILE\bin"
85+
```
86+
87+
**Solution 3: Use full path**
88+
```powershell
89+
& "$env:USERPROFILE\bin\fazrepo.exe" check
90+
```
91+
92+
### Permission Issues
93+
94+
If you get permission errors:
95+
96+
```powershell
97+
# Run PowerShell as Administrator, then:
98+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
99+
```
100+
101+
### Antivirus False Positives
102+
103+
Some antivirus software may flag the binary. This is common with new executables. You can:
104+
1. Add an exception for fazrepo.exe
105+
2. Install from source instead
106+
3. Check the file hash against releases
107+
108+
### Package Managers Not Detected
109+
110+
**Common causes:**
111+
- Package manager not in PATH
112+
- Using PowerShell ISE (use regular PowerShell)
113+
- Package manager installed via installer that doesn't add to PATH
114+
115+
**Solutions:**
116+
```powershell
117+
# Check your PATH
118+
$env:PATH -split ';'
119+
120+
# Find npm location
121+
where.exe npm
122+
123+
# Add Node.js to PATH if needed
124+
$env:PATH += ";C:\Program Files\nodejs"
125+
```
126+
127+
## 🎯 Windows-Specific Features
128+
129+
### Command Extensions
130+
131+
fazrepo automatically tries multiple command variants:
132+
- `npm.cmd` (primary)
133+
- `npm.exe` (fallback)
134+
- `npm` (final fallback)
135+
136+
### Path Handling
137+
138+
- Uses Windows path separators automatically
139+
- Supports both forward and backward slashes
140+
- Handles spaces in paths correctly
141+
142+
### Environment Variables
143+
144+
Works with Windows environment variables:
145+
- `%USERPROFILE%` for user directory
146+
- `%PATH%` for executable search
147+
- `%TEMP%` for temporary files
148+
149+
## πŸ“¦ Development on Windows
150+
151+
### Building from Source
152+
153+
```powershell
154+
# Install Rust
155+
winget install --id Rust.Rustup
156+
157+
# Clone and build
158+
git clone https://github.com/avadakedavra-wp/fazrepo.git
159+
cd fazrepo
160+
cargo build --release
161+
```
162+
163+
### Cross-compilation
164+
165+
```powershell
166+
# Add Windows targets
167+
rustup target add x86_64-pc-windows-msvc
168+
rustup target add aarch64-pc-windows-msvc
169+
170+
# Build for Windows
171+
cargo build --release --target x86_64-pc-windows-msvc
172+
```
173+
174+
### Testing
175+
176+
```powershell
177+
# Run tests
178+
cargo test
179+
180+
# Test Windows-specific functionality
181+
.\scripts\test-release.sh # In Git Bash
182+
```
183+
184+
## πŸ”— Integration
185+
186+
### PowerShell Profile
187+
188+
Add fazrepo to your PowerShell profile:
189+
190+
```powershell
191+
# Edit profile
192+
notepad $PROFILE
193+
194+
# Add these lines:
195+
function Check-PackageManagers { fazrepo check }
196+
Set-Alias -Name pm -Value Check-PackageManagers
197+
```
198+
199+
### Batch Scripts
200+
201+
Create a batch file for convenience:
202+
203+
```batch
204+
@echo off
205+
fazrepo %*
206+
```
207+
208+
### Chocolatey (Future)
209+
210+
We're working on Chocolatey package support:
211+
212+
```powershell
213+
# Coming soon:
214+
choco install fazrepo
215+
```
216+
217+
## πŸ“‹ Windows Requirements
218+
219+
- **OS**: Windows 10 or later
220+
- **Architecture**: x64 (ARM64 support available)
221+
- **Dependencies**: None (statically linked)
222+
- **Permissions**: User-level (no admin required)
223+
224+
## πŸŽ‰ Success Verification
225+
226+
After installation, verify everything works:
227+
228+
```powershell
229+
# Check version
230+
fazrepo --version
231+
232+
# Test functionality
233+
fazrepo check
234+
235+
# Expected output:
236+
# πŸ” Checking package manager versions...
237+
#
238+
# βœ… npm 10.9.0 (C:\Program Files\nodejs\npm.cmd)
239+
# ❌ yarn not installed
240+
# βœ… pnpm 9.13.2 (C:\Users\...\AppData\Roaming\npm\pnpm.cmd)
241+
# βœ… bun 1.1.38 (C:\Users\...\.bun\bin\bun.exe)
242+
```
243+
244+
## πŸ’‘ Tips for Windows Users
245+
246+
1. **Use PowerShell** instead of Command Prompt for better experience
247+
2. **Install Windows Terminal** for better console experience
248+
3. **Enable Developer Mode** for symlink support
249+
4. **Use winget** for installing development tools
250+
5. **Consider WSL2** for Linux-like development experience
251+
252+
Your fazrepo CLI is now ready for Windows! 🎯

β€ŽWINDOWS_DEV.mdβ€Ž

Whitespace-only changes.

β€ŽWINDOWS_IMPLEMENTATION.mdβ€Ž

Whitespace-only changes.

0 commit comments

Comments
Β (0)