docx-processing-superdoc
npx machina-cli add skill lawvable/awesome-legal-skills/docx-processing-superdoc --openclawFiles (1)
SKILL.md
1.3 KB
SuperDoc CLI
Edit Word documents from the command line. Use instead of python-docx.
Commands
| Command | Description |
|---|---|
npx @superdoc-dev/cli@latest search <pattern> <files...> | Find text across documents |
npx @superdoc-dev/cli@latest replace <find> <to> <files...> | Find and replace text |
npx @superdoc-dev/cli@latest read <file> | Extract plain text |
When to Use
Use superdoc when the user asks to:
- Search text in .docx files
- Find and replace text in Word documents
- Extract text content from .docx files
- Bulk edit multiple Word documents
Examples
# Search across documents
npx @superdoc-dev/cli@latest search "indemnification" ./contracts/*.docx
# Find and replace
npx @superdoc-dev/cli@latest replace "ACME Corp" "Globex Inc" ./merger/*.docx
# Extract text
npx @superdoc-dev/cli@latest read ./proposal.docx
# JSON output for scripting
npx @superdoc-dev/cli@latest search "Article 7" ./**/*.docx --json
Options
--json— Machine-readable output--help— Show help
Source
git clone https://github.com/lawvable/awesome-legal-skills/blob/main/skills/docx-processing-superdoc/SKILL.mdView on GitHub Overview
SuperDoc CLI lets you search, replace, and read text in Word documents from the command line. It serves as a drop-in alternative to python-docx for editing .docx files and supports bulk operations across many documents. Use it to quickly batch-edit, extract, or analyze text in Word files.
How This Skill Works
Invoke the CLI via npx @superdoc-dev/cli@latest with one of three commands: search, replace, or read. You pass a pattern and one or more .docx files (glob patterns are supported) and the tool performs the requested operation. For scripting, add --json to get machine-readable output.
When to Use It
- Search text across .docx documents
- Find and replace text in Word documents
- Extract plain text from a .docx file
- Bulk edit multiple Word documents
- Prepare text for analysis by extracting terms from many files
Quick Start
- Step 1: Run the CLI with no install using npx
- Step 2: Run a search across documents, e.g. npx @superdoc-dev/cli@latest search "pattern" <files...>
- Step 3: Use read or replace to extract text or modify files; add --json for machine-readable output
Best Practices
- Test replacements on a small set of files before applying to many documents
- Back up originals prior to bulk edits
- Use glob patterns (e.g., ./contracts/*.docx) to target multiple files efficiently
- When scripting, use --json for predictable output
- Quote complex search/replace terms to avoid shell interpretation
Example Use Cases
- npx @superdoc-dev/cli@latest search "indemnification" ./contracts/*.docx
- npx @superdoc-dev/cli@latest replace "ACME Corp" "Globex Inc" ./merger/*.docx
- npx @superdoc-dev/cli@latest read ./proposal.docx
- npx @superdoc-dev/cli@latest search "Article 7" ./**/*.docx --json
- npx @superdoc-dev/cli@latest read ./proposal.docx --json
Frequently Asked Questions
Add this skill to your agents