-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add autorun & sync scripts #7242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| Install and autorun for text-generation-webui (Windows) | ||
|
|
||
| This folder contains helper scripts to install the web UI as an autorun service on your Windows user account. | ||
|
|
||
| Files: | ||
| - `start_webui_minimized.ps1` — PowerShell script that launches the web UI server using the venv Python; starts minimized. | ||
| - `install_autostart.bat` — Creates a shortcut in your Windows Startup folder to run the PowerShell script at login. | ||
|
|
||
| How to install (one-time): | ||
| 1. Double-click `install_autostart.bat` and allow it to run. This will create a shortcut named `TextGenWebUI.lnk` in your Startup folder. | ||
| 2. The next time you log into Windows, the web UI will start automatically minimized using the project's venv. | ||
|
|
||
| Start now (manual): | ||
| - To start immediately without waiting for login, run the PowerShell script manually (right-click and select "Run with PowerShell") or run: | ||
| powershell -NoProfile -ExecutionPolicy Bypass -File "start_webui_minimized.ps1" | ||
|
|
||
| Stop/remove autorun: | ||
| - Delete `TextGenWebUI.lnk` from your Startup folder. You can open the Startup folder with: | ||
| explorer.exe shell:startup | ||
|
|
||
| Notes & troubleshooting: | ||
| - The scripts assume the project is at `D:\AI_ML_Development\text-generation-webui` and the venv exists at `venv` inside the project. If you move the project, edit `start_webui_minimized.ps1`. | ||
| - Ensure your PowerShell ExecutionPolicy allows running scripts. `install_autostart.bat` sets `-ExecutionPolicy Bypass` when launching the script. | ||
| - Logs: by default the script starts the server without redirecting output. To capture logs, edit `start_webui_minimized.ps1` and use the `-RedirectStandardOutput` / `-RedirectStandardError` options (commented in file). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Clone or update all repositories for MerwelLabs into the specified destination | ||
| $dest = 'D:\OneDrive_Merwel\OneDrive\Github' | ||
| $gh = 'C:\Program Files\GitHub CLI\gh.exe' | ||
|
|
||
| if (!(Test-Path $gh)) { | ||
| Write-Error "gh not found at $gh. Ensure GitHub CLI is installed and on PATH." | ||
| exit 1 | ||
| } | ||
|
|
||
| New-Item -ItemType Directory -Path $dest -Force | Out-Null | ||
|
|
||
| Write-Output "Listing repositories for MerwelLabs..." | ||
| $reposJson = & $gh repo list MerwelLabs --limit 1000 --json name,sshUrl,visibility | ||
| if (-not $reposJson) { | ||
| Write-Output "No repos found or gh returned nothing." | ||
| exit 0 | ||
| } | ||
|
|
||
| $repos = $reposJson | ConvertFrom-Json | ||
|
|
||
| foreach ($r in $repos) { | ||
| $dir = Join-Path $dest $r.name | ||
| if (Test-Path $dir) { | ||
| Write-Output "Updating $($r.name)..." | ||
| try { | ||
| git -C $dir pull --rebase | ||
| } catch { | ||
| Write-Warning "Failed to pull $($r.name): $_" | ||
| } | ||
| } else { | ||
| Write-Output "Cloning $($r.name)..." | ||
| try { | ||
| git clone $r.sshUrl $dir | ||
| } catch { | ||
| Write-Warning "Failed to clone $($r.name): $_" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Write-Output "Done. Repositories are in: $dest" | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||
| @echo off | ||||||
| REM Creates a shortcut in the current user's Startup folder to run the web UI minimized at login. | ||||||
| set SCRIPT_PATH=%~dp0start_webui_minimized.ps1 | ||||||
| necho Creating startup shortcut... | ||||||
|
||||||
| necho Creating startup shortcut... | |
| echo Creating startup shortcut... |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||
| # Start text-generation-webui in the project's venv, minimized. | ||||||||||||||||||||
| # Created by automation. To edit, update this file in the project folder. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| $ProjectPath = 'D:\AI_ML_Development\text-generation-webui' | ||||||||||||||||||||
|
||||||||||||||||||||
| $ProjectPath = 'D:\AI_ML_Development\text-generation-webui' | |
| # Allow project path to be set via environment variable or command-line argument. | |
| if ($env:TEXTGEN_PROJECT_PATH) { | |
| $ProjectPath = $env:TEXTGEN_PROJECT_PATH | |
| } elseif ($args.Count -ge 1) { | |
| $ProjectPath = $args[0] | |
| } else { | |
| $ProjectPath = 'D:\AI_ML_Development\text-generation-webui' | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||||
| <# | ||||||||
| PowerShell script to sync MerwelLabs GitHub repositories into the OneDrive folder. | ||||||||
| Writes logs to D:\OneDrive_Merwel\OneDrive\Github\sync_logs and keeps the last 30 logs. | ||||||||
| #> | ||||||||
|
|
||||||||
| $dest = 'D:\OneDrive_Merwel\OneDrive\Github' | ||||||||
| $gh = 'C:\Program Files\GitHub CLI\gh.exe' | ||||||||
|
||||||||
| $gh = 'C:\Program Files\GitHub CLI\gh.exe' | |
| # Allow override of GitHub CLI path via environment variable GH_PATH | |
| $gh = if ($env:GH_PATH) { $env:GH_PATH } else { 'C:\Program Files\GitHub CLI\gh.exe' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded paths are duplicated across scripts. Consider centralizing these configuration values in a shared configuration file or variables to avoid maintenance issues.