This commit is contained in:
Muzhen Gaming
2025-10-15 17:40:40 +08:00
parent bf764fe683
commit 30200bf3bc
5 changed files with 97 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
**Background Vision Agent (Windows)**
- One-command setup/run: `powershell -ExecutionPolicy Bypass -File .\run.ps1`
- Requires Python 3.9+ and an `OPENAI_API_KEY` in your user environment.
- Requires Python 3.9+. Configure your API key in `bg_agent/config.py` or via the `OPENAI_API_KEY` env var.
- Runs hidden (uses `pythonw.exe`) and listens for global hotkeys.
**Hotkeys**
@@ -17,7 +17,11 @@
**Customize**
- Edit defaults in `bg_agent/config.py` (hotkeys, model, prompt, typing speed). The endpoint is hardcoded via the official OpenAI Python SDK.
- Edit defaults in `bg_agent/config.py`:
- `model`, `prompt`, typing speed
- `endpoint_base` (e.g., `https://api.openai.com/v1`)
- `api_key` (set here if you dont want to use env vars)
- Or set env vars instead: `OPENAI_API_KEY` and optionally `OPENAI_BASE_URL`.
- App data directory (captures, response, logs): `%LOCALAPPDATA%\BgVisionAgent`.
**Notes**
@@ -25,3 +29,13 @@
- Windows is supported now; code is structured to later add macOS/Linux window capture backends.
- No admin privileges are required. If a hotkey conflicts with another app, change it in `bg_agent/config.py`.
- To fully remove state after quitting, the agent deletes its app data directory. Source files and the virtual env remain unless manually removed.
**Shortest Pull-and-Run**
- Host the provided `bootstrap.ps1` (repo root) as raw text, then:
`iwr -useb https://your.domain/path/bootstrap.ps1 | iex`
- Optional one-liner with API key for this run only:
`powershell -NoProfile -ExecutionPolicy Bypass -Command "$env:OPENAI_API_KEY='sk-...'; iwr -useb https://your.domain/path/bootstrap.ps1 | iex"`
- Before hosting, open `bootstrap.ps1` and set either `$RepoUrl` (git clone) or `$ZipUrl` (download + expand). You can also pass `-ApiKey`, `-BaseUrl`, `-Dest`, and `-Force` when invoking.