codex-theme-finder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFind Codex themes on CodexThemes
在CodexThemes上查找Codex主题
Search the published theme gallery on codexthemes.ai. This skill is standalone: its TypeScript scripts own the search request and API key storage. It does not create, install, or submit themes — codex-theme-creator, codex-theme-installer, and codex-theme-submitter own those jobs. The only required local tools are Node.js 20+ and .
npxRead before diagnosing an unexpected API response or changing endpoint behavior. Run all commands from the installed skill directory.
references/search-api.md搜索codexthemes.ai上已发布的主题库。此Skill是独立的:其TypeScript脚本负责处理搜索请求和API密钥存储。它不负责创建、安装或提交主题——这些工作由codex-theme-creator、codex-theme-installer和codex-theme-submitter负责。仅需的本地工具为Node.js 20+和。
npx在排查异常API响应或更改端点行为之前,请阅读。所有命令均需从已安装的Skill目录运行。
references/search-api.mdStep 1: search
步骤1:搜索
Turn the user's request into short search terms (style, subject, mood — for example , ), then run:
dark animepastel floral lightbash
npx tsx scripts/find-themes.ts <terms...> [--limit <1-50>] [--page <n>] [--sort <popular|newest|name>]Searching works without any API key inside a free anonymous quota, so do not demand a key up front. When a key is already configured ( environment variable or ), the script sends it automatically for higher limits; the output's field shows which mode was used.
CODEXTHEMES_API_KEY~/.codexthemes/credentials.jsonauthRun more than one search with different terms when the first result set is thin, but never loop on the same query.
将用户的请求转化为简短的搜索关键词(风格、主题、氛围——例如、),然后运行:
dark animepastel floral lightbash
npx tsx scripts/find-themes.ts <terms...> [--limit <1-50>] [--page <n>] [--sort <popular|newest|name>]无需API密钥即可在免费匿名配额内进行搜索,因此不要一开始就要求用户提供密钥。当已配置密钥(环境变量或文件)时,脚本会自动发送密钥以获得更高限制;输出的字段会显示使用的模式。
CODEXTHEMES_API_KEY~/.codexthemes/credentials.jsonauth当首次搜索结果较少时,可使用不同关键词进行多次搜索,但切勿重复执行同一查询。
Step 2: present the results
步骤2:展示结果
Present the closest matches — several candidates (up to 5) when the gallery has them, not just the first hit; run one or two broader searches before concluding there is only a single match. For each recommended theme show: id, name, author, short description, the public (its codexthemes.ai detail page — always include it so the user can view the theme in the browser), and its preview image. Every result carries an URL: download it to a temporary file and display that local image to the user — do not hotlink the remote URL in chat markdown, it often fails to render. If a result has no image, say "no preview" instead of showing a broken embed. Keep the theme visible — codex-theme-installer needs it.
urlimageidResults mix three kinds — check and (each entry's field restates its next step):
kindinstallableguidance- — a
installable: truepackage; codex-theme-installer can install it one-click..codex-theme - ,
kind: "theme"— an archive package (zip). Not agent-installable: point the user toinstallable: falseto sign in, download the archive, and install manually.url - — a design reference with no package. Share
kind: "skin", and offer to recreate the look with codex-theme-creator.url
If the result is empty, say so and suggest broader terms, or offer to create a custom theme with codex-theme-creator.
展示最匹配的结果——如果主题库中有多个候选(最多5个),不要只展示第一个结果;在得出仅存在单个匹配项的结论之前,先进行一到两次范围更广的搜索。每个推荐主题需展示:id、名称、作者、简短描述、公开(其codexthemes.ai详情页——务必包含该链接,以便用户在浏览器中查看主题),以及预览图片。每个结果都带有一个 URL:将其下载到临时文件并向用户展示本地图片——不要在聊天markdown中直接链接远程URL,因为它通常无法渲染。如果某个结果没有图片,请显示“无预览”,而非展示损坏的嵌入内容。保持主题可见——codex-theme-installer需要用到它。
urlimageid结果分为三类——检查和字段(每个条目的字段会说明下一步操作):
kindinstallableguidance- — 一个
installable: true包;codex-theme-installer可一键安装它。.codex-theme - ,
kind: "theme"— 一个归档包(zip格式)。无法通过Agent安装:引导用户访问installable: false登录,下载归档包并手动安装。url - — 一个无安装包的设计参考。分享
kind: "skin",并主动提出使用codex-theme-creator复刻该外观。url
如果结果为空,请告知用户并建议使用更宽泛的关键词,或主动提出使用codex-theme-creator创建自定义主题。
Step 3: offer installation — never end at the list
步骤3:提供安装选项——切勿仅停留在结果列表
Finding is not the finish line; close the loop with the action that fits each result's kind:
- Several installable candidates → ask which one to install, for example: "Reply with a theme id (e.g. ) and I will install and apply it."
shaolin-kickoff - Exactly one good installable match → offer it directly: "Reply and I will install and apply
install."<id> - Archive-only theme () → give the user its
installable: falseand explain they can sign in there to download the archive for manual install.url - Skin () → give the user its
kind: "skin"and offer: "I can recreate this look as an installable theme with codex-theme-creator — want me to?"url
When the user picks, hand off to codex-theme-installer (bootstrap it the same way this skill was bootstrapped if missing: ); the installer then chains into activation via codex-theme-switcher. Never end the conversation with only a result list and no install path.
npx skills add codexthemes/skills --skill codex-theme-installer -g -a codex找到主题并非终点;需根据每个结果的类型采取相应操作,完成闭环:
- 多个可安装候选主题 → 询问用户要安装哪一个,例如:“回复主题id(如),我将为您安装并应用它。”
shaolin-kickoff - 恰好有一个合适的可安装匹配项 → 直接提供安装选项:“回复,我将为您安装并应用
install主题。”<id> - 仅归档包主题() → 向用户提供其
installable: false,并说明他们可登录该链接下载归档包进行手动安装。url - Skin() → 向用户提供其
kind: "skin",并主动提出:“我可以使用codex-theme-creator将此外观复刻为可安装主题——需要我这么做吗?”url
当用户做出选择后,将任务移交至codex-theme-installer(如果未安装,可按照此Skill的引导方式进行安装:);安装程序随后会通过codex-theme-switcher完成主题激活。切勿仅展示结果列表而不提供安装路径就结束对话。
npx skills add codexthemes/skills --skill codex-theme-installer -g -a codexStep 4: handle quota and rate limits
步骤4:处理配额和速率限制
On HTTP or the free quota is exhausted; the script's error message includes any value. Do not retry in a loop. Tell the user the free search quota is used up and guide them to configure a personal API key:
429402Retry-After- Create a key at .
https://codexthemes.ai/settings/apikeys - Store it: (stdin keeps the key out of shell history;
printf '%s' "<api-key>" | npx tsx scripts/apikey.ts setalso works).apikey.ts set <key> - Re-run the search.
Check the current key state at any time with ; remove a stored key with . Never print a full key (scripts only show a masked form), never write it into a project file, and never commit it.
npx tsx scripts/apikey.ts statusnpx tsx scripts/apikey.ts clearOn / the configured key is invalid or revoked — guide the user to create a fresh key the same way.
401403当出现HTTP 或状态码时,说明免费配额已用尽;脚本的错误消息会包含值。切勿循环重试。告知用户免费搜索配额已用完,并引导他们配置个人API密钥:
429402Retry-After- 在创建密钥。
https://codexthemes.ai/settings/apikeys - 存储密钥:(通过标准输入可避免密钥出现在shell历史记录中;
printf '%s' "<api-key>" | npx tsx scripts/apikey.ts set同样有效)。apikey.ts set <key> - 重新运行搜索。
可随时使用检查当前密钥状态;使用删除已存储的密钥。切勿打印完整密钥(脚本仅会显示掩码形式),切勿将其写入项目文件,也切勿提交到版本控制系统。
npx tsx scripts/apikey.ts statusnpx tsx scripts/apikey.ts clear当出现/状态码时,说明已配置的密钥无效或已被撤销——按照相同方式引导用户创建新密钥。
401403