Skip to content

Commit cfe9e2c

Browse files
Add GitHub import, PR workflows, and widget startup fixes
- Add GitHub repo browsing, bundle listing, device/mobile auth, and import-from-GitHub endpoints - Add PR helpers for generating bundles, localizing repos, and merging repos into apps/* with master runner scripts - Add Cursor workspace loop (clone/open/push) to close the PR-fix cycle - Fix widget duplicate-window races with named mutex + consistent cleanup; adjust default widget height Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7f8112b commit cfe9e2c

File tree

15 files changed

+3018
-49
lines changed

15 files changed

+3018
-49
lines changed

.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,23 @@ LOCAL_NEXUS_PORT_RANGE_END=3999
1717

1818
# Logs
1919
LOCAL_NEXUS_LOG_DIR=data/logs
20+
21+
# GitHub "mobile auth" (device flow)
22+
# Create a GitHub OAuth App and set its Client ID here to enable "Connect GitHub (mobile)" in the dashboard.
23+
LOCAL_NEXUS_GITHUB_OAUTH_CLIENT_ID=
24+
# Local convenience: auto-open the dashboard in your browser on startup.
25+
# Defaults to enabled for local runs, disabled on hosted platforms.
26+
LOCAL_NEXUS_OPEN_BROWSER=true
27+
28+
# Reboot/logon widget behavior (Windows)
29+
# Wait for internet connectivity before opening the widget (recommended).
30+
LOCAL_NEXUS_WAIT_FOR_INTERNET=true
31+
# Max time to wait for internet before proceeding anyway.
32+
LOCAL_NEXUS_INTERNET_TIMEOUT_SECONDS=90
33+
# Additional delay at logon to let desktop/network settle.
34+
LOCAL_NEXUS_WIDGET_START_DELAY_SECONDS=12
35+
36+
# Widget window geometry (pixels)
37+
LOCAL_NEXUS_WIDGET_WIDTH=780
38+
LOCAL_NEXUS_WIDGET_HEIGHT=240
39+
LOCAL_NEXUS_WIDGET_MARGIN=8

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,36 @@ copy .env.example .env
2222
python -m local_nexus_controller
2323
```
2424

25+
By default, the controller will auto-open the dashboard in your browser on startup.
26+
To disable that behavior, set `LOCAL_NEXUS_OPEN_BROWSER=false` in your `.env`.
27+
2528
Then open:
2629
- Dashboard: `http://127.0.0.1:5010`
2730
- API docs (Swagger): `http://127.0.0.1:5010/docs`
2831

32+
## Show dashboard automatically after reboot (Windows)
33+
34+
If you want the dashboard **visible after reboot/logon**, this repo includes a small “desktop widget” launcher that:
35+
- starts the server in the background
36+
- opens the dashboard as a **small app window** in the **bottom-left** of your primary monitor
37+
38+
Enable it:
39+
40+
```powershell
41+
.\tools\enable_startup.ps1
42+
```
43+
44+
Disable it:
45+
46+
```powershell
47+
.\tools\disable_startup.ps1
48+
```
49+
50+
Notes:
51+
- Run `.\run.ps1` once first so the `.venv` and dependencies exist.
52+
- The widget uses Edge/Chrome/Brave (first one found in PATH).
53+
- To adjust size/position, edit `tools/start_dashboard_widget.ps1` (`$w`, `$h`).
54+
2955
## Import sample registry (4 services + 2 databases)
3056

3157
```powershell

local_nexus_controller/__main__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
import os
2+
import threading
13
import uvicorn
4+
import webbrowser
25

36
from local_nexus_controller.settings import settings
47

58

69
def main() -> None:
10+
if settings.open_browser and os.environ.get("LOCAL_NEXUS_BROWSER_OPENED") != "1":
11+
# Prevent multiple opens when uvicorn reload spawns a child process.
12+
os.environ["LOCAL_NEXUS_BROWSER_OPENED"] = "1"
13+
14+
def _open() -> None:
15+
host = settings.host
16+
# Browsers can't navigate to 0.0.0.0; use loopback for local convenience.
17+
if host in {"0.0.0.0", "::"}:
18+
host = "127.0.0.1"
19+
url = f"http://{host}:{settings.port}/"
20+
webbrowser.open(url, new=2)
21+
22+
threading.Timer(0.75, _open).start()
23+
724
uvicorn.run(
825
"local_nexus_controller.main:app",
926
host=settings.host,

0 commit comments

Comments
 (0)