chirpie 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +37 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -149,7 +149,7 @@ function getClient() {
149
149
  }
150
150
 
151
151
  // src/commands/post.ts
152
- var postCommand = new Command3("post").description("Create a post on X").argument("<text>", "Post text (max 280 chars)").option("-a, --account <id>", "Account ID").option("-m, --media <urls...>", "Media URLs (up to 4 images or 1 video)").option("-s, --schedule <datetime>", "Schedule for later (ISO 8601)").option("--json", "Output raw JSON").action(async (text, opts) => {
152
+ var postCommand = new Command3("post").description("Create a post on X").argument("<text>", "Post text (max 280 chars, or 25,000 for X Premium accounts)").option("-a, --account <id>", "Account ID").option("-m, --media <urls...>", "Media URLs (up to 4 images or 1 video)").option("-s, --schedule <datetime>", "Schedule for later (ISO 8601)").option("--json", "Output raw JSON").action(async (text, opts) => {
153
153
  const client = getClient();
154
154
  let accountId = opts.account;
155
155
  if (!accountId) {
@@ -286,7 +286,7 @@ postsCommand.command("delete <id>").description("Delete a post").action(async (i
286
286
 
287
287
  // src/commands/accounts.ts
288
288
  import { Command as Command6 } from "commander";
289
- var accountsCommand = new Command6("accounts").description("List connected X accounts").option("--json", "Output raw JSON").action(async (opts) => {
289
+ var accountsCommand = new Command6("accounts").description("List connected social accounts (X and Bluesky)").option("--json", "Output raw JSON").action(async (opts) => {
290
290
  const client = getClient();
291
291
  try {
292
292
  const accounts = await client.listAccounts();
@@ -296,8 +296,9 @@ var accountsCommand = new Command6("accounts").description("List connected X acc
296
296
  table(
297
297
  accounts.map((a) => ({
298
298
  id: a.id.slice(0, 8),
299
- username: `@${a.x_username}`,
300
- name: a.x_display_name ?? "",
299
+ platform: a.platform,
300
+ username: a.platform === "x" ? `@${a.username}` : a.username,
301
+ name: a.display_name ?? "",
301
302
  active: a.is_active ? "\u2713" : "\u2717"
302
303
  }))
303
304
  );
@@ -307,10 +308,10 @@ var accountsCommand = new Command6("accounts").description("List connected X acc
307
308
  process.exit(1);
308
309
  }
309
310
  });
310
- accountsCommand.command("connect").description("Connect a new X account").action(async () => {
311
+ accountsCommand.command("connect-x").description("Connect a new X/Twitter account via OAuth").action(async () => {
311
312
  const client = getClient();
312
313
  try {
313
- const result = await client.connectAccount();
314
+ const result = await client.connectXAccount();
314
315
  info("Open this URL in your browser to connect your X account:");
315
316
  console.log(`
316
317
  ${result.authorization_url}
@@ -320,6 +321,36 @@ accountsCommand.command("connect").description("Connect a new X account").action
320
321
  process.exit(1);
321
322
  }
322
323
  });
324
+ accountsCommand.command("connect-bluesky").description("Connect a Bluesky account via app password").requiredOption("--handle <handle>", "Bluesky handle (e.g. user.bsky.social)").option("--app-password <password>", "App password (omit to enter securely via prompt)").action(async (opts) => {
325
+ const client = getClient();
326
+ try {
327
+ let appPassword = opts.appPassword;
328
+ if (!appPassword) {
329
+ const readline = await import("readline");
330
+ const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
331
+ appPassword = await new Promise((resolve) => {
332
+ process.stderr.write("App Password: ");
333
+ rl.question("", (answer) => {
334
+ rl.close();
335
+ resolve(answer.trim());
336
+ });
337
+ });
338
+ if (!appPassword) {
339
+ error("App password is required");
340
+ process.exit(1);
341
+ }
342
+ }
343
+ const result = await client.connectBlueskyAccount({
344
+ platform: "bluesky",
345
+ identifier: opts.handle,
346
+ app_password: appPassword
347
+ });
348
+ info(`Connected Bluesky account: ${result.username} (${result.platform_user_id})`);
349
+ } catch (err) {
350
+ error(err instanceof Error ? err.message : "Failed to connect Bluesky account");
351
+ process.exit(1);
352
+ }
353
+ });
323
354
 
324
355
  // src/commands/analytics.ts
325
356
  import { Command as Command7 } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chirpie",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Chirpie CLI — post to social media from the command line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  ],
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@chirpie/sdk": "^1.0.0",
34
+ "@chirpie/sdk": "^1.0.2",
35
35
  "commander": "^13"
36
36
  },
37
37
  "devDependencies": {