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/openclaw.json ADDED
@@ -0,0 +1,360 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "name": "mdedit",
4
+ "display_name": "MDEdit.ai",
5
+ "description": "Manage articles, reviews, suggestions, folders, workspaces, and API keys on mdedit.ai from any AI agent. Supports server-authoritative review workflows, markdown editing, and JSON output.",
6
+ "homepage_url": "https://mdedit.ai",
7
+ "docs_url": "https://docs.mdedit.ai/cli",
8
+ "auth": {
9
+ "type": "env",
10
+ "env_var": "MDEDIT_API_KEY",
11
+ "instructions": "Set MDEDIT_API_KEY to your mdedit.ai API key. Get one at https://docs.mdedit.ai/api-keys"
12
+ },
13
+ "setup": {
14
+ "command": "npm install -g mdedit-cli",
15
+ "verify": "mdedit --version",
16
+ "configure": "mdedit config login --api-key $MDEDIT_API_KEY"
17
+ },
18
+ "global_flags": {
19
+ "--format <plain|table|json>": "Output format. Use json for agents (human messages go to stderr).",
20
+ "--api-key <key>": "Override API key for this invocation (or set MDEDIT_API_KEY).",
21
+ "--workspace <id>": "Override default workspace for this invocation (or set MDEDIT_WORKSPACE_ID).",
22
+ "--api-url <url>": "Override API base URL (default: https://apiv2.mdedit.ai).",
23
+ "--local": "Use local API at http://localhost:8080.",
24
+ "--debug": "Print debug info and stack traces."
25
+ },
26
+ "tools": [
27
+ {
28
+ "name": "config_show",
29
+ "description": "Show current CLI configuration (effective values including env overrides).",
30
+ "command": "mdedit config show --format json",
31
+ "example": "mdedit config show --format json"
32
+ },
33
+ {
34
+ "name": "config_use_workspace",
35
+ "description": "Set the default workspace for workspace-scoped commands.",
36
+ "command": "mdedit config use-workspace <workspaceId>",
37
+ "example": "mdedit config use-workspace ws-123"
38
+ },
39
+ {
40
+ "name": "article_list",
41
+ "description": "List all articles in a workspace, optionally filtered by folder",
42
+ "command": "mdedit article list --format json",
43
+ "flags": {
44
+ "--workspace <id>": "Workspace ID",
45
+ "--folder <id>": "Filter by folder ID",
46
+ "--limit <n>": "Limit results (client-side)",
47
+ "--offset <n>": "Offset for pagination"
48
+ },
49
+ "example": "mdedit article list --format json --limit 20"
50
+ },
51
+ {
52
+ "name": "article_get_metadata",
53
+ "description": "Get article metadata (markdown content is omitted unless requested).",
54
+ "command": "mdedit article get <articleId> --format json",
55
+ "flags": {
56
+ "--include-content": "Include markdown content in the output object",
57
+ "--full": "Show full raw article object",
58
+ "--workspace <id>": "Workspace ID"
59
+ },
60
+ "example": "mdedit article get abc123 --format json"
61
+ },
62
+ {
63
+ "name": "article_get_markdown",
64
+ "description": "Print only the article markdown to stdout (useful for piping / agents).",
65
+ "command": "mdedit article get <articleId> --content-only",
66
+ "flags": {
67
+ "--workspace <id>": "Workspace ID"
68
+ },
69
+ "example": "mdedit article get abc123 --content-only"
70
+ },
71
+ {
72
+ "name": "article_create",
73
+ "description": "Create a new article, optionally with initial markdown content from file or inline string",
74
+ "command": "mdedit article create --title <title> --format json",
75
+ "flags": {
76
+ "--title <title>": "Article title (required)",
77
+ "--folder <id>": "Place in a folder",
78
+ "--file <path>": "Read initial content from file (use - for stdin)",
79
+ "--content <text>": "Inline content string",
80
+ "--workspace <id>": "Workspace ID"
81
+ },
82
+ "example": "echo '# Hello' | mdedit article create --title 'My Post' --file - --format json"
83
+ },
84
+ {
85
+ "name": "article_update",
86
+ "description": "Update an article's title, metadata, or markdown content",
87
+ "command": "mdedit article update <articleId> --format json",
88
+ "flags": {
89
+ "--title <title>": "New title",
90
+ "--file <path>": "Replace content from file (use - for stdin)",
91
+ "--content <text>": "Replace content with inline string",
92
+ "--archive": "Archive the article",
93
+ "--pin": "Pin the article",
94
+ "--workspace <id>": "Workspace ID"
95
+ },
96
+ "example": "cat updated.md | mdedit article update abc123 --file -"
97
+ },
98
+ {
99
+ "name": "article_edit",
100
+ "description": "Apply anchored one-shot edits through a live collaboration session or conditional REST fallback.",
101
+ "command": "mdedit article edit <articleId> --format json",
102
+ "flags": {
103
+ "--replace <text>": "Unique text to replace (requires --with)",
104
+ "--with <text>": "Replacement text (requires --replace)",
105
+ "--ops-file <path>": "JSON array of replace, insert, or delete operations",
106
+ "--workspace <id>": "Workspace ID"
107
+ },
108
+ "exit_codes": {
109
+ "2": "ANCHOR_NOT_FOUND",
110
+ "3": "AMBIGUOUS_ANCHOR",
111
+ "4": "EDIT_CONFLICT; re-read before continuing"
112
+ },
113
+ "example": "mdedit article edit abc123 --replace 'old text' --with 'new text' --format json"
114
+ },
115
+ {
116
+ "name": "article_delete",
117
+ "description": "Delete an article (non-reversible)",
118
+ "command": "mdedit article delete <articleId> --yes",
119
+ "flags": {
120
+ "--yes": "Skip confirmation prompt (required for non-interactive agents)"
121
+ },
122
+ "example": "mdedit article delete abc123 --yes"
123
+ },
124
+ {
125
+ "name": "review_list",
126
+ "description": "List review comments, highlights, and suggestions from the live article session or REST fallback.",
127
+ "command": "mdedit review list <articleId> --format json",
128
+ "flags": {
129
+ "--status <status>": "Filter by review status",
130
+ "--target <file.md>": "Markdown target (default: content.md)",
131
+ "--workspace <id>": "Workspace ID"
132
+ },
133
+ "example": "mdedit review list abc123 --status open --format json"
134
+ },
135
+ {
136
+ "name": "review_add",
137
+ "description": "Add a server-authored review comment anchored to quoted text.",
138
+ "command": "mdedit review add <articleId> --quote <text> --body <text> --format json",
139
+ "flags": {
140
+ "--occurrence <n>": "One-based occurrence when the quote repeats",
141
+ "--before <text>": "Context immediately before the quote",
142
+ "--after <text>": "Context immediately after the quote",
143
+ "--target <file.md>": "Markdown target"
144
+ },
145
+ "example": "mdedit review add abc123 --quote 'claim' --body 'Needs a source.' --format json"
146
+ },
147
+ {
148
+ "name": "review_reply",
149
+ "description": "Reply to a review thread.",
150
+ "command": "mdedit review reply <articleId> --thread <reviewId> --body <text> --format json",
151
+ "example": "mdedit review reply abc123 --thread c_123 --body 'Fixed.' --format json"
152
+ },
153
+ {
154
+ "name": "review_decide",
155
+ "description": "Resolve, reopen, accept, or reject a review thread. Accept requires articles:write.",
156
+ "command": "mdedit review <resolve|reopen|accept|reject> <articleId> --thread <reviewId> --format json",
157
+ "example": "mdedit review resolve abc123 --thread c_123 --format json"
158
+ },
159
+ {
160
+ "name": "review_delete",
161
+ "description": "Delete a review item or one reply owned by the authenticated reviewer.",
162
+ "command": "mdedit review delete <articleId> --thread <reviewId> --format json",
163
+ "flags": {
164
+ "--reply <replyId>": "Delete only this reply"
165
+ },
166
+ "example": "mdedit review delete abc123 --thread c_123 --reply r_456 --format json"
167
+ },
168
+ {
169
+ "name": "suggest",
170
+ "description": "Create a safe replacement suggestion without directly changing article text.",
171
+ "command": "mdedit suggest <articleId> --quote <text> --replace <text> --format json",
172
+ "flags": {
173
+ "--note <text>": "Optional explanation",
174
+ "--occurrence <n>": "One-based occurrence when the quote repeats",
175
+ "--target <file.md>": "Markdown target"
176
+ },
177
+ "example": "mdedit suggest abc123 --quote 'teh' --replace 'the' --note 'Typo' --format json"
178
+ },
179
+ {
180
+ "name": "article_export",
181
+ "description": "Export an article as a ZIP archive",
182
+ "command": "mdedit article export <articleId>",
183
+ "flags": {
184
+ "--output <path>": "Output file path (default: article.zip)"
185
+ },
186
+ "example": "mdedit article export abc123 --output my-article.zip"
187
+ },
188
+ {
189
+ "name": "folder_list",
190
+ "description": "List folders in a workspace",
191
+ "command": "mdedit folder list --format json",
192
+ "flags": {
193
+ "--workspace <id>": "Workspace ID",
194
+ "--include-deleted": "Include deleted/tombstoned folders"
195
+ },
196
+ "example": "mdedit folder list --format json"
197
+ },
198
+ {
199
+ "name": "folder_get",
200
+ "description": "Get details of a folder.",
201
+ "command": "mdedit folder get <folderId> --format json",
202
+ "flags": {
203
+ "--workspace <id>": "Workspace ID",
204
+ "--full": "Show full raw folder object"
205
+ },
206
+ "example": "mdedit folder get fld-123 --format json"
207
+ },
208
+ {
209
+ "name": "folder_create",
210
+ "description": "Create a new folder",
211
+ "command": "mdedit folder create --name <name> --format json",
212
+ "flags": {
213
+ "--name <name>": "Folder name (required)",
214
+ "--parent <id>": "Parent folder ID for nesting",
215
+ "--workspace <id>": "Workspace ID"
216
+ },
217
+ "example": "mdedit folder create --name 'Blog Posts' --format json"
218
+ },
219
+ {
220
+ "name": "folder_update",
221
+ "description": "Update a folder (e.g., rename).",
222
+ "command": "mdedit folder update <folderId> --name <name> --format json",
223
+ "flags": {
224
+ "--name <name>": "New name",
225
+ "--workspace <id>": "Workspace ID"
226
+ },
227
+ "example": "mdedit folder update fld-123 --name 'Archive' --format json"
228
+ },
229
+ {
230
+ "name": "folder_delete",
231
+ "description": "Delete a folder",
232
+ "command": "mdedit folder delete <folderId> --yes",
233
+ "flags": {
234
+ "--yes": "Skip confirmation"
235
+ },
236
+ "example": "mdedit folder delete fld123 --yes"
237
+ },
238
+ {
239
+ "name": "workspace_list",
240
+ "description": "List all workspaces accessible with the current API key",
241
+ "command": "mdedit workspace list --format json",
242
+ "example": "mdedit workspace list --format json"
243
+ },
244
+ {
245
+ "name": "workspace_get",
246
+ "description": "Get details of a specific workspace",
247
+ "command": "mdedit workspace get <workspaceId> --format json",
248
+ "example": "mdedit workspace get ws123 --format json"
249
+ },
250
+ {
251
+ "name": "workspace_create",
252
+ "description": "Create a new workspace.",
253
+ "command": "mdedit workspace create --name <name> --type <user|team> --format json",
254
+ "flags": {
255
+ "--name <name>": "Workspace name (required)",
256
+ "--type <user|team>": "Workspace type"
257
+ },
258
+ "example": "mdedit workspace create --name 'My Workspace' --type user --format json"
259
+ },
260
+ {
261
+ "name": "workspace_update",
262
+ "description": "Update a workspace (e.g., rename).",
263
+ "command": "mdedit workspace update <workspaceId> --name <name> --format json",
264
+ "flags": {
265
+ "--name <name>": "New name"
266
+ },
267
+ "example": "mdedit workspace update ws-123 --name 'New Name' --format json"
268
+ },
269
+ {
270
+ "name": "workspace_delete",
271
+ "description": "Delete a workspace.",
272
+ "command": "mdedit workspace delete <workspaceId> --yes",
273
+ "flags": {
274
+ "--yes": "Skip confirmation"
275
+ },
276
+ "example": "mdedit workspace delete ws-123 --yes"
277
+ },
278
+ {
279
+ "name": "apikey_list",
280
+ "description": "List API keys associated with the authenticated account",
281
+ "command": "mdedit apikey list --format json",
282
+ "example": "mdedit apikey list --format json"
283
+ },
284
+ {
285
+ "name": "apikey_create",
286
+ "description": "Create a new API key",
287
+ "command": "mdedit apikey create --name <name> --format json",
288
+ "flags": {
289
+ "--name <name>": "Key name (required)",
290
+ "--description <desc>": "Key description",
291
+ "--expires <days>": "Expiration in days"
292
+ },
293
+ "example": "mdedit apikey create --name 'CI/CD Key' --expires 90 --format json"
294
+ },
295
+ {
296
+ "name": "apikey_revoke",
297
+ "description": "Revoke an API key by its ID",
298
+ "command": "mdedit apikey revoke <keyId> --yes",
299
+ "flags": {
300
+ "--yes": "Skip confirmation"
301
+ },
302
+ "example": "mdedit apikey revoke key123 --yes"
303
+ },
304
+ {
305
+ "name": "health",
306
+ "description": "Check the mdedit API health status",
307
+ "command": "mdedit health --format json",
308
+ "example": "mdedit health --format json"
309
+ },
310
+ {
311
+ "name": "info",
312
+ "description": "Display CLI version, API URL, workspace, and authentication status",
313
+ "command": "mdedit info --format json",
314
+ "example": "mdedit info"
315
+ },
316
+ {
317
+ "name": "skill_show",
318
+ "description": "Print the full mdedit agent skill/documentation to stdout",
319
+ "command": "mdedit skill show",
320
+ "example": "mdedit skill show"
321
+ },
322
+ {
323
+ "name": "skill_install",
324
+ "description": "Install the mdedit skill into agent configuration files (Claude Code, Cursor, GitHub Copilot/Codex).",
325
+ "command": "mdedit skill install",
326
+ "flags": {
327
+ "--target <claude|cursor|codex|all>": "Which agent tool to install for (default: all)",
328
+ "--global": "Install to home-directory targets instead of the current project"
329
+ },
330
+ "example": "mdedit skill install --target codex"
331
+ }
332
+ ],
333
+ "workflows": {
334
+ "read_and_update_article": [
335
+ "CONTENT=$(mdedit article get <articleId> --content-only)",
336
+ "echo \"$MODIFIED_CONTENT\" | mdedit article update <articleId> --file -"
337
+ ],
338
+ "anchored_article_edit": [
339
+ "mdedit article edit <articleId> --replace 'old text' --with 'new text' --format json",
340
+ "On exit 4, re-read the article before continuing"
341
+ ],
342
+ "review_article": [
343
+ "mdedit review list <articleId> --status open --format json",
344
+ "mdedit review add <articleId> --quote 'claim' --body 'Needs a source.' --format json",
345
+ "mdedit suggest <articleId> --quote 'teh' --replace 'the' --note 'Typo' --format json"
346
+ ],
347
+ "create_article_in_folder": [
348
+ "mdedit folder list --format json",
349
+ "mdedit article create --title 'New Post' --folder <folderId> --file content.md --format json"
350
+ ],
351
+ "bulk_export": [
352
+ "mdedit article list --format json > articles.json"
353
+ ],
354
+ "setup_fresh_environment": [
355
+ "mdedit config login --api-key $MDEDIT_API_KEY",
356
+ "mdedit workspace list --format json",
357
+ "mdedit config use-workspace <workspaceId>"
358
+ ]
359
+ }
360
+ }
package/package.json CHANGED
@@ -1,9 +1,21 @@
1
1
  {
2
2
  "name": "mdedit-cli",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command-line interface for mdedit.ai.",
7
+ "keywords": [
8
+ "mdedit",
9
+ "markdown",
10
+ "cli",
11
+ "markdown-editor",
12
+ "documentation",
13
+ "technical-writing",
14
+ "automation",
15
+ "ai",
16
+ "agent",
17
+ "terminal"
18
+ ],
7
19
  "license": "Apache-2.0",
8
20
  "engines": {
9
21
  "node": ">=20"
@@ -14,6 +26,8 @@
14
26
  "files": [
15
27
  "bin",
16
28
  "dist",
29
+ "skill.md",
30
+ "openclaw.json",
17
31
  "README.md",
18
32
  "LICENSE"
19
33
  ],
@@ -25,19 +39,22 @@
25
39
  "prepack": "yarn build"
26
40
  },
27
41
  "dependencies": {
28
- "@mdedit/sdk": "^0.1.2",
42
+ "@mdedit/agent-client": "0.1.0",
43
+ "@mdedit/sdk": "0.2.1",
29
44
  "chalk": "^5.6.2",
30
45
  "commander": "^14.0.3",
31
46
  "inquirer": "^8.2.7",
32
47
  "uuid": "^10.0.0"
33
48
  },
34
49
  "devDependencies": {
50
+ "@hocuspocus/server": "^4.2.0",
35
51
  "@types/inquirer": "^8.2.12",
36
52
  "@types/node": "^20.10.5",
37
53
  "@types/uuid": "^10.0.0",
38
54
  "tsup": "^8.0.2",
39
55
  "tsx": "^4.7.0",
40
56
  "typescript": "^5.3.3",
41
- "vitest": "^1.6.1"
57
+ "vitest": "^1.6.1",
58
+ "yjs": "^13.6.0"
42
59
  }
43
60
  }