Skip to content

Commit 37044ff

Browse files
committed
Windows Installer
1 parent 6efa169 commit 37044ff

File tree

2 files changed

+156
-5
lines changed

2 files changed

+156
-5
lines changed

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Local options coming soon using ollama.
2121
- Context awareness that maintains conversation flow
2222

2323
## In Works
24+
2425
- [ ] Using history for more context.
2526
- [x] Using current directory and .git for more knowledge.
2627
- [ ]Using history to predict next questions and help.
@@ -31,11 +32,11 @@ Local options coming soon using ollama.
3132
## Prerequisites
3233

3334
- Rust and Cargo (latest stable version)
34-
- A Google Gemini API key (obtain from https://aistudio.google.com/app/apikey)
35+
- A Google Gemini API key (obtain from <https://aistudio.google.com/app/apikey>)
3536

3637
## Installation
3738

38-
### For Debian/Ubuntu-based systems:
39+
### For Debian/Ubuntu-based systems
3940

4041
You can install Yappus directly from our APT repository:
4142

@@ -48,13 +49,27 @@ chmod +x install-yappus.sh
4849
# runnn
4950
./install-yappus.sh
5051
```
51-
### For Arch Linux:
52+
53+
### For Arch Linux
5254

5355
Install from the AUR:
56+
5457
```sh
5558
yay -S yappus
5659
```
5760

61+
### For Windows
62+
63+
You can install Yappus directly using our PowerShell script:
64+
65+
```powershell
66+
# install script
67+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/MostlyKIGuess/Yappus-Term/main/install-yappus.ps1 -OutFile install-yappus.ps1
68+
69+
# (may need to run PowerShell as Administrator for system-wide installation)
70+
powershell -ExecutionPolicy Bypass -File install-yappus.ps1
71+
```
72+
5873
Or manually using the PKGBUILD:
5974

6075
```sh
@@ -66,6 +81,7 @@ makepkg -si
6681
## Setup
6782

6883
1. Clone the repository:
84+
6985
```bash
7086
git clone https://github.com/MostlyKIGuess/Yappus-Term.git
7187
cd yappus-term
@@ -114,10 +130,12 @@ yappus
114130
## Configuration
115131

116132
Yappus stores its configuration and history files in:
133+
117134
- Linux/macOS: `~/.config/yappus-term/`
118135
- Windows: `%APPDATA%\yappus\yappus-term\config\`
119136

120137
The following files are created:
138+
121139
- `api_key` - Stores your Gemini API key
122140
- `config.json` - Stores your preferred model configuration
123141
- `chat_history.json` - Stores your chat history
@@ -168,7 +186,7 @@ Start interactive mode by running `yappus` without arguments:
168186
- The AI will respond with its message
169187
- Type `exit` to quit the application
170188

171-
#### Available Interactive Commands:
189+
#### Available Interactive Commands
172190

173191
- `/help` - Show help message with available commands
174192
- `/model [name]` - View or change the Gemini model
@@ -189,12 +207,14 @@ Start interactive mode by running `yappus` without arguments:
189207
#### Advanced Features
190208

191209
**Command Piping**: Combine shell commands with AI queries
210+
192211
```bash
193212
> /ls | what programming languages are used in this project?
194213
> /pwd | what should I do in this directory?
195214
```
196215

197-
**File Context Analysis**:
216+
**File Context Analysis**:
217+
198218
```bash
199219
> /file package.json
200220
> What dependencies does this project use?
@@ -210,12 +230,14 @@ Start interactive mode by running `yappus` without arguments:
210230
- `GEMINI_1_5_FLASH` - Fast and efficient
211231

212232
Switch models anytime:
233+
213234
```bash
214235
yappus model GEMINI_2_5_PRO # CLI
215236
/model GEMINI_2_5_PRO # Interactive
216237
```
217238

218239
### APT Building
240+
219241
```sh
220242
docker run --rm -v $(pwd):/build -w /build debian:bookworm bash -c "apt-get update && apt-get install -y build-essential debhelper curl pkg-config libssl-dev && curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && export PATH=\$HOME/.cargo/bin:\$PATH && dpkg-buildpackage -us -uc -b -d && cp -v /*.deb /build/"
221243
```

install-yappus.ps1

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#Requires -Version 5.0
2+
3+
# Yappus Terminal Windows Installer
4+
# This script installs Yappus Terminal on Windows systems
5+
6+
Write-Host "Yappus Terminal Windows Installer" -ForegroundColor Cyan
7+
Write-Host "=================================" -ForegroundColor Cyan
8+
9+
# admin check
10+
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
11+
12+
$appDir = "$env:USERPROFILE\Yappus-Term"
13+
$configDir = "$env:APPDATA\yappus\yappus-term\config"
14+
15+
# rust installation
16+
function Test-RustInstalled {
17+
try {
18+
$rustVersion = (rustc --version)
19+
$cargoVersion = (cargo --version)
20+
return $true
21+
}
22+
catch {
23+
return $false
24+
}
25+
}
26+
27+
# rust install
28+
if (-not (Test-RustInstalled)) {
29+
Write-Host "Rust is not installed. Installing Rust..." -ForegroundColor Yellow
30+
31+
try {
32+
# Download rustup-init
33+
$rustupInitPath = "$env:TEMP\rustup-init.exe"
34+
Invoke-WebRequest -Uri "https://win.rustup.rs/x86_64" -OutFile $rustupInitPath
35+
36+
# Run rustup-init
37+
& $rustupInitPath -y --default-toolchain stable
38+
39+
# Update PATH for current session
40+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "User") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "Machine")
41+
42+
Write-Host "Rust installed successfully!" -ForegroundColor Green
43+
}
44+
catch {
45+
Write-Host "Failed to install Rust. Please install it manually from https://rustup.rs/" -ForegroundColor Red
46+
exit 1
47+
}
48+
}
49+
else {
50+
Write-Host "Rust is already installed." -ForegroundColor Green
51+
}
52+
53+
Write-Host "Setting up directories..." -ForegroundColor Cyan
54+
New-Item -ItemType Directory -Path $appDir -Force | Out-Null
55+
New-Item -ItemType Directory -Path $configDir -Force | Out-Null
56+
57+
Write-Host "Cloning Yappus Terminal repository..." -ForegroundColor Cyan
58+
Set-Location $appDir
59+
try {
60+
if (Test-Path "$appDir\.git") {
61+
git pull
62+
}
63+
else {
64+
git clone https://github.com/MostlyKIGuess/Yappus-Term.git .
65+
}
66+
}
67+
catch {
68+
Write-Host "Failed to clone repository. Make sure Git is installed." -ForegroundColor Red
69+
Write-Host "You can install Git from https://git-scm.com/download/win" -ForegroundColor Red
70+
exit 1
71+
}
72+
73+
Write-Host "Building Yappus Terminal..." -ForegroundColor Cyan
74+
try {
75+
cargo build --release
76+
}
77+
catch {
78+
Write-Host "Failed to build Yappus Terminal. Please check the error messages above." -ForegroundColor Red
79+
exit 1
80+
}
81+
82+
$targetPath = "$appDir\target\release\yappus.exe"
83+
$addToPath = $false
84+
85+
if ($isAdmin) {
86+
$addToPath = (Read-Host "Do you want to add Yappus to your system PATH? (y/N)").ToLower() -eq 'y'
87+
88+
if ($addToPath) {
89+
$pathEnv = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
90+
if ($pathEnv -notlike "*$appDir\target\release*") {
91+
[System.Environment]::SetEnvironmentVariable("Path", "$pathEnv;$appDir\target\release", "Machine")
92+
Write-Host "Added Yappus to system PATH." -ForegroundColor Green
93+
}
94+
}
95+
}
96+
elseif ((Read-Host "Do you want to add Yappus to your user PATH? (y/N)").ToLower() -eq 'y') {
97+
$pathEnv = [System.Environment]::GetEnvironmentVariable("Path", "User")
98+
if ($pathEnv -notlike "*$appDir\target\release*") {
99+
[System.Environment]::SetEnvironmentVariable("Path", "$pathEnv;$appDir\target\release", "User")
100+
Write-Host "Added Yappus to user PATH." -ForegroundColor Green
101+
}
102+
}
103+
104+
$createShortcut = (Read-Host "Do you want to create a desktop shortcut? (y/N)").ToLower() -eq 'y'
105+
if ($createShortcut) {
106+
$desktopPath = [System.Environment]::GetFolderPath('Desktop')
107+
$shortcutPath = Join-Path -Path $desktopPath -ChildPath "Yappus Terminal.lnk"
108+
109+
$WScriptShell = New-Object -ComObject WScript.Shell
110+
$shortcut = $WScriptShell.CreateShortcut($shortcutPath)
111+
$shortcut.TargetPath = $targetPath
112+
$shortcut.WorkingDirectory = Split-Path -Parent $targetPath
113+
$shortcut.Description = "Yappus Terminal AI Assistant"
114+
$shortcut.Save()
115+
116+
Write-Host "Desktop shortcut created." -ForegroundColor Green
117+
}
118+
119+
Write-Host "`nYappus Terminal has been successfully installed!" -ForegroundColor Green
120+
Write-Host "`nTo run Yappus Terminal:" -ForegroundColor Cyan
121+
Write-Host " - From any terminal: yappus" -ForegroundColor White
122+
Write-Host " - Or run directly: $targetPath" -ForegroundColor White
123+
Write-Host "`nOn first run, you will be prompted to enter your Google Gemini API key." -ForegroundColor Yellow
124+
Write-Host "You can get your API key from: https://aistudio.google.com/app/apikey" -ForegroundColor Yellow
125+
126+
if ((Read-Host "`nDo you want to run Yappus Terminal now? (y/N)").ToLower() -eq 'y') {
127+
Set-Location $env:USERPROFILE
128+
& $targetPath
129+
}

0 commit comments

Comments
 (0)