- 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.
33 lines
790 B
TypeScript
33 lines
790 B
TypeScript
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));
|
||
}); |