Files
browser-helper/src/test/xhs/index.ts
xiongxiao e5c3ec3f79 feat: refactor context usage and add search template route
- Updated context key usage from `useConfigKey` to `useContextKey` in app initialization.
- Introduced a new route for searching templates related to 小红书 with a default keyword.
- Enhanced error handling for saving notes and user information.
- Added a command for searching templates in the CLI.
- Created a new agent plugin for browser integration.
2026-01-21 01:45:27 +08:00

33 lines
790 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { program, app, showMore } from '../common.ts'
program
.command('xhs:run')
.description('运行小红书浏览器辅助')
.action(async () => {
const res = await app.run({
path: 'xhs',
key: 'search-notes',
payload: {
keyword: '多维表格',
scrollTimes: 1,
}
})
console.log(showMore(res));
});
program.command('xhs:search-template')
.description('搜索小红书的模板相关参数是keyword默认搜索"网站模板"')
.option('-k, --keyword <string>', '搜索关键词', '网站模板')
.action(async (options) => {
const res = await app.run({
path: 'good',
key: 'searchTemplate',
payload: {
keyword: options.keyword,
}
});
console.log(showMore(res));
});