mdedit-cli
Advanced tools
+23
-9
@@ -73,3 +73,3 @@ { | ||
| "name": "article_create", | ||
| "description": "Create a new article, optionally with initial markdown content from file or inline string", | ||
| "description": "Create a new article, optionally with initial markdown content and a Live public link.", | ||
| "command": "mdedit article create --title <title> --format json", | ||
@@ -81,13 +81,14 @@ "flags": { | ||
| "--content <text>": "Inline content string", | ||
| "--publish": "Publish the created article to a public mded.it link", | ||
| "--publish": "Publish the created article to a Live public mded.it link without confirmation", | ||
| "--snapshot": "Publish a frozen Snapshot instead of a Live link (requires --publish)", | ||
| "--live": "Explicitly publish a Live link (requires --publish)", | ||
| "--slug <slug>": "Custom public-link slug (requires --publish)", | ||
| "--yes": "Skip public-publishing confirmation", | ||
| "--workspace <id>": "Workspace ID" | ||
| }, | ||
| "example": "mdedit article create --title 'My Post' --file post.md --publish --yes --format json" | ||
| "example": "mdedit article create --title 'My Post' --file post.md --publish --format json" | ||
| }, | ||
| { | ||
| "name": "article_publish", | ||
| "description": "Publish or update an article at a public mded.it link. Requires publishing:write.", | ||
| "command": "mdedit article publish <articleId> --yes --format json", | ||
| "description": "Publish or update an article at a stable public mded.it link. New links default Live; existing links preserve their stored mode. Requires publishing:write.", | ||
| "command": "mdedit article publish <articleId> --format json", | ||
| "flags": { | ||
@@ -97,10 +98,11 @@ "--slug <slug>": "Custom public-link slug", | ||
| "--seo-description <description>": "SEO/social description for the public page", | ||
| "--yes": "Confirm that anyone with the link may view the document", | ||
| "--snapshot": "Create or switch to a frozen Snapshot", | ||
| "--live": "Create or switch to a Live link that follows durable edits", | ||
| "--workspace <id>": "Workspace ID" | ||
| }, | ||
| "example": "mdedit article publish abc123 --slug public-draft --yes --format json" | ||
| "example": "mdedit article publish abc123 --slug public-draft --format json" | ||
| }, | ||
| { | ||
| "name": "article_publish_status", | ||
| "description": "Get an article's public-link status, URL, metadata, and view count. Requires publishing:read.", | ||
| "description": "Get an article's stable public URL, mode, source revision/version, synchronization status/error, metadata, and view count. Requires publishing:read.", | ||
| "command": "mdedit article publish-status <articleId> --format json", | ||
@@ -378,2 +380,14 @@ "flags": { | ||
| ], | ||
| "create_live_public_link": [ | ||
| "mdedit article create --file document.md --publish --format json", | ||
| "Read publication.shortUrl, publication.mode, publication.sourceVersionId, and publication.syncStatus" | ||
| ], | ||
| "publish_frozen_snapshot": [ | ||
| "mdedit article publish <articleId> --snapshot --format json", | ||
| "Run article publish again to update the frozen content" | ||
| ], | ||
| "upgrade_legacy_snapshot": [ | ||
| "mdedit article publish-status <articleId> --format json", | ||
| "mdedit article publish <articleId> --live --format json" | ||
| ], | ||
| "bulk_export": [ | ||
@@ -380,0 +394,0 @@ "mdedit article list --format json > articles.json" |
+3
-3
| { | ||
| "name": "mdedit-cli", | ||
| "version": "0.3.3", | ||
| "version": "0.3.4", | ||
| "private": false, | ||
@@ -47,4 +47,4 @@ "type": "module", | ||
| "dependencies": { | ||
| "@mdedit/agent-client": "1.0.2", | ||
| "@mdedit/sdk": "0.3.3", | ||
| "@mdedit/agent-client": "1.0.3", | ||
| "@mdedit/sdk": "0.3.4", | ||
| "@napi-rs/keyring": "^1.3.0", | ||
@@ -51,0 +51,0 @@ "chalk": "^5.6.2", |
+23
-10
@@ -73,8 +73,10 @@ # `mdedit-cli` | ||
| Use a key with `publishing:write` to publish or update a public snapshot. Publishing is | ||
| explicit: later edits stay private until the command is run again. | ||
| Use a key with `publishing:write` to create a public `mded.it` link. New links are | ||
| **Live** by default: later durable document edits update the same URL automatically. | ||
| Use `--snapshot` for a frozen artifact that changes only when you publish again. | ||
| ```bash | ||
| mdedit article publish <articleId> --yes | ||
| mdedit article publish <articleId> --slug my-document --yes | ||
| mdedit article publish <articleId> | ||
| mdedit article publish <articleId> --snapshot | ||
| mdedit article publish <articleId> --slug my-document | ||
| mdedit article publish-status <articleId> --format json | ||
@@ -84,3 +86,4 @@ mdedit article unpublish <articleId> --yes | ||
| Create a document from Markdown and publish it in one command: | ||
| Create a document from Markdown and publish a Live link in one command, without a | ||
| confirmation flag: | ||
@@ -90,11 +93,21 @@ ```bash | ||
| --file document.md \ | ||
| --publish \ | ||
| --yes | ||
| --publish | ||
| ``` | ||
| Without `--title`, the CLI uses the first Markdown H1 or the filename. | ||
| The JSON result includes `publication.shortUrl`, such as | ||
| `https://mded.it/my-document`. If article creation succeeds but publishing fails, the | ||
| article is kept private and the command reports its article ID. | ||
| The JSON result includes the stable URL, `mode`, source revision/version fields, and | ||
| `syncStatus` under `publication`. `publish-status --format json` returns the same | ||
| synchronization metadata and `syncError` when a Live update fails. | ||
| Publishing an existing link without `--live` or `--snapshot` preserves its stored | ||
| mode. Use `--live` or `--snapshot` to switch deliberately; the URL does not change. | ||
| Links created before Live mode remain Snapshots until explicitly switched: | ||
| ```bash | ||
| mdedit article publish <articleId> --live | ||
| ``` | ||
| If article creation succeeds but publishing fails, the article is kept private and | ||
| the command reports its article ID. | ||
| ## Review commands | ||
@@ -101,0 +114,0 @@ |
+28
-4
@@ -97,3 +97,4 @@ # mdedit CLI — Agent Skill | ||
| echo "# Hello" | mdedit article create --title "My Article" --file - | ||
| mdedit article create --file article.md --publish --yes | ||
| mdedit article create --file article.md --publish # new Live public link | ||
| mdedit article create --file article.md --publish --snapshot | ||
@@ -116,5 +117,7 @@ # Update | ||
| # Publish a deliberate public snapshot (requires publishing:write) | ||
| mdedit article publish <articleId> --yes | ||
| mdedit article publish <articleId> --slug my-document --yes | ||
| # Publish a public link (requires publishing:write) | ||
| mdedit article publish <articleId> # new links default Live | ||
| mdedit article publish <articleId> --snapshot # frozen artifact | ||
| mdedit article publish <articleId> --live # switch existing link to Live | ||
| mdedit article publish <articleId> --slug my-document | ||
| mdedit article publish-status <articleId> --format json | ||
@@ -245,2 +248,23 @@ mdedit article unpublish <articleId> --yes | ||
| ### Workflow: publish and monitor a public link | ||
| CLI publication is non-interactive. A new link defaults to **Live**, so later durable | ||
| edits update the same URL automatically. Use `--snapshot` for a frozen artifact. | ||
| Existing links keep their stored mode when neither mode flag is passed; use `--live` | ||
| or `--snapshot` to switch deliberately without changing the URL. | ||
| ```bash | ||
| mdedit article create --file document.md --publish --format json | ||
| mdedit article publish-status <articleId> --format json | ||
| ``` | ||
| Read `shortUrl`, `mode`, the `source*` revision/version fields, and `syncStatus` from | ||
| JSON output. If `syncStatus` is `failed`, the URL still serves the last good content; | ||
| report `lastSuccessfulSyncAt` and `syncError` rather than claiming it is current. | ||
| Links created before Live mode are legacy Snapshots until explicitly switched: | ||
| ```bash | ||
| mdedit article publish <articleId> --live --format json | ||
| ``` | ||
| ### Workflow: create a new article in a folder | ||
@@ -247,0 +271,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
430815
1.18%3408
0.38%180
7.78%+ Added
+ Added
- Removed
- Removed
Updated
Updated