### Verify Installation Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/wps/README.md Check if the CLI tool is installed correctly by displaying the help menu. ```bash cli-anything-wps --help ``` -------------------------------- ### Install via cloning Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md Clone the repository and install in editable mode for development. ```bash git clone https://github.com/yb2460/cli-anything-wps.git cd cli-anything-wps pip install -e . ``` -------------------------------- ### Install cli-anything-zotero Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Install the package in editable mode. ```bash pip install -e . ``` -------------------------------- ### Install cli-anything-wps Source: https://github.com/yb2460/harness-anything/blob/master/README.md Install the WPS/Office automation package via pip. ```bash pip install git+https://github.com/yb2460/cli-anything-wps.git ``` -------------------------------- ### Install CLI Harness Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Installation commands for the zotero agent-harness. ```bash cd zotero/agent-harness py -m pip install -e . ``` -------------------------------- ### Quickstart CLI Commands Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Basic commands for checking status, listing collections, and searching for items. ```bash cli-anything-zotero --json app status cli-anything-zotero --json collection list cli-anything-zotero --json item list --limit 10 cli-anything-zotero --json item find "embodied intelligence" --limit 5 cli-anything-zotero ``` -------------------------------- ### Run Tests Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/wps/README.md Install development dependencies and execute the test suite. ```bash pip install -e .[dev] python -m pytest cli_anything/wps/tests/ -v ``` -------------------------------- ### Quick Start Commands Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/wps/README.md Basic commands to create a document, add content, export, and enter the interactive REPL. ```bash # 创建文档 cli-anything-wps document new --type writer --name "测试" # 添加内容 cli-anything-wps writer add-paragraph -t "Hello WPS!" # 导出 cli-anything-wps export render output.docx -p docx # 交互式 REPL cli-anything-wps ``` -------------------------------- ### Quick Start CLI Commands Source: https://github.com/yb2460/harness-anything/blob/master/README.md Common commands for WPS, Zotero, Illustrator, and Photoshop automation. ```bash # WPS 办公 cli-anything-wps document new --type impress --name "演示" cli-anything-wps preset apply academic --talk-type defense cli-anything-wps export render output.pptx -p pptx # Zotero 学术 cli-anything-zotero skills pipeline thesis cli-anything-zotero catalog search "machine learning" # Illustrator 设计 cli-anything-illustrator project new logo.ai -w 500 -h 500 cli-anything-illustrator shapes rect --w 200 --h 200 # Photoshop 设计 cli-anything-photoshop project new banner.psd -w 1920 -h 1080 cli-anything-photoshop export png banner.png ``` -------------------------------- ### Manual Usage Examples Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/skills/cli-anything-photoshop/SKILL.md Standard commands for manual interaction with PSD files and the REPL. ```bash # 打开 PSD,交互编辑 cli-anything-photoshop --project work.psd layer list # 启动 REPL cli-anything-photoshop repl ``` -------------------------------- ### Install CLI-Anything WPS Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/wps/README.md Install the package in editable mode within the agent-harness directory. ```bash cd agent-harness pip install -e . ``` -------------------------------- ### Install Photoshop Harness Source: https://github.com/yb2460/harness-anything/blob/master/README.md Set up the Photoshop automation agent in editable mode. ```bash cd photoshop-harness/agent-harness pip install -e . ``` -------------------------------- ### Install development dependencies Source: https://github.com/yb2460/harness-anything/blob/master/CONTRIBUTING.md Install the package in editable mode with development dependencies. ```bash pip install -e . pip install -e .[dev] ``` -------------------------------- ### AI Agent Usage Examples Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/skills/cli-anything-photoshop/SKILL.md Examples of using the CLI with the --json flag for automated workflows and --dry-run for testing. ```bash # 创建新项目并获取 JSON 输出 cli-anything-photoshop --json project new -w 800 -h 600 poster.psd # 添加文字图层 cli-anything-photoshop --json --project poster.psd text add -t "Hello World" -f Arial -s 48 -c "#FF0000" # 列出所有图层(JSON 格式) cli-anything-photoshop --json --project poster.psd layer list # 导出为 PNG cli-anything-photoshop --json --project poster.psd export save -f png output.png # 预览(不保存) cli-anything-photoshop --dry-run --project poster.psd layer add -n "draft" --type text ``` -------------------------------- ### Run cli-anything-zotero Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Execute the CLI using the installed entry point or via the Python module. ```bash cli-anything-zotero python -m cli_anything.zotero ``` -------------------------------- ### CLI Usage Examples Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/wps/skills/SKILL.md Commands for creating documents, adding content, and exporting files, including JSON mode for agent integration. ```bash # 创建文档 cli-anything-wps document new --type writer --name "报告" -o report.json cli-anything-wps --project report.json writer add-heading -t "年度报告" -l 1 cli-anything-wps --project report.json export render report.docx -p docx # JSON模式(Agent使用) cli-anything-wps --json document new --type writer --name "test" ``` -------------------------------- ### Install Illustrator Harness Source: https://github.com/yb2460/harness-anything/blob/master/README.md Set up the Illustrator automation agent in editable mode. ```bash cd illustrator-harness/agent-harness pip install -e . ``` -------------------------------- ### Windows Zotero Path Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md The default installation path for Zotero on Windows. ```text C:\Program Files\Zotero ``` -------------------------------- ### Photoshop Automation Examples Source: https://github.com/yb2460/harness-anything/blob/master/README.md Create new PSD documents, add text, and export images using the Photoshop CLI. ```bash cli-anything-photoshop project new poster.psd -w 1920 -h 1080 cli-anything-photoshop text add --content "Hello World" --font "Arial" --size 72 cli-anything-photoshop export png --output result.png ``` -------------------------------- ### JSON Import Schema Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Example JSON structure for importing items with attachments. ```json [ { "itemType": "journalArticle", "title": "Embodied Intelligence Paper", "attachments": [ { "path": "C:\\papers\\embodied.pdf", "title": "PDF" }, { "url": "https://example.org/embodied.pdf", "title": "Publisher PDF", "delay_ms": 500 } ] } ] ``` -------------------------------- ### Illustrator Automation Examples Source: https://github.com/yb2460/harness-anything/blob/master/README.md Create new documents, add text, draw shapes, and export files using the Illustrator CLI. ```bash cli-anything-illustrator project new logo.ai -w 500 -h 500 cli-anything-illustrator text add "Brand" --x 100 --y 100 --font "Arial" --size 72 cli-anything-illustrator shapes rect --x 50 --y 50 --w 200 --h 100 cli-anything-illustrator export svg output.svg ``` -------------------------------- ### Execute Pytest Session Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/tests/TEST.md Example output of a pytest session running against the Zotero test suite. ```text py -m pytest cli_anything/zotero/tests/ -v --tb=no ============================= test session starts ============================= platform win32 -- Python 3.13.5, pytest-8.4.2, pluggy-1.6.0 -- C:\Users\Lenovo\AppData\Local\Programs\Python\Python313\python.exe cachedir: .pytest_cache rootdir: C:\Users\Lenovo\Desktop\CLI-Anything\zotero\agent-harness configfile: pyproject.toml plugins: anyio-4.9.0 collecting ... collected 82 items cli_anything/zotero/tests/test_agent_harness.py::AgentHarnessPackagingTests::test_required_files_exist PASSED [ 1%] cli_anything/zotero/tests/test_agent_harness.py::AgentHarnessPackagingTests::test_setup_reports_expected_name PASSED [ 2%] cli_anything/zotero/tests/test_agent_harness.py::AgentHarnessPackagingTests::test_setup_reports_expected_version PASSED [ 3%] cli_anything/zotero/tests/test_agent_harness.py::AgentHarnessPackagingTests::test_skill_generator_regenerates_skill PASSED [ 4%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_app_enable_local_api_json PASSED [ 6%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_app_status_json PASSED [ 7%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_collection_find_json PASSED [ 8%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_collection_list_json PASSED [ 9%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_default_entrypoint_starts_repl PASSED [ 10%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_dispatch_uses_requested_prog_name PASSED [ 12%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_experimental_collection_write_commands PASSED [ 13%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_force_installed_mode_requires_real_command PASSED [ 14%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_group_library_routes_use_group_scope PASSED [ 15%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_help_renders_groups PASSED [ 17%] cli_anything/zotero/tests/test_cli_entrypoint.py::CliEntrypointTests::test_import_file_subprocess PASSED [ 18%] ``` -------------------------------- ### Run Test Suite Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Commands to install the package in editable mode and execute various test modules using pytest. ```bash py -m pip install -e . py -m pytest cli_anything/zotero/tests/test_core.py -v py -m pytest cli_anything/zotero/tests/test_cli_entrypoint.py -v py -m pytest cli_anything/zotero/tests/test_agent_harness.py -v py -m pytest cli_anything/zotero/tests/test_full_e2e.py -v -s py -m pytest cli_anything/zotero/tests/ -v --tb=no set CLI_ANYTHING_FORCE_INSTALLED=1 py -m pytest cli_anything/zotero/tests/test_cli_entrypoint.py -v py -m pytest cli_anything/zotero/tests/test_full_e2e.py -v -s ``` -------------------------------- ### Run Zotero CLI Validation Commands Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/tests/TEST.md Commands for installing the package in editable mode, executing test suites, and performing CLI operations. ```powershell py -m pip install -e . py -m pytest cli_anything/zotero/tests/test_core.py -v py -m pytest cli_anything/zotero/tests/test_cli_entrypoint.py -v py -m pytest cli_anything/zotero/tests/test_agent_harness.py -v py -m pytest cli_anything/zotero/tests/test_full_e2e.py -v -s py -m pytest cli_anything/zotero/tests/ -v --tb=no $env:CLI_ANYTHING_FORCE_INSTALLED=1 py -m pytest cli_anything/zotero/tests/test_cli_entrypoint.py -v py -m pytest cli_anything/zotero/tests/test_full_e2e.py -v -s cli-anything-zotero --json app status cli-anything-zotero --json collection find "具身" cli-anything-zotero --json item find "embodied intelligence" --limit 5 cli-anything-zotero --json item context PB98EI9N --include-links cli-anything-zotero --json note get ``` -------------------------------- ### Create presentations Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md Create a new presentation, add slides and elements, and export to pptx. ```bash cli-anything-wps document new --type impress --name "演示" -o slides.json cli-anything-wps --project slides.json impress add-slide -t "标题页" -c "正文内容" cli-anything-wps --project slides.json impress add-element 0 --type text_box --text "Hello!" cli-anything-wps --project slides.json export render slides.pptx -p pptx ``` -------------------------------- ### Attachment Manifest Schema Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Example JSON structure for a sidecar manifest used with file imports. ```json [ { "index": 0, "expected_title": "Embodied Intelligence Paper", "attachments": [ { "path": "C:\\papers\\embodied.pdf", "title": "PDF" } ] } ] ``` -------------------------------- ### Launch Zotero REPL Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Run the command without subcommands to enter the interactive stateful REPL. ```bash cli-anything-zotero ``` -------------------------------- ### cli-anything-zotero item context Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Assembles structured context for downstream model analysis. ```APIDOC ## cli-anything-zotero item context ### Description Assemble structured context for downstream model analysis. ### Parameters - **item-key** (string) - Required - The unique identifier for the Zotero item. - **--include-notes** (flag) - Optional - Include notes in the context. - **--include-links** (flag) - Optional - Include links in the context. ### Usage `cli-anything-zotero item context --include-notes --include-links --json` ``` -------------------------------- ### Enable Local API via CLI Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Commands to enable the Zotero Local API, optionally launching the application. ```bash cli-anything-zotero --json app enable-local-api cli-anything-zotero --json app enable-local-api --launch ``` -------------------------------- ### CLI Help Command Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Command to display help if the package is not in the system PATH. ```bash py -m cli_anything.zotero --help ``` -------------------------------- ### Execute PPT Generation Workflow Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/wps/skills/SKILL.md Run the full pipeline for generating PPTX and PDF files from data. ```bash # 完整执行示例 python -c "import zipfile; ..." # 提取模板 python gen_charts.py # 生成图表 python -c "import json; json.load(open('data.json','r',encoding='utf-8'))" # 验证JSON taskkill //F //IM wps.exe //T python build_xxx.py # 构建PPTX+PDF ``` -------------------------------- ### Build LLM Context Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Assembles structured context for downstream model analysis including notes and links. ```bash cli-anything-zotero item context --include-notes --include-links --json ``` -------------------------------- ### Photoshop State Model JSON Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/agent-harness/PHOTOSHOP.md Example of the JSON structure used to track the current state of the Photoshop project, including document info and layer details. ```json { "project_path": "path/to/file.psd", "active_document": "doc_name", "document_info": { "width": 1920, "height": 1080, "resolution": 72.0, "mode": "RGB", "bits_per_channel": 8 }, "layers": [ {"name": "Background", "type": "pixel", "visible": true, "opacity": 100, "blend_mode": "normal"}, {"name": "Title", "type": "text", "visible": true, "opacity": 100, "blend_mode": "normal"} ], "selection": {"active": false, "bounds": null} } ``` -------------------------------- ### Run Live Write Tests Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Configure environment variables to enable and target live write end-to-end tests. ```bash set CLI_ANYTHING_ZOTERO_ENABLE_WRITE_E2E=1 set CLI_ANYTHING_ZOTERO_IMPORT_TARGET= py -m pytest cli_anything/zotero/tests/test_full_e2e.py -v -s ``` -------------------------------- ### cli-anything-zotero note add Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Creates a child note under an existing Zotero item. ```APIDOC ## cli-anything-zotero note add ### Description Create a child note under an existing Zotero item. ### Parameters - **item-key** (string) - Required - The unique identifier for the Zotero item. - **--text** (string) - Required - The content of the note. ### Usage `cli-anything-zotero note add --text "Key takeaway" --json` ``` -------------------------------- ### cli-anything-zotero app status Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Inspects Zotero paths and backend availability. ```APIDOC ## cli-anything-zotero app status ### Description Inspect Zotero paths and backend availability. ### Usage `cli-anything-zotero app status --json` ``` -------------------------------- ### 查看 CLI 命令结构 Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md 展示了 cli-anything-wps 工具支持的所有子命令及其功能分类。 ```text cli-anything-wps ├── document new|open|save|info|profiles|json 文档管理 ├── writer 文字处理 │ ├── add-paragraph|add-heading|add-list │ ├── add-table|add-image|add-page-break │ ├── remove|list|set-text|find-replace ├── calc 电子表格 │ ├── add-sheet|remove-sheet|rename-sheet │ ├── set-cell|get-cell|set-range|merge-cells │ └── list-sheets ├── impress 演示文稿 │ ├── add-slide|remove-slide|set-content │ └── list-slides|add-element ├── style create|modify|list|apply|remove 样式管理 ├── export presets|preset-info|render 导出渲染 ├── session status|undo|redo|history 会话管理 └── repl 交互模式 ``` -------------------------------- ### 执行流程命令行操作 Source: https://github.com/yb2460/harness-anything/blob/master/WPS/PPT制作/WPS-PPT自动化制作-完整工作流.md 展示了从提取母版到最终构建 PPT 的五个标准步骤,包含必要的验证命令。 ```bash 步骤1:提取母版 python extract_bg.py → 验证:template_bg.png 存在且 960×540 比例正确 步骤2:搜索资料 WebSearch → 品牌色 + 排名 + 数据 + 名人 + 校训 → 确认:至少有 5 个数据维度的来源 步骤3:生成图表 python gen_charts.py → 验证:images/ 下有 ≥6 张 PNG,所有 dpi=250 步骤4:编写引擎 复制上面的 build_ppt.py 模板 → 改颜色常量(O = 品牌色) → 改 slides 数据(14 页内容) → 改图表引用(file 路径) → python -c "compile(open('build_ppt.py').read(),'test','exec')" 检查语法 步骤5:构建 taskkill //F //IM wps.exe //T python build_ppt.py → 验证:PPTX > 800KB,PDF 可打开,WPS 可见模式目视检查 ``` -------------------------------- ### Experimental Collection Management Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Perform direct SQLite writes to manage collections. Zotero must be closed, and the --experimental flag is required. ```bash cli-anything-zotero --json collection create "New Topic" --parent COLLAAAA --experimental cli-anything-zotero --json item add-to-collection REG12345 COLLBBBB --experimental cli-anything-zotero --json item move-to-collection REG67890 COLLAAAA --from COLLBBBB --experimental cli-anything-zotero --json item move-to-collection REG67890 COLLAAAA --all-other-collections --experimental ``` -------------------------------- ### Enable Local API via user.js Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Manual configuration to enable the Local API in the Zotero profile. ```js user_pref("extensions.zotero.httpServer.localAPI.enabled", true); ``` -------------------------------- ### Run WPS PPT Automation Source: https://github.com/yb2460/harness-anything/blob/master/README.md Generate a PPT presentation using a Python script and JSON data. ```bash cd WPS/南科大 python build_sustech.py # WPS可见生成 → PPTX + PDF ``` -------------------------------- ### 项目目录结构 Source: https://github.com/yb2460/harness-anything/blob/master/WPS/PPT制作/WPS-PPT自动化制作-完整工作流.md 展示自动化 PPT 项目的推荐文件组织结构,强调图表生成与 PPT 构建的分离。 ```text project/work/ ├── template_bg.png ← 从 PPTX 模板提取的母版底图 ├── gen_charts.py ← 生成所有图表 PNG ├── images/ ← 图表输出目录 │ ├── chart_rank.png │ ├── chart_nums.png │ └── ... ├── build_ppt.py ← PPT 构建引擎(本工作流核心) ├── output.pptx └── output.pdf ``` -------------------------------- ### cli-anything-zotero skills Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Manages and executes academic research skills and pipelines. ```APIDOC ## cli-anything-zotero skills ### Description Interface for listing and executing academic research skills. ### Commands - `list`: List all available skills. - `list -c `: List skills filtered by category. - `pipeline `: Execute a predefined research workflow. - `journal `: Access journal-specific guides. ### Usage `cli-anything-zotero skills list` `cli-anything-zotero skills pipeline original_article` ``` -------------------------------- ### 提取 PPT 模板背景 Source: https://github.com/yb2460/harness-anything/blob/master/WPS/PPT制作/WPS-PPT自动化制作-完整工作流.md 使用 zipfile 模块从 PPTX 文件中提取母版背景图片,并重命名为 template_bg.png。 ```python # extract_bg.py — 从用户 PPTX 模板提取母版背景为 PNG import zipfile, os pptx_path = r"用户模板.pptx" out_dir = r"./work" os.makedirs(out_dir, exist_ok=True) with zipfile.ZipFile(pptx_path, 'r') as z: media = [n for n in z.namelist() if 'media' in n and n.endswith('.png')] for m in sorted(media): z.extract(m, out_dir) old = os.path.join(out_dir, m) new = os.path.join(out_dir, "template_bg.png") if os.path.exists(old) and old != new: os.replace(old, new) print(f'Extracted: template_bg.png') ``` -------------------------------- ### Analyze Paper with OpenAI Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Send item context and a specific question to an OpenAI model for analysis. ```bash set OPENAI_API_KEY=... cli-anything-zotero --json item analyze REG12345 --question "What is this paper's likely contribution?" --model gpt-5.4-mini --include-notes ``` -------------------------------- ### Generate LLM-Ready Context Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Produce a structured context block containing metadata, attachments, and optional citations for use with LLMs. ```bash cli-anything-zotero --json item context REG12345 --include-notes --include-links --include-bibtex ``` -------------------------------- ### CLI Command Structure Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/skills/cli-anything-photoshop/SKILL.md The general syntax for executing commands via the CLI. ```text cli-anything-photoshop [--json] [--project ] [--dry-run] [options] ``` -------------------------------- ### Project directory structure Source: https://github.com/yb2460/harness-anything/blob/master/CONTRIBUTING.md Overview of the project file organization. ```text cli_anything/wps/ ├── wps_cli.py # CLI entry (Click + REPL) ├── core/ # Business logic │ ├── document.py # Document CRUD │ ├── writer.py # Writer (word processing) │ ├── calc.py # Calc (spreadsheet) │ ├── impress.py # Impress (presentation) │ ├── styles.py # Style management │ ├── export.py # WPS COM export pipeline │ └── session.py # Session + undo/redo ├── utils/ │ ├── wps_backend.py # WPS COM backend │ └── repl_skin.py # Terminal UI ├── tests/ │ └── test_core.py # Unit tests (58 tests) └── skills/ └── SKILL.md # Agent instruction doc ``` -------------------------------- ### 准备模板背景 Source: https://github.com/yb2460/harness-anything/blob/master/WPS/README.md 通过WPS将PPT模板另存为指定尺寸的PNG图片。 ```bash # WPS打开模版.pptx → 另存为PNG(960x540) → template_bg.png ``` -------------------------------- ### Create and edit Writer documents Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md Workflow for creating a new Writer document, adding content, and exporting to docx or pdf. ```bash # 新建 Writer 文档 cli-anything-wps document new --type writer --name "年度报告" -o report.json # 添加内容 cli-anything-wps --project report.json writer add-heading -t "前言" -l 1 cli-anything-wps --project report.json writer add-paragraph -t "这是AI自动生成的报告。" cli-anything-wps --project report.json writer add-table -r 3 -c 3 # 导出 cli-anything-wps --project report.json export render report.docx -p docx cli-anything-wps --project report.json export render report.pdf -p pdf ``` -------------------------------- ### cli-anything-zotero collection use-selected Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Persists the collection currently selected in the Zotero GUI. ```APIDOC ## cli-anything-zotero collection use-selected ### Description Persist the collection selected in the Zotero GUI. ### Usage `cli-anything-zotero collection use-selected --json` ``` -------------------------------- ### Check Zotero Runtime Status Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Inspects Zotero paths and backend availability. ```bash cli-anything-zotero app status --json ``` -------------------------------- ### Operate spreadsheets Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md Create a new spreadsheet, set cell values, and export to xlsx. ```bash cli-anything-wps document new --type calc --name "数据" -o data.json cli-anything-wps --project data.json calc set-cell A1 "产品名" cli-anything-wps --project data.json calc set-cell A2 "WPS CLI" cli-anything-wps --project data.json calc set-range A3 -d '[["张三",28],["李四",35]]' cli-anything-wps --project data.json export render data.xlsx -p xlsx ``` -------------------------------- ### Render Citation Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Renders a citation using Zotero's Local API for a specific item key. ```bash cli-anything-zotero item citation --style apa --locale en-US --json ``` -------------------------------- ### cli-anything-zotero item citation Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Renders a citation for a specific Zotero item using the local API. ```APIDOC ## cli-anything-zotero item citation ### Description Render a citation using Zotero's Local API. ### Parameters - **item-key** (string) - Required - The unique identifier for the Zotero item. - **--style** (string) - Optional - Citation style (e.g., apa). - **--locale** (string) - Optional - Locale for the citation (e.g., en-US). ### Usage `cli-anything-zotero item citation --style apa --locale en-US --json` ``` -------------------------------- ### Backend Architecture Diagram Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/agent-harness/PHOTOSHOP.md Visual representation of the data flow from the CLI command to the Photoshop engine. ```text CLI 命令 → Click CLI 层 → Core 模块 → COM Bridge → Photoshop.Application COM → Photoshop 引擎 ``` -------------------------------- ### Read Collections and Items Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/README.md Retrieve collection contents, item details, or file paths. ```bash cli-anything-zotero --json collection items COLLAAAA cli-anything-zotero --json item get REG12345 cli-anything-zotero --json item attachments REG12345 cli-anything-zotero --json item file REG12345 ``` -------------------------------- ### 查看系统工作原理流程 Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md 描述了从 CLI 命令输入到 WPS Office 执行操作的完整调用链路。 ```text CLI 命令 (Click) │ ▼ Session 层 —— 撤销/重做/持久化 │ ▼ Core 模块 —— writer.py / calc.py / impress.py / export.py │ ▼ WPS Backend (wps_backend.py) —— COM 接口封装 │ ▼ COM 接口 —— KWPS / KET / KWPP.Application │ ▼ WPS Office —— 执行实际操作 ``` -------------------------------- ### Project Management Commands Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/skills/cli-anything-photoshop/SKILL.md Commands for managing PSD project files. ```APIDOC ## project ### Commands - **new ** - Create a new PSD. Options: -w (width), -h (height), -r (resolution), -m (mode), -b (bg-color). - **open ** - Open an existing PSD file. - **save [path]** - Save the current document. - **close** - Close the document. Option: --no-save. ``` -------------------------------- ### CLI Command Structure Source: https://github.com/yb2460/harness-anything/blob/master/photoshop-harness/skills/cli-anything-photoshop/SKILL.md The base structure for invoking commands via the cli-anything-photoshop tool. ```APIDOC ## CLI Command Structure ### Usage `cli-anything-photoshop [--json] [--project ] [--dry-run] [options]` ### Global Options - **--json** (flag) - Optional - Output results in JSON format for AI Agent parsing. - **--project ** (string) - Optional - Automatically open or create a PSD project file. - **--dry-run** (flag) - Optional - Execute commands without saving changes to disk. ``` -------------------------------- ### Execute project tests Source: https://github.com/yb2460/harness-anything/blob/master/CONTRIBUTING.md Run the test suite using pytest with verbose output. ```bash python -m pytest cli_anything/wps/tests/ -v ``` -------------------------------- ### 运行生成脚本 Source: https://github.com/yb2460/harness-anything/blob/master/WPS/README.md 清理WPS进程并执行Python生成脚本。 ```bash taskkill //F //IM wps.exe //T 2>/dev/null taskkill //F //IM wpp.exe //T 2>/dev/null python build_xxx.py ``` -------------------------------- ### Add Child Note Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Creates a child note under an existing Zotero item. ```bash cli-anything-zotero note add --text "Key takeaway" --json ``` -------------------------------- ### WPS PPT Automation Template and Engine Source: https://github.com/yb2460/harness-anything/blob/master/WPS/PPT制作/WPS-PPT自动化制作-完整工作流.md Defines slide content structure and executes the automation engine to generate PPTX and PDF files. Requires win32com and a properly configured environment with WPS Office. ```python # ---- S14: 致谢 ---- slides.append({'elements': [ {'type': 'shape', 'shape': 'rect', 'x': 0, 'y': 0, 'w': 960, 'h': 8, 'color': O}, {'type': 'shape', 'shape': 'rect', 'x': 0, 'y': 532, 'w': 960, 'h': 8, 'color': O}, {'type': 'text', 'x': 60, 'y': 60, 'w': 840, 'h': 48, 'text': '校训原文(拉丁/德文)', 'fs': 44, 'color': h2b(O), 'bold': True, 'align': 2, 'font': 'Arial'}, {'type': 'text', 'x': 60, 'y': 120, 'w': 840, 'h': 26, 'text': '「校训中文翻译」', 'fs': 26, 'color': h2b(O), 'bold': True, 'align': 2, 'font': FB}, {'type': 'text', 'x': 60, 'y': 160, 'w': 840, 'h': 24, 'text': 'University Name · 建校年份 — 当前年份', 'fs': 22, 'color': h2b(D), 'bold': True, 'align': 2, 'font': 'Arial'}, {'type': 'image', 'x': 80, 'y': 210, 'w': 800, 'h': 175, 'file': 'images/chart_nums.png'}, {'type': 'text', 'x': 60, 'y': 420, 'w': 840, 'h': 42, 'text': '数据来源:学校官网 · 排名机构 · 教育部数据库 · 公开媒体报道', 'fs': 14, 'color': h2b(G), 'bold': False, 'align': 2, 'font': FB}, ]}) # ====== 构建引擎(不要修改) ====== pythoncom.CoInitialize() app = win32com.client.Dispatch('KWPP.Application') app.Visible = True # 可见模式,方便目视检查 ppt = app.Presentations.Add() ppt.PageSetup.SlideWidth = 960 ppt.PageSetup.SlideHeight = 540 idx = [1] def new_slide(): s = ppt.Slides.Add(idx[0], 12) idx[0] += 1 try: s.FollowMasterBackground = False except: pass bg = os.path.join(OUT, 'template_bg.png') if os.path.exists(bg): s.Background.Fill.UserPicture(bg) return s for elist in slides: s = new_slide() for elem in elist['elements']: router = ROUTERS.get(elem.get('type', 'text')) if router: try: router(s, elem) except: pass pptx_path = os.path.join(OUT, 'output.pptx') ppt.SaveAs(pptx_path) print(f'PPTX saved: {os.path.getsize(pptx_path):,} bytes') pdf_path = os.path.join(OUT, 'output.pdf') try: ppt.SaveAs(pdf_path, 32) print(f'PDF saved: {os.path.getsize(pdf_path):,} bytes') except: print('PDF export failed') ppt.Close() try: app.Quit() except: pass # WPS COM Quit 报错可忽略 print('Done!') ``` -------------------------------- ### AI Agent mode Source: https://github.com/yb2460/harness-anything/blob/master/README_CN.md Use the --json flag to receive structured output for integration with AI agents. ```bash # 所有命令加 --json 返回结构化数据 cli-anything-wps --json document new --type writer --name "test" cli-anything-wps --json --project test.json session status ``` -------------------------------- ### Manage Academic Research Skills Source: https://github.com/yb2460/harness-anything/blob/master/cli_anything/zotero/skills/SKILL.md Commands to list available skills and execute research workflows. ```bash cli-anything-zotero skills list # List all skills cli-anything-zotero skills list -c writing # Writing skills only cli-anything-zotero skills pipeline original_article # Recommended workflow cli-anything-zotero skills journal "Nature" # Journal figure guide ```