@bitsocial/bitsocial-cli 0.19.44 → 0.19.45

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/README.md CHANGED
@@ -344,7 +344,7 @@ EXAMPLES
344
344
  $ bitsocial challenge install ./my-local-challenge
345
345
  ```
346
346
 
347
- _See code: [src/cli/commands/challenge/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/challenge/install.ts)_
347
+ _See code: [src/cli/commands/challenge/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/challenge/install.ts)_
348
348
 
349
349
  ## `bitsocial challenge list`
350
350
 
@@ -367,7 +367,7 @@ EXAMPLES
367
367
  $ bitsocial challenge list -q
368
368
  ```
369
369
 
370
- _See code: [src/cli/commands/challenge/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/challenge/list.ts)_
370
+ _See code: [src/cli/commands/challenge/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/challenge/list.ts)_
371
371
 
372
372
  ## `bitsocial challenge remove NAME`
373
373
 
@@ -392,7 +392,7 @@ EXAMPLES
392
392
  $ bitsocial challenge remove @scope/my-challenge
393
393
  ```
394
394
 
395
- _See code: [src/cli/commands/challenge/remove.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/challenge/remove.ts)_
395
+ _See code: [src/cli/commands/challenge/remove.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/challenge/remove.ts)_
396
396
 
397
397
  ## `bitsocial community create`
398
398
 
@@ -417,7 +417,7 @@ EXAMPLES
417
417
  $ bitsocial community create --title 'Hello Plebs' --description 'Welcome'
418
418
  ```
419
419
 
420
- _See code: [src/cli/commands/community/create.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/create.ts)_
420
+ _See code: [src/cli/commands/community/create.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/create.ts)_
421
421
 
422
422
  ## `bitsocial community delete ADDRESSES`
423
423
 
@@ -442,7 +442,7 @@ EXAMPLES
442
442
  $ bitsocial community delete 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu
443
443
  ```
444
444
 
445
- _See code: [src/cli/commands/community/delete.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/delete.ts)_
445
+ _See code: [src/cli/commands/community/delete.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/delete.ts)_
446
446
 
447
447
  ## `bitsocial community edit ADDRESS`
448
448
 
@@ -450,13 +450,14 @@ Edit a community's properties. For a list of properties, visit https://github.co
450
450
 
451
451
  ```
452
452
  USAGE
453
- $ bitsocial community edit ADDRESS --pkcRpcUrl <value>
453
+ $ bitsocial community edit ADDRESS --pkcRpcUrl <value> [-f <value>]
454
454
 
455
455
  ARGUMENTS
456
- ADDRESS Address of the community to edit
456
+ ADDRESS Address of the community to edit. It could be the name domain, or a public key
457
457
 
458
458
  FLAGS
459
- --pkcRpcUrl=<value> (required) [default: ws://localhost:9138/] URL to PKC RPC
459
+ -f, --jsonFile=<value> Path to a JSON file containing edit options
460
+ --pkcRpcUrl=<value> (required) [default: ws://localhost:9138/] URL to PKC RPC
460
461
 
461
462
  DESCRIPTION
462
463
  Edit a community's properties. For a list of properties, visit https://github.com/pkcprotocol/pkc-js
@@ -468,33 +469,38 @@ EXAMPLES
468
469
 
469
470
  Add the author address 'esteban.bso' as an admin on the community
470
471
 
471
- $ bitsocial community edit mysub.bso '--roles["esteban.bso"].role' admin
472
+ $ bitsocial community edit mycommunity.bso '--roles["esteban.bso"].role' admin
472
473
 
473
474
  Add two challenges to the community. The first challenge will be a question and answer, and the second will be an
474
475
  image captcha
475
476
 
476
- $ bitsocial community edit mysub.bso --settings.challenges[0].name question \
477
+ $ bitsocial community edit mycommunity.bso --settings.challenges[0].name question \
477
478
  --settings.challenges[0].options.question "what is the password?" --settings.challenges[0].options.answer \
478
479
  thepassword --settings.challenges[1].name captcha-canvas-v3
479
480
 
480
481
  Change the title and description
481
482
 
482
- $ bitsocial community edit mysub.bso --title "This is the new title" --description "This is the new description"
483
+ $ bitsocial community edit mycommunity.bso --title "This is the new title" --description "This is the new \
484
+ description"
483
485
 
484
486
  Remove a role from a moderator/admin/owner
485
487
 
486
- $ bitsocial community edit plebbit.bso --roles['rinse12.bso'] null
488
+ $ bitsocial community edit bitsocial.bso --roles['rinse12.bso'] null
487
489
 
488
490
  Enable settings.fetchThumbnailUrls to fetch the thumbnail of url submitted by authors
489
491
 
490
- $ bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls
492
+ $ bitsocial community edit bitsocial.bso --settings.fetchThumbnailUrls
491
493
 
492
494
  disable settings.fetchThumbnailUrls
493
495
 
494
- $ bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls=false
496
+ $ bitsocial community edit bitsocial.bso --settings.fetchThumbnailUrls=false
497
+
498
+ Edit a community using options from a JSON file
499
+
500
+ $ bitsocial community edit bitsocial.bso --jsonFile ./edit-options.json
495
501
  ```
496
502
 
497
- _See code: [src/cli/commands/community/edit.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/edit.ts)_
503
+ _See code: [src/cli/commands/community/edit.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/edit.ts)_
498
504
 
499
505
  ## `bitsocial community get [ADDRESS]`
500
506
 
@@ -525,7 +531,7 @@ EXAMPLES
525
531
  $ bitsocial community get --publicKey 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu
526
532
  ```
527
533
 
528
- _See code: [src/cli/commands/community/get.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/get.ts)_
534
+ _See code: [src/cli/commands/community/get.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/get.ts)_
529
535
 
530
536
  ## `bitsocial community list`
531
537
 
@@ -548,7 +554,7 @@ EXAMPLES
548
554
  $ bitsocial community list
549
555
  ```
550
556
 
551
- _See code: [src/cli/commands/community/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/list.ts)_
557
+ _See code: [src/cli/commands/community/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/list.ts)_
552
558
 
553
559
  ## `bitsocial community start ADDRESSES`
554
560
 
@@ -577,7 +583,7 @@ EXAMPLES
577
583
  $ bitsocial community start $(bitsocial community list -q)
578
584
  ```
579
585
 
580
- _See code: [src/cli/commands/community/start.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/start.ts)_
586
+ _See code: [src/cli/commands/community/start.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/start.ts)_
581
587
 
582
588
  ## `bitsocial community stop ADDRESSES`
583
589
 
@@ -602,7 +608,7 @@ EXAMPLES
602
608
  $ bitsocial community stop Qmb99crTbSUfKXamXwZBe829Vf6w5w5TktPkb6WstC9RFW
603
609
  ```
604
610
 
605
- _See code: [src/cli/commands/community/stop.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/community/stop.ts)_
611
+ _See code: [src/cli/commands/community/stop.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/community/stop.ts)_
606
612
 
607
613
  ## `bitsocial daemon`
608
614
 
@@ -643,7 +649,7 @@ EXAMPLES
643
649
  $ bitsocial daemon --chainProviderUrls https://mainnet.infura.io/v3/YOUR_KEY
644
650
  ```
645
651
 
646
- _See code: [src/cli/commands/daemon.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/daemon.ts)_
652
+ _See code: [src/cli/commands/daemon.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/daemon.ts)_
647
653
 
648
654
  ## `bitsocial help [COMMAND]`
649
655
 
@@ -700,7 +706,7 @@ EXAMPLES
700
706
  $ bitsocial logs --since 1h -f
701
707
  ```
702
708
 
703
- _See code: [src/cli/commands/logs.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/logs.ts)_
709
+ _See code: [src/cli/commands/logs.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/logs.ts)_
704
710
 
705
711
  ## `bitsocial update check`
706
712
 
@@ -717,7 +723,7 @@ EXAMPLES
717
723
  $ bitsocial update check
718
724
  ```
719
725
 
720
- _See code: [src/cli/commands/update/check.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/update/check.ts)_
726
+ _See code: [src/cli/commands/update/check.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/update/check.ts)_
721
727
 
722
728
  ## `bitsocial update install [VERSION]`
723
729
 
@@ -749,7 +755,7 @@ EXAMPLES
749
755
  $ bitsocial update install --no-restart-daemons
750
756
  ```
751
757
 
752
- _See code: [src/cli/commands/update/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/update/install.ts)_
758
+ _See code: [src/cli/commands/update/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/update/install.ts)_
753
759
 
754
760
  ## `bitsocial update versions`
755
761
 
@@ -771,7 +777,7 @@ EXAMPLES
771
777
  $ bitsocial update versions --limit 5
772
778
  ```
773
779
 
774
- _See code: [src/cli/commands/update/versions.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.44/src/cli/commands/update/versions.ts)_
780
+ _See code: [src/cli/commands/update/versions.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.45/src/cli/commands/update/versions.ts)_
775
781
  <!-- commandsstop -->
776
782
 
777
783
  ## Contribution
@@ -4,6 +4,9 @@ export default class Edit extends BaseCommand {
4
4
  static args: {
5
5
  address: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
6
  };
7
+ static flags: {
8
+ jsonFile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
7
10
  static examples: {
8
11
  description: string;
9
12
  command: string;
@@ -1,6 +1,7 @@
1
1
  //@ts-expect-error
2
2
  import DataObjectParser from "dataobject-parser";
3
- import { Args } from "@oclif/core";
3
+ import { Args, Flags } from "@oclif/core";
4
+ import fs from "fs";
4
5
  import { BaseCommand } from "../../base-command.js";
5
6
  import { PKCLogger, mergeDeep } from "../../../util.js";
6
7
  import * as remeda from "remeda";
@@ -10,37 +11,51 @@ export default class Edit extends BaseCommand {
10
11
  address: Args.string({
11
12
  name: "address",
12
13
  required: true,
13
- description: "Address of the community to edit"
14
+ description: "Address of the community to edit. It could be the name domain, or a public key"
15
+ })
16
+ };
17
+ static flags = {
18
+ jsonFile: Flags.file({
19
+ char: "f",
20
+ exists: true,
21
+ description: "Path to a JSON file containing edit options"
14
22
  })
15
23
  };
16
24
  static examples = [
25
+ // TODO update this to change the name instead
26
+ // Also are we testing modifying name properly?
27
+ // in theory user should not modify address, they should modify name
17
28
  {
18
29
  description: "Change the address of the community to a new domain address",
19
30
  command: "bitsocial community edit 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu --address newAddress.bso"
20
31
  },
21
32
  {
22
33
  description: "Add the author address 'esteban.bso' as an admin on the community",
23
- command: `bitsocial community edit mysub.bso '--roles["esteban.bso"].role' admin`
34
+ command: `bitsocial community edit mycommunity.bso '--roles["esteban.bso"].role' admin`
24
35
  },
25
36
  {
26
37
  description: "Add two challenges to the community. The first challenge will be a question and answer, and the second will be an image captcha",
27
- command: `bitsocial community edit mysub.bso --settings.challenges[0].name question --settings.challenges[0].options.question "what is the password?" --settings.challenges[0].options.answer thepassword --settings.challenges[1].name captcha-canvas-v3`
38
+ command: `bitsocial community edit mycommunity.bso --settings.challenges[0].name question --settings.challenges[0].options.question "what is the password?" --settings.challenges[0].options.answer thepassword --settings.challenges[1].name captcha-canvas-v3`
28
39
  },
29
40
  {
30
41
  description: "Change the title and description",
31
- command: `bitsocial community edit mysub.bso --title "This is the new title" --description "This is the new description" `
42
+ command: `bitsocial community edit mycommunity.bso --title "This is the new title" --description "This is the new description" `
32
43
  },
33
44
  {
34
45
  description: "Remove a role from a moderator/admin/owner",
35
- command: "bitsocial community edit plebbit.bso --roles['rinse12.bso'] null"
46
+ command: "bitsocial community edit bitsocial.bso --roles['rinse12.bso'] null"
36
47
  },
37
48
  {
38
49
  description: "Enable settings.fetchThumbnailUrls to fetch the thumbnail of url submitted by authors",
39
- command: "bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls"
50
+ command: "bitsocial community edit bitsocial.bso --settings.fetchThumbnailUrls"
40
51
  },
41
52
  {
42
53
  description: "disable settings.fetchThumbnailUrls",
43
- command: "bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls=false"
54
+ command: "bitsocial community edit bitsocial.bso --settings.fetchThumbnailUrls=false"
55
+ },
56
+ {
57
+ description: "Edit a community using options from a JSON file",
58
+ command: "bitsocial community edit bitsocial.bso --jsonFile ./edit-options.json"
44
59
  }
45
60
  ];
46
61
  async run() {
@@ -48,8 +63,39 @@ export default class Edit extends BaseCommand {
48
63
  const log = PKCLogger("bitsocial-cli:commands:community:edit");
49
64
  log(`flags: `, flags);
50
65
  const pkc = await this._connectToPkcRpc(flags.pkcRpcUrl.toString());
51
- const editOptions = DataObjectParser.transpose(remeda.omit(flags, ["pkcRpcUrl"]))["_data"];
52
- log("Edit options parsed:", editOptions);
66
+ const cliEditOptions = DataObjectParser.transpose(remeda.omit(flags, ["pkcRpcUrl", "jsonFile"]))["_data"];
67
+ log("CLI edit options parsed:", cliEditOptions);
68
+ // Parse JSON file if provided
69
+ let jsonFileOptions = {};
70
+ if (flags.jsonFile) {
71
+ try {
72
+ const fileContent = await fs.promises.readFile(flags.jsonFile, "utf-8");
73
+ const parsed = JSON.parse(fileContent);
74
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
75
+ this.error("JSON file must contain a JSON object (not an array, null, string, or number)");
76
+ }
77
+ jsonFileOptions = parsed;
78
+ log("JSON file options parsed:", jsonFileOptions);
79
+ }
80
+ catch (e) {
81
+ if (e instanceof SyntaxError) {
82
+ this.error(`Invalid JSON in file ${flags.jsonFile}: ${e.message}`);
83
+ }
84
+ throw e;
85
+ }
86
+ }
87
+ // Merge: JSON file options first, then CLI flags override
88
+ let editOptions;
89
+ if (flags.jsonFile && Object.keys(cliEditOptions).length > 0) {
90
+ editOptions = mergeDeep(jsonFileOptions, cliEditOptions);
91
+ }
92
+ else if (flags.jsonFile) {
93
+ editOptions = jsonFileOptions;
94
+ }
95
+ else {
96
+ editOptions = cliEditOptions;
97
+ }
98
+ log("Final edit options:", editOptions);
53
99
  const localCommunities = pkc.communities;
54
100
  if (!localCommunities.includes(args.address))
55
101
  this.error("Can't edit a remote community, make sure you're editing a local community");
@@ -11,4 +11,6 @@ export default class Install extends Command {
11
11
  static examples: string[];
12
12
  run(): Promise<void>;
13
13
  private _restartDaemons;
14
+ private _connectToRpc;
15
+ private _reportCommunityStatus;
14
16
  }
@@ -4,6 +4,11 @@ import tcpPortUsed from "tcp-port-used";
4
4
  import { fetchLatestVersion, installGlobal } from "../../../update/npm-registry.js";
5
5
  import { compareVersions } from "../../../update/semver.js";
6
6
  import { getAliveDaemonStates } from "../../../common-utils/daemon-state.js";
7
+ import PKC from "@pkcprotocol/pkc-js";
8
+ const getPKCConnectOverride = () => {
9
+ const globalWithOverride = globalThis;
10
+ return globalWithOverride.__PKC_RPC_CONNECT_OVERRIDE;
11
+ };
7
12
  export default class Install extends Command {
8
13
  static description = "Install a specific version of bitsocial from npm";
9
14
  static args = {
@@ -122,10 +127,64 @@ export default class Install extends Command {
122
127
  const started = await tcpPortUsed.waitUntilUsed(port, 500, 30000).then(() => true).catch(() => false);
123
128
  if (started) {
124
129
  this.log(` Daemon started (port ${port}).`);
130
+ await this._reportCommunityStatus(d.pkcRpcUrl);
125
131
  }
126
132
  else {
127
133
  this.warn(` Daemon may not have started — port ${port} not responding after 30s. Check logs with: bitsocial logs`);
128
134
  }
129
135
  }
130
136
  }
137
+ async _connectToRpc(pkcRpcUrl) {
138
+ const connectOverride = getPKCConnectOverride();
139
+ if (connectOverride) {
140
+ return connectOverride(pkcRpcUrl);
141
+ }
142
+ const pkc = await PKC({ pkcRpcClientsOptions: [pkcRpcUrl] });
143
+ const errors = [];
144
+ pkc.on("error", (err) => {
145
+ errors.push(err);
146
+ });
147
+ await new Promise((resolve, reject) => {
148
+ const timeout = setTimeout(() => {
149
+ const lastError = errors[errors.length - 1];
150
+ reject(lastError ?? new Error(`Timed out waiting for RPC server at ${pkcRpcUrl} to respond`));
151
+ }, 20000);
152
+ pkc.once("communitieschange", () => {
153
+ clearTimeout(timeout);
154
+ resolve();
155
+ });
156
+ });
157
+ return pkc;
158
+ }
159
+ async _reportCommunityStatus(pkcRpcUrl) {
160
+ let pkc;
161
+ try {
162
+ pkc = await this._connectToRpc(pkcRpcUrl);
163
+ const communities = pkc.communities;
164
+ if (communities.length === 0)
165
+ return;
166
+ const statuses = await Promise.all(communities.map(async (address) => {
167
+ const community = await pkc.createCommunity({ address });
168
+ return community.started;
169
+ }));
170
+ const startedCount = statuses.filter(Boolean).length;
171
+ const total = communities.length;
172
+ if (startedCount === total) {
173
+ this.log(` ${startedCount} ${startedCount === 1 ? "community" : "communities"} started.`);
174
+ }
175
+ else if (startedCount > 0) {
176
+ this.log(` ${startedCount} of ${total} communities started (remaining still loading).`);
177
+ }
178
+ else {
179
+ this.log(` ${total} ${total === 1 ? "community" : "communities"} in data path (still loading). Check with: bitsocial community list`);
180
+ }
181
+ }
182
+ catch {
183
+ this.warn("Could not check community status.");
184
+ }
185
+ finally {
186
+ if (pkc)
187
+ await pkc.destroy().catch(() => { });
188
+ }
189
+ }
131
190
  }
@@ -60,6 +60,10 @@ const traverseObjectToSetAsFlagInOclif = (opts, flagsGrouped, path = "") => {
60
60
  if (Object.keys(flagsGrouped[flagName]).length !== 0)
61
61
  continue;
62
62
  }
63
+ const fullFlagName = path + flagName;
64
+ // Skip flags that are already statically declared on the command
65
+ if (opts.Command.flags && fullFlagName in opts.Command.flags)
66
+ continue;
63
67
  const flagsIndices = Object.assign({}, ...Object.keys(flagsGrouped).map((flag) => ({ [flag]: 0 })));
64
68
  const multipleValues = Array.isArray(flagsGrouped[flagName]) && flagsGrouped[flagName].length > 1;
65
69
  const parsedValue = flagsGrouped[flagName];
@@ -76,9 +80,18 @@ const traverseObjectToSetAsFlagInOclif = (opts, flagsGrouped, path = "") => {
76
80
  });
77
81
  }
78
82
  };
83
+ // Tracks original static flags per Command class so dynamic flags can be reset across invocations (e.g. in tests)
84
+ const originalStaticFlags = new WeakMap();
79
85
  const hook = async function (opts) {
80
86
  // Need to parse flag here and add it to opts.Command._flags
81
87
  if (opts.Command.id === "community:edit" || opts.Command.id === "community:create" || opts.Command.id === "daemon") {
88
+ // Snapshot static flags on first run; restore on subsequent runs (test isolation)
89
+ if (!originalStaticFlags.has(opts.Command)) {
90
+ originalStaticFlags.set(opts.Command, opts.Command.flags ? { ...opts.Command.flags } : {});
91
+ }
92
+ else {
93
+ opts.Command.flags = { ...originalStaticFlags.get(opts.Command) };
94
+ }
82
95
  // Parse the dynamic flags and add them to opts.Command.flags so that it wouldn't throw
83
96
  if (opts.argv.length <= 1)
84
97
  return; // if no flags are provided, then we don't need to do anything
@@ -350,7 +350,7 @@
350
350
  "aliases": [],
351
351
  "args": {
352
352
  "address": {
353
- "description": "Address of the community to edit",
353
+ "description": "Address of the community to edit. It could be the name domain, or a public key",
354
354
  "name": "address",
355
355
  "required": true
356
356
  }
@@ -363,27 +363,31 @@
363
363
  },
364
364
  {
365
365
  "description": "Add the author address 'esteban.bso' as an admin on the community",
366
- "command": "bitsocial community edit mysub.bso '--roles[\"esteban.bso\"].role' admin"
366
+ "command": "bitsocial community edit mycommunity.bso '--roles[\"esteban.bso\"].role' admin"
367
367
  },
368
368
  {
369
369
  "description": "Add two challenges to the community. The first challenge will be a question and answer, and the second will be an image captcha",
370
- "command": "bitsocial community edit mysub.bso --settings.challenges[0].name question --settings.challenges[0].options.question \"what is the password?\" --settings.challenges[0].options.answer thepassword --settings.challenges[1].name captcha-canvas-v3"
370
+ "command": "bitsocial community edit mycommunity.bso --settings.challenges[0].name question --settings.challenges[0].options.question \"what is the password?\" --settings.challenges[0].options.answer thepassword --settings.challenges[1].name captcha-canvas-v3"
371
371
  },
372
372
  {
373
373
  "description": "Change the title and description",
374
- "command": "bitsocial community edit mysub.bso --title \"This is the new title\" --description \"This is the new description\" "
374
+ "command": "bitsocial community edit mycommunity.bso --title \"This is the new title\" --description \"This is the new description\" "
375
375
  },
376
376
  {
377
377
  "description": "Remove a role from a moderator/admin/owner",
378
- "command": "bitsocial community edit plebbit.bso --roles['rinse12.bso'] null"
378
+ "command": "bitsocial community edit bitsocial.bso --roles['rinse12.bso'] null"
379
379
  },
380
380
  {
381
381
  "description": "Enable settings.fetchThumbnailUrls to fetch the thumbnail of url submitted by authors",
382
- "command": "bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls"
382
+ "command": "bitsocial community edit bitsocial.bso --settings.fetchThumbnailUrls"
383
383
  },
384
384
  {
385
385
  "description": "disable settings.fetchThumbnailUrls",
386
- "command": "bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls=false"
386
+ "command": "bitsocial community edit bitsocial.bso --settings.fetchThumbnailUrls=false"
387
+ },
388
+ {
389
+ "description": "Edit a community using options from a JSON file",
390
+ "command": "bitsocial community edit bitsocial.bso --jsonFile ./edit-options.json"
387
391
  }
388
392
  ],
389
393
  "flags": {
@@ -395,6 +399,14 @@
395
399
  "hasDynamicHelp": false,
396
400
  "multiple": false,
397
401
  "type": "option"
402
+ },
403
+ "jsonFile": {
404
+ "char": "f",
405
+ "description": "Path to a JSON file containing edit options",
406
+ "name": "jsonFile",
407
+ "hasDynamicHelp": false,
408
+ "multiple": false,
409
+ "type": "option"
398
410
  }
399
411
  },
400
412
  "hasDynamicHelp": false,
@@ -713,5 +725,5 @@
713
725
  ]
714
726
  }
715
727
  },
716
- "version": "0.19.44"
728
+ "version": "0.19.45"
717
729
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitsocial/bitsocial-cli",
3
- "version": "0.19.44",
3
+ "version": "0.19.45",
4
4
  "description": "Command line interface to Bitsocial API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "homepage": "https://github.com/bitsocialnet/bitsocial-cli",