mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
57534cf8b3
* docs: add daemon lifecycle redesign spec Replace the aggressive 5-minute idle timeout with a long-lived daemon model that stays running for hours, reducing restart overhead during development cycles. * docs: add daemon lifecycle redesign implementation plan 8-task TDD plan for replacing aggressive 5-minute idle timeout with long-lived daemon model (4h default, dual-condition exit). * feat(daemon): add DEFAULT_DAEMON_IDLE_TIMEOUT constant (4 hours) * feat(daemon): replace fixed 5min timeout with dual-condition idle manager (4h default) * feat(extension): reduce WS reconnect backoff cap from 60s to 5s * feat(daemon): improve CLI connection-waiting UX with progress messages and 200ms polling * feat(daemon): add opencli daemon status/stop/restart commands * test(daemon): add tests for daemon status/stop commands * fix(daemon): address code review issues — stale constant, restart robustness, timer cleanup, test coverage * docs: update daemon documentation for new lifecycle and CLI commands - troubleshooting.md: replace manual curl/pkill with `opencli daemon status/stop/restart` - browser-bridge.md (en/zh): add Daemon Lifecycle section - README.md: add `opencli daemon status` to Quick Start - README.zh-CN.md: add daemon management commands to tips
62 lines
1.6 KiB
Markdown
62 lines
1.6 KiB
Markdown
# Troubleshooting
|
|
|
|
## Common Issues
|
|
|
|
### "Extension not connected"
|
|
|
|
- Ensure the opencli Browser Bridge extension is installed and **enabled** in `chrome://extensions`.
|
|
- Run `opencli doctor` to diagnose connectivity.
|
|
|
|
### Empty data or 'Unauthorized' error
|
|
|
|
- Your login session in Chrome might have expired. Open a normal Chrome tab, navigate to the target site, and log in or refresh the page.
|
|
- Some sites have geographic restrictions (e.g., Bilibili, Zhihu from outside China).
|
|
|
|
### Node API errors
|
|
|
|
- Make sure you are using **Node.js >= 20**. Some dependencies require modern Node APIs.
|
|
- Run `node --version` to verify.
|
|
|
|
### Daemon issues
|
|
|
|
```bash
|
|
# Check daemon status (PID, uptime, extension connection, memory)
|
|
opencli daemon status
|
|
|
|
# View extension logs
|
|
curl localhost:19825/logs
|
|
|
|
# Stop or restart the daemon
|
|
opencli daemon stop
|
|
opencli daemon restart
|
|
|
|
# Full diagnostics
|
|
opencli doctor
|
|
```
|
|
|
|
> The daemon auto-exits after 4 hours of inactivity (no CLI requests and no extension connection). Override with `OPENCLI_DAEMON_TIMEOUT` (milliseconds, `0` = never timeout).
|
|
|
|
### Desktop adapter connection issues
|
|
|
|
For Electron/CDP-based adapters (Cursor, Codex, etc.):
|
|
|
|
1. Make sure the app is launched with `--remote-debugging-port=XXXX`
|
|
2. Verify the endpoint is set: `echo $OPENCLI_CDP_ENDPOINT`
|
|
3. Test the endpoint: `curl http://127.0.0.1:XXXX/json/version`
|
|
|
|
### Build errors
|
|
|
|
```bash
|
|
# Clean rebuild
|
|
rm -rf dist/
|
|
npm run build
|
|
|
|
# Type check
|
|
npx tsc --noEmit
|
|
```
|
|
|
|
## Getting Help
|
|
|
|
- [GitHub Issues](https://github.com/jackwener/opencli/issues) — Bug reports and feature requests
|
|
- Run `opencli doctor` for comprehensive diagnostics
|