法典图片库
- 作者仓库星标 0
- 作者更新于 2026年8月24日 07:33
- 作者仓库 claude-code-skills
- 领域
- 设计与多媒体
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @daymade · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
node scripts/server.mjs
# Codex Image Gallery
Start a local browser gallery for Codex image outputs. This skill is self-contained: the server lives in `scripts/server.mjs`, and the UI template lives in `assets/index.html`.
## Quick Start
Run commands from this skill directory, the directory containing this `SKILL.md`.
```bash
node scripts/server.mjs
```
The server prints the actual URL. It starts at `http://127.0.0.1:8765/` and tries later ports if the default is occupied.
## Workflow
1. Check the default URL first:
```bash
node -e 'fetch("http://127.0.0.1:8765/api/images").then(r => r.json()).then(j => console.log(j.rootPath, j.items.length)).catch(() => process.exit(1))'
```
If this succeeds, reuse the running server at `http://127.0.0.1:8765/`.
2. If the API check fails, check for a running server process:
```bash
pgrep -fl 'node .*server\.mjs' || true
```
When a process exists but the default URL fails, inspect its stdout or try likely later ports because the server auto-increments when a port is occupied.
3. Verify any reused URL before reporting success:
```bash
node -e 'fetch("http://127.0.0.1:8765/api/images").then(r => r.json()).then(j => console.log(j.rootPath, j.items.length))'
```
If the server chose another port, use that port.
4. Start the server if none is running:
```bash
node scripts/server.mjs
```
Keep the process running for the user and read stdout for the URL.
5. Open the browser unless the user asks for URL-only:
```bash
open http://127.0.0.1:8765/
```
## Image Root
Default image root:
```text
~/.codex/generated_images
```
Use a different folder with:
```bash
GALLERY_ROOT=/path/to/images node scripts/server.mjs
```
## Validation
Before declaring the skill healthy after edits, run:
```bash
node --check scripts/server.mjs
```
Then start the server and verify:
- `GET /api/images` returns JSON with `rootPath` and `items`
- `/images/<relative-path>` returns image content for at least one listed item
- The page loads from the bundled `assets/index.html`
## Response
Report the URL, image root, whether the server was reused or newly started, and any verification failure. Keep the answer short.
章节与文件索引
按说明文件中的顺序排列。
快速入门
工作流程
图像根
验证
回应
文件/命令 -> scripts/server.mjs · assets/index.html · http://127.0.0.1:8765/ · GET /api/images · rootPath · items · /images/<relative-path>
内容校验值 -> 349465468309
当前原文的自动摘译,尚未人工审校。
快速入门
从该技能目录运行命令,该目录包含此
SKILL.md。服务器打印实际的 URL。它从http://127.0.0.1:8765/开始,如果默认端口被占用,则尝试后面的端口。工作流程
首先检查默认 URL:如果成功,请重新使用
http://127.0.0.1:8765/处正在运行的服务器。如果 API 检查失败,请检查正在运行的服务器进程:当进程存在但默认 URL 失败时,检查其 stdout 或尝试可能的后续端口,因为当端口被占用时服务器会自动递增。在报告成功之前验证任何重复使用的 URL:图像根
默认图像根:使用不同的文件夹:
验证
在编辑后声明技能正常之前,运行: 然后启动服务器并验证:
GET /api/images返回带有rootPath和items的 JSON/images/<relative-path>返回至少一个列出项目的图像内容 页面从捆绑的assets/index.html加载回应
报告 URL、图像根、服务器是否被重用或新启动以及任何验证失败。保持答案简短。