feat: add startup launch support (#1421)
Add launch-at-startup support across the Electron desktop app and the web CLI. Electron now supports macOS launch-at-login through the native login item API. Login launches start OpenChamber in the background without opening a window, while Dock activation, deep links, and second-instance launches still open or focus the normal app window. The desktop Settings UI now exposes a localized launch-at-login toggle in Desktop Network Access. The web CLI now includes `openchamber startup status|enable|disable`, backed by native user services: - macOS: launchd LaunchAgent - Linux: systemd --user service - Windows: Task Scheduler Startup services run `openchamber serve --foreground` so the OS service manager owns process lifetime and restarts. Foreground service updates now defer restarts to the service manager instead of spawning duplicate CLI restarts. Startup services snapshot useful environment variables by default so provider tokens, PATH, SSH agent settings, and OpenCode configuration survive login/reboot starts. The snapshot avoids shell/session-only state, uses systemd-compatible env quoting on Linux, and avoids unused env artifacts on macOS. Also adds localized docs for startup services and environment variables.
This commit is contained in:
committed by
GitHub
parent
e97bf0d9dc
commit
2014303bc0
@@ -44,6 +44,33 @@ openchamber stop
|
||||
|
||||
`openchamber` sozinho inicia o servidor em segundo plano. Adicione `--foreground` para mantê-lo anexado ao seu terminal.
|
||||
|
||||
## Iniciar o OpenChamber no login
|
||||
|
||||
Use `startup enable` para instalar um serviço nativo do usuário. O OpenChamber usa `launchd` no macOS, `systemd --user` no Linux e Task Scheduler no Windows.
|
||||
|
||||
```bash
|
||||
openchamber startup enable
|
||||
openchamber startup status
|
||||
openchamber startup disable
|
||||
```
|
||||
|
||||
Para proteger a UI, defina a senha ao habilitar o serviço:
|
||||
|
||||
```bash
|
||||
OPENCHAMBER_UI_PASSWORD='secret' openchamber startup enable
|
||||
```
|
||||
|
||||
`startup enable` salva um snapshot do ambiente atual no serviço para que a inicialização se pareça mais com executar `openchamber` na mesma shell. Isso preserva tokens de provedores, `PATH`, configurações do agente SSH e outras variáveis CLI de auth/config. Use `--no-env-snapshot` se quiser um ambiente de serviço mínimo.
|
||||
|
||||
Você ainda pode gerenciar túneis de forma independente para esse serviço em execução:
|
||||
|
||||
```bash
|
||||
openchamber tunnel start --port 3000
|
||||
openchamber tunnel stop --port 3000
|
||||
```
|
||||
|
||||
Parar o túnel não reinicia o serviço nem o app.
|
||||
|
||||
## "OpenCode is restarting"
|
||||
|
||||
Enquanto o servidor está iniciando ou reiniciando, o OpenChamber mostra um estado "OpenCode is restarting" e pausa as requisições até ele estar pronto. Isso é normal logo após a inicialização ou um reinício. Se nunca sair desse estado, veja [Conexão com o OpenCode](/pt-br/troubleshooting/opencode-connection/).
|
||||
|
||||
Reference in New Issue
Block a user