cli-anything-openrefine
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCLI-Anything OpenRefine
CLI-Anything OpenRefine
Use this skill when a task needs OpenRefine data cleaning, transformation, reusable operation histories, or CSV/TSV export from an automated agent workflow.
当任务需要使用 OpenRefine 进行数据清理、转换、复用操作历史,或在自动化 Agent 工作流中导出 CSV/TSV 时,使用此 skill。
Prerequisites
前置条件
Install the harness:
bash
cd openrefine/agent-harness
python -m pip install -e .Start OpenRefine before backend commands:
bash
openrefine -i 127.0.0.1 -p 3333Set a custom server with or pass .
OPENREFINE_URL=http://127.0.0.1:3333--base-url安装 harness:
bash
cd openrefine/agent-harness
python -m pip install -e .执行后端命令前先启动 OpenRefine:
bash
openrefine -i 127.0.0.1 -p 3333通过 设置自定义服务器,或传入 。
OPENREFINE_URL=http://127.0.0.1:3333--base-urlCommand Rules For Agents
面向 Agent 的命令规则
- Prefer on every one-shot command.
--json - Use for isolated task state.
--session <path> - Import or open a project before row, apply, export, undo, or redo commands.
- Existing OpenRefine operation-history JSON can be passed directly to .
data apply - Generated files are normal OpenRefine operation JSON and exported CSV/TSV data.
- 每个一次性命令都优先使用 。
--json - 使用 隔离任务状态。
--session <path> - 在执行 row、apply、export、undo 或 redo 命令前,先导入或打开项目。
- 现有的 OpenRefine operation-history JSON 可以直接传递给 。
data apply - 生成的文件为标准 OpenRefine operation JSON 和导出的 CSV/TSV 数据。
Common Commands
常用命令
bash
cli-anything-openrefine --json server ping
cli-anything-openrefine --json project list
cli-anything-openrefine --json --session run/session.json project import messy.csv --name cleanup
cli-anything-openrefine --json --session run/session.json data rows --limit 10
cli-anything-openrefine --json ops text-transform run/trim.json --column Name --expression 'value.trim()'
cli-anything-openrefine --json --session run/session.json data apply run/trim.json
cli-anything-openrefine --json --session run/session.json data export run/clean.csv --format csv
cli-anything-openrefine --json --session run/session.json session undo
cli-anything-openrefine --json --session run/session.json session redobash
cli-anything-openrefine --json server ping
cli-anything-openrefine --json project list
cli-anything-openrefine --json --session run/session.json project import messy.csv --name cleanup
cli-anything-openrefine --json --session run/session.json data rows --limit 10
cli-anything-openrefine --json ops text-transform run/trim.json --column Name --expression 'value.trim()'
cli-anything-openrefine --json --session run/session.json data apply run/trim.json
cli-anything-openrefine --json --session run/session.json data export run/clean.csv --format csv
cli-anything-openrefine --json --session run/session.json session undo
cli-anything-openrefine --json --session run/session.json session redoREPL
REPL
Run with no subcommand to enter the REPL.
cli-anything-openrefineFor automated user journeys, pipe newline-separated REPL commands through
stdin. Redirected streams automatically use an ASCII-only input/output path
while interactive terminals retain the Unicode banner, prompt history, and
styling:
bash
printf 'help\nexit\n' | cli-anything-openrefineUnicode payloads are rendered as reversible ASCII backslash escapes when the
REPL is redirected, preventing legacy Windows output encodings from turning a
successful command into a failed journey.
Piped workflows return a nonzero exit status at or EOF if any command
failed, allowing CI to detect an unsuccessful user journey.
exit运行 且不传入子命令即可进入 REPL。
cli-anything-openrefine对于自动化用户流程,可以通过 stdin 传入以换行符分隔的 REPL 命令。重定向的流会自动使用仅支持 ASCII 的输入/输出路径,而交互式终端会保留 Unicode 横幅、提示历史和样式:
bash
printf 'help\nexit\n' | cli-anything-openrefine当 REPL 被重定向时,Unicode 载荷会呈现为可逆的 ASCII 反斜杠转义,从而避免旧版 Windows 输出编码将成功命令转换为失败流程。
如果任意命令失败,管道工作流会在 或 EOF 时返回非零退出状态,使 CI 能够检测到未成功的用户流程。
exitError Handling
错误处理
When is set, command failures write a JSON object to stderr with .
--jsonok: false设置 后,命令失败时会在 stderr 中写入一个包含 的 JSON 对象。
--jsonok: false