@clipit-ai/cli 0.2.8 → 0.2.10

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/bin/clipit.mjs +90 -2
  2. package/package.json +1 -1
package/bin/clipit.mjs CHANGED
@@ -9,7 +9,7 @@ import path from 'node:path';
9
9
  import process from 'node:process';
10
10
  import { fileURLToPath } from 'node:url';
11
11
 
12
- const VERSION = '0.2.8';
12
+ const VERSION = '0.2.10';
13
13
  const DEFAULT_BASE_URL = 'https://clipit.dev';
14
14
  const DEFAULT_SCOPES = [
15
15
  'clippy_agent',
@@ -484,6 +484,91 @@ function usage() {
484
484
  ].join('\n');
485
485
  }
486
486
 
487
+ function commandUsage(command, subcommand) {
488
+ if (command === 'clips' && subcommand === 'initialize-snapshot') {
489
+ return [
490
+ 'Usage:',
491
+ ' clipit clips initialize-snapshot <clipId> [options]',
492
+ '',
493
+ 'Required:',
494
+ ' <clipId> Clip to initialize or safely reinitialize',
495
+ '',
496
+ 'Optional:',
497
+ ' --aspect-ratio <ratio> 16:9, 9:16, 1:1, or 4:5',
498
+ ' --fit-background <mode> black or blur',
499
+ ' --quality <quality> standard, high, or 4k',
500
+ ' --captions <true|false> Explicitly enable or disable captions',
501
+ ' --caption-style <style> bold, minimal, neon, or classic',
502
+ ' --params <json|@file> Supply the full initializer request, including captionPresetId',
503
+ ' --profile <name> Named ClipIt credential profile',
504
+ ' --json Emit machine-readable JSON',
505
+ '',
506
+ 'Omitted snapshot settings preserve the clip\'s exact current editor state.',
507
+ ].join('\n');
508
+ }
509
+ if (command === 'exports' && subcommand === 'start') {
510
+ return [
511
+ 'Usage:',
512
+ ' clipit exports start --clip-id <id> --confirm [options]',
513
+ '',
514
+ 'Required:',
515
+ ' --clip-id <id> Clip to export from its verified current snapshot',
516
+ ' --confirm Confirm the export mutation',
517
+ '',
518
+ 'Optional:',
519
+ ' --params <json|@file> Additional export settings',
520
+ ' --idempotency-key <key> Stable retry identity; generated when omitted',
521
+ ' --max-credits <n> Refuse an estimated client charge above this amount',
522
+ ' --profile <name> Named ClipIt credential profile',
523
+ ' --json Emit machine-readable JSON',
524
+ '',
525
+ 'The CLI pins the current editor version and state hash before starting the export.',
526
+ ].join('\n');
527
+ }
528
+ if (command === 'social' && subcommand === 'schedule') {
529
+ return [
530
+ 'Usage:',
531
+ ' clipit social schedule --clip-id <id> --platforms <platform[,platform]> --caption <text> --at <ISO-8601> --confirm',
532
+ '',
533
+ 'Required:',
534
+ ' --clip-id <id> Clip to schedule',
535
+ ' --platforms <list> Comma-separated destination platforms',
536
+ ' --caption <text> Post caption',
537
+ ' --at <ISO-8601> Scheduled publish time',
538
+ ' --confirm Confirm the scheduling mutation',
539
+ '',
540
+ 'Optional:',
541
+ ' --export-id <id> Pin the exact completed export',
542
+ ' --account-ids <map> Exact accounts as platform=accountId pairs',
543
+ ' --title <text> Post title',
544
+ ' --hashtags <list> Comma-separated hashtags',
545
+ ' --profile <name> Named ClipIt credential profile',
546
+ ' --json Emit machine-readable JSON',
547
+ '',
548
+ 'Enterprise scheduling requires a client-selected deliverable and a granted connected account.',
549
+ ].join('\n');
550
+ }
551
+ if (command === 'deliverables' && subcommand === 'create') {
552
+ return [
553
+ 'Usage:',
554
+ ' clipit deliverables create --export-id <id> --title <text> --confirm',
555
+ '',
556
+ 'Required:',
557
+ ' --export-id <id> Exact completed export to deliver',
558
+ ' --title <text> Client-facing deliverable title',
559
+ ' --confirm Confirm the delivery mutation',
560
+ '',
561
+ 'Optional:',
562
+ ' --note <text> Client-facing note',
563
+ ' --profile <name> Named ClipIt credential profile',
564
+ ' --json Emit machine-readable JSON',
565
+ '',
566
+ 'The response includes clientSelectionUrl; the client must select the delivery before enterprise social publishing.',
567
+ ].join('\n');
568
+ }
569
+ return null;
570
+ }
571
+
487
572
  function getBaseUrl(config, options) {
488
573
  const profile = profileData(config, options);
489
574
  const selected = profileIsAuthoritative(config, options);
@@ -1763,6 +1848,9 @@ async function runTool(config, options, functionName) {
1763
1848
  return;
1764
1849
  }
1765
1850
  output(outputResult, options);
1851
+ if (result?.success === false) {
1852
+ process.exitCode = EXIT.SERVER;
1853
+ }
1766
1854
  }
1767
1855
 
1768
1856
  function workflowEndpoint(jobId) {
@@ -4438,7 +4526,7 @@ async function main() {
4438
4526
  return;
4439
4527
  }
4440
4528
  if (!command || options.help) {
4441
- console.log(usage());
4529
+ console.log(commandUsage(command, subcommand) ?? usage());
4442
4530
  return;
4443
4531
  }
4444
4532
  if (command === 'version' || command === '--version' || command === '-v') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipit-ai/cli",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "ClipIt CLI for connecting shell-capable agents to ClipIt.",
5
5
  "type": "module",
6
6
  "bin": {