@letterstory/cli 0.177.204 → 0.177.205
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/lib/cli.mjs +5 -1
- package/lib/commands/posts.mjs +20 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
94
94
|
|
|
95
95
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
96
|
-
export const VERSION = "0.177.
|
|
96
|
+
export const VERSION = "0.177.205";
|
|
97
97
|
|
|
98
98
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
99
99
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -132,6 +132,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
132
132
|
"serving",
|
|
133
133
|
// posts remediate: change a post a person has edited.
|
|
134
134
|
"allow-edited",
|
|
135
|
+
// posts rename: re-publish the live posts it changed.
|
|
136
|
+
"republish",
|
|
135
137
|
// Models material: retain a request for attachments before preparing it.
|
|
136
138
|
"stage-only",
|
|
137
139
|
// visits export: only the people or companies who fit the ICP, or only those who don't.
|
|
@@ -743,6 +745,8 @@ Content:
|
|
|
743
745
|
change only the named sentences, never the rest; a dry run unless --apply
|
|
744
746
|
Rewrite the post with AI from an instruction
|
|
745
747
|
posts mentions <article-id> Re-apply the brand-mention & competitor policy
|
|
748
|
+
posts rename --was "<old name>" --now "<new name>" [--renames-json '[{"was":"...","now":"..."}]'] [--collection <id> ...] [--apply] [--republish]
|
|
749
|
+
swap a name in every post's title, text and public metadata; a dry run unless --apply
|
|
746
750
|
posts history <article-id> The post's versions, newest first
|
|
747
751
|
posts restore <article-id> <version> Bring a version back as the latest
|
|
748
752
|
posts export <article-id> --format md|pdf [--out <path>]
|
package/lib/commands/posts.mjs
CHANGED
|
@@ -114,6 +114,22 @@ export const ARGS = {
|
|
|
114
114
|
run_mention_pass: {
|
|
115
115
|
article_id: ARTICLE,
|
|
116
116
|
},
|
|
117
|
+
rename_in_posts: {
|
|
118
|
+
// One name as --was/--now, or several as --renames-json '[{"was":"...","now":"..."}]'.
|
|
119
|
+
renames: {
|
|
120
|
+
value: (flags) => {
|
|
121
|
+
const listed = jsonListFlag(flags, "renames-json");
|
|
122
|
+
if (listed) return listed;
|
|
123
|
+
const was = flagStr(flags.was);
|
|
124
|
+
const now = flagStr(flags.now);
|
|
125
|
+
if (!was || !now) throw new CliError('Pass --was "<old name>" --now "<new name>", or --renames-json');
|
|
126
|
+
return [{ was, now }];
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
collection_ids: { flag: "collection", type: "list", label: "collection-id" },
|
|
130
|
+
apply: { flag: "apply", type: "bool" },
|
|
131
|
+
republish: { flag: "republish", type: "bool" },
|
|
132
|
+
},
|
|
117
133
|
get_article_history: {
|
|
118
134
|
article_id: ARTICLE,
|
|
119
135
|
},
|
|
@@ -182,6 +198,8 @@ export async function cmdPosts(ctx) {
|
|
|
182
198
|
return postsWrite(rest, "remediate_article", "Remediated.");
|
|
183
199
|
case "mentions":
|
|
184
200
|
return postsWrite(rest, "run_mention_pass", "Mention pass done.");
|
|
201
|
+
case "rename":
|
|
202
|
+
return postsWrite(rest, "rename_in_posts", "Renamed.");
|
|
185
203
|
case "history":
|
|
186
204
|
return postsRead(rest, "get_article_history");
|
|
187
205
|
case "restore":
|
|
@@ -199,7 +217,7 @@ export async function cmdPosts(ctx) {
|
|
|
199
217
|
return postsDelete(rest);
|
|
200
218
|
default:
|
|
201
219
|
throw new CliError(
|
|
202
|
-
`Unknown posts subcommand: ${sub ?? "(none)"}. Try: list, show, new, update, edit, remediate, mentions, history, restore, export, comments, publish, unpublish, delete`
|
|
220
|
+
`Unknown posts subcommand: ${sub ?? "(none)"}. Try: list, show, new, update, edit, remediate, mentions, rename, history, restore, export, comments, publish, unpublish, delete`
|
|
203
221
|
);
|
|
204
222
|
}
|
|
205
223
|
}
|
|
@@ -210,6 +228,7 @@ const CALL = {
|
|
|
210
228
|
edit_article_with_prompt: (client, args) => client.callTool("edit_article_with_prompt", args),
|
|
211
229
|
remediate_article: (client, args) => client.callTool("remediate_article", args),
|
|
212
230
|
run_mention_pass: (client, args) => client.callTool("run_mention_pass", args),
|
|
231
|
+
rename_in_posts: (client, args) => client.callTool("rename_in_posts", args),
|
|
213
232
|
get_article_history: (client, args) => client.callTool("get_article_history", args),
|
|
214
233
|
restore_article_version: (client, args) => client.callTool("restore_article_version", args),
|
|
215
234
|
list_article_comments: (client, args) => client.callTool("list_article_comments", args),
|