@docyrus/docyrus 0.0.33 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +136 -11
- package/main.js.map +3 -3
- package/package.json +1 -1
- package/resources/pi-agent/skills/officecli/SKILL.md +113 -0
package/package.json
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: officecli
|
|
3
|
+
description: Use OfficeCLI to create, inspect, validate, and modify Office documents (.docx, .xlsx, .pptx) from the terminal. Use when the user wants Office document automation, extraction, validation, or editing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OfficeCLI
|
|
7
|
+
|
|
8
|
+
OfficeCLI is available in Docyrus pi sessions as a local command-line tool for Word, Excel, and PowerPoint files.
|
|
9
|
+
|
|
10
|
+
Use the CLI directly in this environment. Do not run `officecli mcp ...` unless the user explicitly asks to register OfficeCLI with another editor or agent.
|
|
11
|
+
|
|
12
|
+
## First Principles
|
|
13
|
+
|
|
14
|
+
- Prefer structured output by adding `--json` whenever you need to inspect or transform results.
|
|
15
|
+
- Work from higher-level commands down:
|
|
16
|
+
- L1 read and inspection: `view`, `get`, `query`, `validate`
|
|
17
|
+
- L2 DOM edits: `set`, `add`, `remove`, `move`, `batch`
|
|
18
|
+
- L3 raw XML fallback: `raw`, `raw-set`, `add-part`
|
|
19
|
+
- When unsure about element names, property names, or allowed value formats, run help instead of guessing.
|
|
20
|
+
- After making changes, run `officecli validate <file>` and, when useful, `officecli view <file> issues`.
|
|
21
|
+
- For multi-step edits on a single file, use `open` and `close` to keep the document in memory.
|
|
22
|
+
|
|
23
|
+
## Verify Availability
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
officecli --version
|
|
27
|
+
officecli --help
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If a command fails unexpectedly, inspect the help for the specific document type before trying alternatives.
|
|
31
|
+
|
|
32
|
+
## Help-First Workflow
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
officecli docx set
|
|
36
|
+
officecli docx set paragraph
|
|
37
|
+
officecli xlsx set cell.value
|
|
38
|
+
officecli pptx add chart
|
|
39
|
+
officecli pptx query
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use the deepest help entry you already know. One help lookup is better than guessing and retrying.
|
|
43
|
+
|
|
44
|
+
## Common Commands
|
|
45
|
+
|
|
46
|
+
Create a new document:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
officecli create report.docx
|
|
50
|
+
officecli create model.xlsx
|
|
51
|
+
officecli create deck.pptx
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Inspect document structure or extracted text:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
officecli view report.docx outline
|
|
58
|
+
officecli view report.docx text --max-lines 80
|
|
59
|
+
officecli view deck.pptx issues
|
|
60
|
+
officecli get deck.pptx /slide[1] --depth 1 --json
|
|
61
|
+
officecli query model.xlsx 'cell[value~=Revenue]' --json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Modify content:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
officecli set report.docx /body/p[1] --prop style=Heading1 --prop text="Executive Summary"
|
|
68
|
+
officecli add deck.pptx / --type slide --prop title="Q4 Report"
|
|
69
|
+
officecli add deck.pptx /slide[1] --type shape --prop text="Revenue grew 25%" --prop x=2cm --prop y=5cm
|
|
70
|
+
officecli set model.xlsx /Sheet1/A1 --prop value="Name" --prop bold=true
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Batch related changes:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
echo '[{"command":"set","path":"/Sheet1/A1","props":{"value":"Name","bold":"true"}},{"command":"set","path":"/Sheet1/B1","props":{"value":"Score","bold":"true"}}]' | officecli batch model.xlsx --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Keep a document open for a longer edit session:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
officecli open report.docx
|
|
83
|
+
officecli set report.docx /body/p[2] --prop text="Updated paragraph"
|
|
84
|
+
officecli close report.docx
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Practical Guidance
|
|
88
|
+
|
|
89
|
+
- Prefer `view`, `get`, or `query` to understand the document before editing it.
|
|
90
|
+
- Use `query` to locate matching elements instead of hard-coding guessed paths.
|
|
91
|
+
- Keep outputs bounded for large files with flags such as `--max-lines`, `--start`, or `--end`.
|
|
92
|
+
- Path indexing is 1-based: `/body/p[3]` means the third paragraph.
|
|
93
|
+
- Use `batch` when several changes should be applied in one save cycle.
|
|
94
|
+
- Use `watch` for PowerPoint only when the user explicitly wants a live preview flow.
|
|
95
|
+
|
|
96
|
+
## When Raw XML Is Appropriate
|
|
97
|
+
|
|
98
|
+
Only fall back to `raw` or `raw-set` when:
|
|
99
|
+
|
|
100
|
+
- the higher-level commands cannot express the change,
|
|
101
|
+
- you already inspected the target part with `get` or `raw`,
|
|
102
|
+
- and you are prepared to validate immediately afterwards.
|
|
103
|
+
|
|
104
|
+
## Validation Checklist
|
|
105
|
+
|
|
106
|
+
After editing:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
officecli validate <file>
|
|
110
|
+
officecli view <file> issues
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If validation fails, fix the issue before presenting the result as complete.
|