$npx -y skills add WithWoz/wozcode-plugin --skill woz-loginAuthenticate with the Woz service. Use when the user needs to log in or when authentication is required.
| 1 | # Woz Login Flow |
| 2 | |
| 3 | If the user passed `--token <token>` as arguments, skip directly to the Token Login section below. |
| 4 | |
| 5 | ## Browser Login (Preferred) |
| 6 | |
| 7 | First try the installed WOZCODE login command. This opens a browser for the user to log in: |
| 8 | |
| 9 | ```bash |
| 10 | node "${CODEX_HOME:-$HOME/.codex}/plugins/wozcode/scripts/wozcode-cli-codex.js" login |
| 11 | ``` |
| 12 | |
| 13 | If the command exits with code 0, login succeeded — confirm to the user. |
| 14 | |
| 15 | If Codex blocks the browser launch or the command fails before the browser opens, ask the user to run this command in their regular terminal outside Codex: |
| 16 | |
| 17 | ```bash |
| 18 | npx @wozcode/codex login |
| 19 | ``` |
| 20 | |
| 21 | Tell the user to return after the command prints that authentication succeeded. |
| 22 | |
| 23 | ## Token Login |
| 24 | |
| 25 | Use this when: |
| 26 | - The user passed `--token <token>` as arguments to this skill |
| 27 | - The browser login above timed out or failed and the user provides a token |
| 28 | |
| 29 | Once you have the token (from args or from the user), run: |
| 30 | |
| 31 | ```bash |
| 32 | node "${CODEX_HOME:-$HOME/.codex}/plugins/wozcode/scripts/wozcode-cli-codex.js" login --token '<token>' |
| 33 | ``` |
| 34 | |
| 35 | If Codex blocks the installed command from running, ask the user to run this in their regular terminal outside Codex: |
| 36 | |
| 37 | ```bash |
| 38 | npx @wozcode/codex login --token '<token>' |
| 39 | ``` |
| 40 | |
| 41 | Replace `<token>` with the actual token. The npm command still requires WOZCODE for Codex to be installed first. |
| 42 | |
| 43 | Confirm success or relay any error to the user. |