mdedit-cli 0.1.3 → 0.2.1

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/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # `mdedit-cli`
2
2
 
3
- Command-line interface for mdedit.ai.
3
+ Official command-line interface for [mdedit.ai](https://mdedit.ai).
4
+
5
+ Links:
6
+ - [CLI docs](https://docs.mdedit.ai/cli)
7
+ - [mdedit.ai homepage](https://mdedit.ai)
4
8
 
5
9
  ## Install
6
10
 
@@ -12,7 +16,7 @@ npm install -g mdedit-cli
12
16
 
13
17
  All APIs require authentication. Create an API key here:
14
18
 
15
- - https://docs.mdedit.ai/api-keys
19
+ - [API key docs](https://docs.mdedit.ai/api-keys)
16
20
 
17
21
  ## Configure
18
22
 
@@ -37,3 +41,87 @@ mdedit info
37
41
  mdedit health
38
42
  ```
39
43
 
44
+ ## One-shot article edits
45
+
46
+ Apply a unique text replacement through the same article session used by live collaborators:
47
+
48
+ ```bash
49
+ mdedit article edit <articleId> --replace "old text" --with "new text"
50
+ mdedit article edit <articleId> --ops-file ops.json --format json
51
+ ```
52
+
53
+ An ops file is a non-empty JSON array of `replace`, `insert`, or `delete` operations with
54
+ quote, heading, section, or range anchors. The command exits `2` when an anchor is missing,
55
+ `3` when an anchor is ambiguous, and `4` when an edit conflict is reported. In JSON mode,
56
+ the result or typed error is the only value written to stdout.
57
+
58
+ ## Review commands
59
+
60
+ Review agents can comment and suggest with `articles:read,reviews:write`; accepting a
61
+ suggestion also requires `articles:write` because it changes article text.
62
+
63
+ ```bash
64
+ mdedit review list <articleId> --status open --format json
65
+ mdedit review add <articleId> --quote "claim" --body "Needs a source."
66
+ mdedit review reply <articleId> --thread <reviewId> --body "Fixed."
67
+ mdedit review resolve <articleId> --thread <reviewId>
68
+ mdedit suggest <articleId> --quote "teh" --replace "the" --note "Typo"
69
+ ```
70
+
71
+ One-shot review commands use the REST review resources directly, so listing or commenting
72
+ does not open a metered collaboration WebSocket. Mutations always use the
73
+ server-authoritative `review-commands` API.
74
+
75
+ ## Watch an article
76
+
77
+ Keep an article session open and stream newline-delimited JSON for agent loops:
78
+
79
+ ```bash
80
+ mdedit article watch <articleId>
81
+ mdedit article watch <articleId> --workspace <workspaceId> --agent claude-code
82
+ mdedit article watch <articleId> --poll-interval 5000
83
+ ```
84
+
85
+ Each stdout line is one complete JSON event. The stream starts with `session.ready`,
86
+ then reports article changes, review history events, and review snapshots. `Ctrl+C`
87
+ closes the live session cleanly. Non-collaborative articles use REST polling.
88
+
89
+ ## Agent / AI tool integration
90
+
91
+ The CLI is designed to be used by AI agents without modification.
92
+
93
+ ### Agent tips
94
+
95
+ - Use `--format json` for machine-readable output (human messages go to stderr)
96
+ - Pass all required flags on the command line to avoid interactive prompts
97
+ - Use `--yes` on destructive commands to skip confirmation
98
+ - Pipe content via `--file -` (stdin) or `--content-only` (stdout)
99
+
100
+ ### Skill file
101
+
102
+ A comprehensive agent skill document is included with the CLI. It covers all commands, flags, workflows, and error handling in a format optimised for AI agents (Claude Code, Cursor, GitHub Copilot, etc.).
103
+
104
+ ```bash
105
+ # View the skill
106
+ mdedit skill show
107
+
108
+ # Install the skill into all detected agent config files
109
+ mdedit skill install
110
+
111
+ # Install into a specific tool only
112
+ mdedit skill install --target claude # → CLAUDE.md
113
+ mdedit skill install --target cursor # → .cursor/rules/mdedit.mdc
114
+ mdedit skill install --target codex # → .github/copilot-instructions.md
115
+
116
+ # Install to home-directory (global) targets
117
+ mdedit skill install --global
118
+ ```
119
+
120
+ ### OpenClaw plugin
121
+
122
+ An `openclaw.json` plugin manifest is included in the package. It defines every CLI tool as a structured, machine-readable entry that OpenClaw-compatible agents can load directly.
123
+
124
+ ```bash
125
+ # Find the plugin manifest
126
+ node -e "console.log(require.resolve('mdedit-cli/openclaw.json'))"
127
+ ```