Inconsistent authentication handling for `opencli`'s Zhihu adapter, specifically for the `question` command.
Raw Developer Origin & Technical Request
GitHub Issue
Mar 30, 2026
## Bug Description
`opencli zhihu question ` always fails with `🔒 Not logged in to www.zhihu.com`, even when the user is logged in to Zhihu in the browser profile where the Browser Bridge extension is installed.
Other Zhihu commands (e.g. `zhihu search`) work correctly with the same login session.
## Environment
- opencli: v1.5.6
- Extension: v1.5.5
- OS: macOS (Darwin 25.4.0)
- Node: v22.22.1
## Steps to Reproduce
1. Install Browser Bridge extension in a Chrome profile that is logged in to zhihu.com
2. Verify `opencli zhihu search "any query"` works (it does)
3. Run `opencli zhihu question 2021881398772981878`
4. Result: `🔒 Not logged in to www.zhihu.com`
## Root Cause
In `src/clis/zhihu/question.ts`, the command calls `page.evaluate()` with `fetch(..., {credentials: 'include'})` directly, without first navigating to the Zhihu domain. Since the browser context is not on `www.zhihu.com`, cookies are not attached to the fetch request, and the Zhihu API returns an auth error.
In contrast, `src/clis/zhihu/search.yaml` includes a `navigate: zhihu.com` step before the evaluate, which establishes the correct domain context for cookies to be sent.
## Suggested Fix
Add a navigation step in `question.ts` before the `page.evaluate()` call:
```typescript
await page.goto('zhihu.com&
```
This matches the pattern used in `search.yaml` and should allow `credentials: 'include'` to work correctly.
Developer Debate & Comments
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from jackwener/opencli.
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like cookies and Browser Bridge extension by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
Market Trends