Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Qwen Cloud, SiliconFlow, and more. Full list: `ocx init` or the
ocx init # interactive setup (writes config, wires Codex, offers the shim)
ocx start [--port 10100] # start the proxy in the foreground
ocx stop # stop + restore native Codex
ocx service [install|start|stop|status|uninstall|remove] # background service
ocx service [install|repair|restart|start|stop|status|uninstall|remove] # background service
ocx codex-shim install # start the proxy on demand whenever `codex` launches
ocx health [--json] # check immediate proxy liveness
ocx ready [--json] [--wait [--timeout <seconds>]] # check post-sync readiness
Expand Down
6 changes: 4 additions & 2 deletions docs-site/src/content/docs/fr/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,16 @@ Invalide le cache local du sélecteur de modèles de Codex afin qu’il soit rec

## Service d’arrière-plan

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

Exécute opencodex comme service d’arrière-plan géré à l’ouverture de session — **launchd** sous macOS, **unité utilisateur systemd** sous Linux et **Task Scheduler** sous Windows — qui démarre automatiquement à la connexion et redémarre après un plantage. Les services définissent `OCX_SERVICE=1` afin qu’un redémarrage ne réécrive pas inutilement la configuration Codex.

| Sous-commande | Action |
| --- | --- |
| aucune | Crée ou met à jour le service, puis le démarre. |
| aucune | Installe et démarre le service s’il est absent ; sinon, actualise et redémarre le service existant sans le réenregistrer. |
| `install` | Crée et démarre le service. L’enregistrement exige une élévation sous Windows. |
| `repair` | Actualise sur place un service installé et le redémarre, sans le réenregistrer. |
| `restart` | Alias de `repair`. |
| `start` | Démarre un service installé. |
| `stop` | Arrête le service et rétablit le fonctionnement natif de Codex. |
| `status` | Affiche les diagnostics du service et du proxy, ainsi que les chemins des journaux. |
Expand All @@ -165,6 +166,7 @@ Exécute opencodex comme service d’arrière-plan géré à l’ouverture de se
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
6 changes: 4 additions & 2 deletions docs-site/src/content/docs/ja/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,16 @@ Codex のローカル モデル ピッカー キャッシュを無効にし、

## バックグラウンドサービス

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

opencodex を、ログイン時に自動起動し、クラッシュ時に自動再起動するログイン管理バックグラウンド サービス (macOS **launchd**、Linux **systemd ユーザー ユニット**、Windows **タスク スケジューラ**) として実行します。サービスは `OCX_SERVICE=1` を設定して実行されるため、再起動によって Codex 設定が変更されることはありません。

|サブコマンド |アクション |
| --- | --- |
|なし |サービスを作成/更新して開始します。 |
|なし |未インストールなら作成して開始し、既存なら再登録せずに更新して再起動します。 |
| `install` |サービスを作成して開始します。 |
| `repair` | 既存のサービスを再登録せずに更新して再起動します。 |
| `restart` | `repair` の別名です。 |
| `start` |インストールされているサービスを開始します。 |
| `stop` |サービスを停止し、ネイティブ Codex を復元します。 |
| `status` |サービスとプロキシの診断とログ パスをレポートします。 |
Expand All @@ -169,6 +170,7 @@ opencodex を、ログイン時に自動起動し、クラッシュ時に自動
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
6 changes: 4 additions & 2 deletions docs-site/src/content/docs/ko/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,18 @@ Codex의 로컬 모델 선택기 캐시를 무효화하여, 활성 opencodex 카

## 백그라운드 서비스

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

로그인 관리형 백그라운드 서비스로 opencodex를 실행합니다(macOS **launchd**, Linux **systemd** 사용자
유닛, Windows **Task Scheduler**). 로그인 시 자동 시작하고 충돌 시 자동 재시작합니다. 서비스 실행은
`OCX_SERVICE=1`을 설정하므로 재시작해도 Codex 설정이 흔들리지 않습니다.

| 하위 명령 | 동작 |
| --- | --- |
| 없음 | 서비스를 생성/업데이트하고 시작합니다. |
| 없음 | 서비스가 없으면 설치하고 시작하며, 이미 있으면 재등록하지 않고 새로 고쳐 재시작합니다. |
| `install` | 서비스를 생성하고 시작합니다. |
| `repair` | 설치된 서비스를 다시 등록하지 않고 제자리에서 새로 고친 뒤 재시작합니다. |
| `restart` | `repair`의 별칭입니다. |
| `start` | 설치된 서비스를 시작합니다. |
| `stop` | 서비스를 중지하고 기본 Codex를 복원합니다. |
| `status` | 서비스와 프록시 진단, 로그 경로를 보고합니다. |
Expand All @@ -214,6 +215,7 @@ Codex의 로컬 모델 선택기 캐시를 무효화하여, 활성 opencodex 카
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
10 changes: 8 additions & 2 deletions docs-site/src/content/docs/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ same stale-`app-server` warning and optional `--restart-codex` behavior as `ocx

## Background service

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

Run opencodex as a login-managed background service (macOS **launchd**, Linux **systemd user unit**,
Windows **Task Scheduler**) that auto-starts on login and auto-restarts on crash. Service runs set
Expand All @@ -211,19 +211,25 @@ run `ocx service repair` to refresh the task with the restored package paths.

| Subcommand | Action |
| --- | --- |
| none | Create/update and start the service. |
| none | Install and start when absent; otherwise refresh and restart the existing service without re-registering it. |
| `install` | Create and start the service. Registers it, which on Windows needs elevation. |
| `repair` | Refresh an installed service in place and restart it, without re-registering it. |
| `restart` | Alias of `repair`. |
| `start` | Start an installed service. |
| `stop` | Stop the service and restore native Codex. |
| `status` | Report service and proxy diagnostics plus log paths. |
| `uninstall` | Remove the service and restore native Codex. |
| `remove` | Alias of `uninstall`. |

On Windows, a bare `ocx service` runs the install path only after both Task Scheduler and WinSW are
proven absent. If either status query is inconclusive, it refuses to register anything and asks you
to run `ocx service status`; use explicit `ocx service install` only after confirming absence.

```bash
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
6 changes: 4 additions & 2 deletions docs-site/src/content/docs/ru/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ opencodex. Предупреждение о stale-`app-server` и optional `--res

## Фоновая служба

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

Запустить opencodex как login-managed background service (macOS **launchd**, Linux **systemd user
unit**, Windows **Task Scheduler**), которая автоматически стартует при логине и сама
Expand All @@ -218,9 +218,10 @@ unit**, Windows **Task Scheduler**), которая автоматически

| Подкоманда | Действие |
| --- | --- |
| none | Создать/обновить и запустить службу. |
| none | Установить и запустить службу, если её нет; иначе обновить и перезапустить существующую службу без повторной регистрации. |
| `install` | Создать и запустить службу. |
| `repair` | Обновить установленную службу на месте и перезапустить её без повторной регистрации. |
| `restart` | Псевдоним команды `repair`. |
| `start` | Запустить уже установленную службу. |
| `stop` | Остановить службу и восстановить native Codex. |
| `status` | Показать диагностику службы и прокси, а также пути к логам. |
Expand All @@ -231,6 +232,7 @@ unit**, Windows **Task Scheduler**), которая автоматически
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
7 changes: 4 additions & 3 deletions docs-site/src/content/docs/tr/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ ve isteğe bağlı `--restart-codex` davranışı geçerlidir.

## Arka plan servisi

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

opencodex'i oturum açmada otomatik başlayan ve çökmede otomatik yeniden başlayan
oturumla yönetilen bir arka plan servisi (macOS **launchd**, Linux **systemd
Expand All @@ -242,9 +242,10 @@ yapılandırmasını dalgalandırmaz.

| Alt komut | Eylem |
| --- | --- |
| none | Servisi oluşturun/güncelleyin ve başlatın. |
| none | Servis yoksa kurup başlatın; varsa yeniden kaydetmeden yenileyip yeniden başlatın. |
| `install` | Servisi oluşturun ve başlatın. Kaydeder, bu da Windows'ta yükseltme gerektirir. |
| `repair` | Kurulu bir servisi yerinde yenileyin ve yeniden kaydetmeden yeniden başlatın. |
| `restart` | `repair` komutunun takma adıdır. |
| `start` | Kurulu bir servisi başlatın. |
| `stop` | Servisi durdurun ve yerel Codex'i geri yükleyin. |
| `status` | Servis ve proxy tanılamalarını artı günlük yollarını bildirin. |
Expand All @@ -255,6 +256,7 @@ yapılandırmasını dalgalandırmaz.
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down Expand Up @@ -436,4 +438,3 @@ Yeni sürümler, [Sürüm iş
akışı](https://github.com/lidge-jun/opencodex/actions/workflows/release.yml)
bunları npm'de yayınladığında kullanılabilir hale gelir.


6 changes: 4 additions & 2 deletions docs-site/src/content/docs/zh-cn/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,16 @@ ocx status --json

## 后台服务

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

将 opencodex 作为登录管理的后台服务运行(macOS **launchd**、Linux **systemd user unit**、Windows **Task Scheduler**),在登录时自动启动,在崩溃时自动重启。服务运行会设置 `OCX_SERVICE=1`,因此重启时不会反复改动 Codex 配置。

| 子命令 | 操作 |
| --- | --- |
| none | 创建/更新并启动服务。 |
| none | 服务不存在时安装并启动;已存在时不重新注册,直接刷新并重启。 |
| `install` | 创建并启动服务。 |
| `repair` | 就地刷新已安装的服务并重启,不重新注册。 |
| `restart` | `repair` 的别名。 |
| `start` | 启动已安装的服务。 |
| `stop` | 停止服务并恢复原生 Codex。 |
| `status` | 报告服务和代理诊断信息及日志路径。 |
Expand All @@ -166,6 +167,7 @@ ocx status --json
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
6 changes: 4 additions & 2 deletions docs-site/src/content/docs/zh-tw/reference/cli/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,16 @@ ocx status --json

## 背景服務

### `ocx service [install|repair|start|stop|status|uninstall|remove]`
### `ocx service [install|repair|restart|start|stop|status|uninstall|remove]`

將 opencodex 作為登入管理的背景服務執行(macOS **launchd**、Linux **systemd user unit**、Windows **Task Scheduler**),在登入時自動啟動並在崩潰時自動重啟。服務執行時設定 `OCX_SERVICE=1`,使重啟不會折騰 Codex 設定。

| 子指令 | 動作 |
| --- | --- |
| 無 | 建立/更新並啟動服務。 |
| 無 | 服務不存在時安裝並啟動;已存在時不重新註冊,直接重新整理並重啟。 |
| `install` | 建立並啟動服務。註冊它,在 Windows 上需要提高權限。 |
| `repair` | 就地重新整理已安裝的服務並重啟它,而不重新註冊。 |
| `restart` | `repair` 的別名。 |
| `start` | 啟動已安裝的服務。 |
| `stop` | 停止服務並還原原生 Codex。 |
| `status` | 回報服務與代理診斷及日誌路徑。 |
Expand All @@ -160,6 +161,7 @@ ocx status --json
ocx service
ocx service install
ocx service repair
ocx service restart
ocx service status
ocx service uninstall
```
Expand Down
5 changes: 3 additions & 2 deletions src/cli/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
},
{
name: "service",
usage: "ocx service [install|start|stop|status|uninstall|remove]",
usage: "ocx service [install|repair|restart|start|stop|status|uninstall|remove]",
summary: "Run as a background service.",
details: [
"With no subcommand, installs/updates and starts the background service.",
"With no subcommand, installs when absent or repairs/restarts an existing service.",
"`restart` is an alias of `repair` and does not re-register an installed service.",
"Use `ocx service status` to see diagnostics and log paths.",
],
},
Expand Down
Loading
Loading