chirpie 1.0.2 → 1.0.4

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 +49 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -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, Bluesky, and LinkedIn)").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,49 @@ 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
+ });
354
+ accountsCommand.command("connect-linkedin").description("Connect a LinkedIn account via OAuth").action(async () => {
355
+ const client = getClient();
356
+ try {
357
+ const result = await client.connectLinkedInAccount();
358
+ info("Open this URL in your browser to connect your LinkedIn account:");
359
+ console.log(`
360
+ ${result.authorization_url}
361
+ `);
362
+ } catch (err) {
363
+ error(err instanceof Error ? err.message : "Failed to start LinkedIn connection");
364
+ process.exit(1);
365
+ }
366
+ });
323
367
 
324
368
  // src/commands/analytics.ts
325
369
  import { Command as Command7 } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chirpie",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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.1",
34
+ "@chirpie/sdk": "^1.0.3",
35
35
  "commander": "^13"
36
36
  },
37
37
  "devDependencies": {