Background
After `phantom start` or `phantom start --daemon`, we print the env-var lines the user should paste into their shell:
```
export OPENAI_BASE_URL=http://127.0.0.1:12345/openai
export PHANTOM_PROXY_PORT=12345
export PHANTOM_PROXY_TOKEN=ptx_...
```
These are bash syntax. On Windows PowerShell (`$env:OPENAI_BASE_URL = "..."`) or cmd (`set OPENAI_BASE_URL=...`) they fail with `export: command not found`. Biggest first-run Windows UX issue.
Locations
- `crates/phantom-cli/src/commands/start.rs:109-114` (daemon path)
- `crates/phantom-cli/src/commands/start.rs:220-225` (foreground path)
Proposed fix
Detect the user's shell once, print one variant, add a short hint line. First-match-wins rules:
- `$SHELL` contains `bash`/`zsh`/`fish`/`sh` → bash-style `export X=Y` (catches Git Bash / WSL / macOS / Linux)
- `$PSModulePath` set → PowerShell `$env:X = "Y"`
- `cfg(windows)` → cmd `set X=Y`
- Fallback → bash-style
After the lines, print one comment with the alternatives so users can self-correct if detection was wrong.
Scope
~50 LOC, no new dependencies. Tiny `ShellSyntax` enum + `detect()` + `format_export()` helpers, called from both start paths.
Part of v0.5.1. Tracker: #1
Background
After `phantom start` or `phantom start --daemon`, we print the env-var lines the user should paste into their shell:
```
export OPENAI_BASE_URL=http://127.0.0.1:12345/openai
export PHANTOM_PROXY_PORT=12345
export PHANTOM_PROXY_TOKEN=ptx_...
```
These are bash syntax. On Windows PowerShell (`$env:OPENAI_BASE_URL = "..."`) or cmd (`set OPENAI_BASE_URL=...`) they fail with `export: command not found`. Biggest first-run Windows UX issue.
Locations
Proposed fix
Detect the user's shell once, print one variant, add a short hint line. First-match-wins rules:
After the lines, print one comment with the alternatives so users can self-correct if detection was wrong.
Scope
~50 LOC, no new dependencies. Tiny `ShellSyntax` enum + `detect()` + `format_export()` helpers, called from both start paths.
Part of v0.5.1. Tracker: #1