@bitsocial/bitsocial-cli 0.19.40 → 0.19.42
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 +25 -19
- package/dist/cli/ascii-banner.d.ts +1 -0
- package/dist/cli/ascii-banner.js +94 -0
- package/dist/cli/commands/community/get.d.ts +5 -1
- package/dist/cli/commands/community/get.js +24 -4
- package/dist/cli/commands/daemon.js +2 -0
- package/dist/cli/hooks/init/banner-hook.d.ts +3 -0
- package/dist/cli/hooks/init/banner-hook.js +15 -0
- package/oclif.manifest.json +19 -3
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -304,7 +304,7 @@ $ bitsocial community edit mysub.bso '--roles["author-address.bso"]' null
|
|
|
304
304
|
* [`bitsocial community create`](#bitsocial-community-create)
|
|
305
305
|
* [`bitsocial community delete ADDRESSES`](#bitsocial-community-delete-addresses)
|
|
306
306
|
* [`bitsocial community edit ADDRESS`](#bitsocial-community-edit-address)
|
|
307
|
-
* [`bitsocial community get ADDRESS`](#bitsocial-community-get-address)
|
|
307
|
+
* [`bitsocial community get [ADDRESS]`](#bitsocial-community-get-address)
|
|
308
308
|
* [`bitsocial community list`](#bitsocial-community-list)
|
|
309
309
|
* [`bitsocial community start ADDRESSES`](#bitsocial-community-start-addresses)
|
|
310
310
|
* [`bitsocial community stop ADDRESSES`](#bitsocial-community-stop-addresses)
|
|
@@ -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.
|
|
347
|
+
_See code: [src/cli/commands/challenge/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/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.
|
|
370
|
+
_See code: [src/cli/commands/challenge/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/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.
|
|
395
|
+
_See code: [src/cli/commands/challenge/remove.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/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.
|
|
420
|
+
_See code: [src/cli/commands/community/create.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/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.
|
|
445
|
+
_See code: [src/cli/commands/community/delete.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/community/delete.ts)_
|
|
446
446
|
|
|
447
447
|
## `bitsocial community edit ADDRESS`
|
|
448
448
|
|
|
@@ -494,21 +494,23 @@ EXAMPLES
|
|
|
494
494
|
$ bitsocial community edit plebbit.bso --settings.fetchThumbnailUrls=false
|
|
495
495
|
```
|
|
496
496
|
|
|
497
|
-
_See code: [src/cli/commands/community/edit.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
497
|
+
_See code: [src/cli/commands/community/edit.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/community/edit.ts)_
|
|
498
498
|
|
|
499
|
-
## `bitsocial community get ADDRESS`
|
|
499
|
+
## `bitsocial community get [ADDRESS]`
|
|
500
500
|
|
|
501
501
|
Fetch a local or remote community, and print its json in the terminal
|
|
502
502
|
|
|
503
503
|
```
|
|
504
504
|
USAGE
|
|
505
|
-
$ bitsocial community get ADDRESS --pkcRpcUrl <value>
|
|
505
|
+
$ bitsocial community get [ADDRESS] --pkcRpcUrl <value> [--name <value>] [--publicKey <value>]
|
|
506
506
|
|
|
507
507
|
ARGUMENTS
|
|
508
|
-
ADDRESS Address of the community to fetch
|
|
508
|
+
[ADDRESS] Address of the community to fetch
|
|
509
509
|
|
|
510
510
|
FLAGS
|
|
511
|
+
--name=<value> Name of the community to fetch
|
|
511
512
|
--pkcRpcUrl=<value> (required) [default: ws://localhost:9138/] URL to PKC RPC
|
|
513
|
+
--publicKey=<value> Public key of the community to fetch
|
|
512
514
|
|
|
513
515
|
DESCRIPTION
|
|
514
516
|
Fetch a local or remote community, and print its json in the terminal
|
|
@@ -517,9 +519,13 @@ EXAMPLES
|
|
|
517
519
|
$ bitsocial community get plebmusic.bso
|
|
518
520
|
|
|
519
521
|
$ bitsocial community get 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu
|
|
522
|
+
|
|
523
|
+
$ bitsocial community get --name my-community
|
|
524
|
+
|
|
525
|
+
$ bitsocial community get --publicKey 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu
|
|
520
526
|
```
|
|
521
527
|
|
|
522
|
-
_See code: [src/cli/commands/community/get.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
528
|
+
_See code: [src/cli/commands/community/get.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/community/get.ts)_
|
|
523
529
|
|
|
524
530
|
## `bitsocial community list`
|
|
525
531
|
|
|
@@ -542,7 +548,7 @@ EXAMPLES
|
|
|
542
548
|
$ bitsocial community list
|
|
543
549
|
```
|
|
544
550
|
|
|
545
|
-
_See code: [src/cli/commands/community/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
551
|
+
_See code: [src/cli/commands/community/list.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/community/list.ts)_
|
|
546
552
|
|
|
547
553
|
## `bitsocial community start ADDRESSES`
|
|
548
554
|
|
|
@@ -571,7 +577,7 @@ EXAMPLES
|
|
|
571
577
|
$ bitsocial community start $(bitsocial community list -q)
|
|
572
578
|
```
|
|
573
579
|
|
|
574
|
-
_See code: [src/cli/commands/community/start.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
580
|
+
_See code: [src/cli/commands/community/start.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/community/start.ts)_
|
|
575
581
|
|
|
576
582
|
## `bitsocial community stop ADDRESSES`
|
|
577
583
|
|
|
@@ -596,7 +602,7 @@ EXAMPLES
|
|
|
596
602
|
$ bitsocial community stop Qmb99crTbSUfKXamXwZBe829Vf6w5w5TktPkb6WstC9RFW
|
|
597
603
|
```
|
|
598
604
|
|
|
599
|
-
_See code: [src/cli/commands/community/stop.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
605
|
+
_See code: [src/cli/commands/community/stop.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/community/stop.ts)_
|
|
600
606
|
|
|
601
607
|
## `bitsocial daemon`
|
|
602
608
|
|
|
@@ -638,7 +644,7 @@ EXAMPLES
|
|
|
638
644
|
$ bitsocial daemon --chainProviderUrls viem --chainProviderUrls https://mainnet.infura.io/v3/YOUR_KEY
|
|
639
645
|
```
|
|
640
646
|
|
|
641
|
-
_See code: [src/cli/commands/daemon.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
647
|
+
_See code: [src/cli/commands/daemon.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/daemon.ts)_
|
|
642
648
|
|
|
643
649
|
## `bitsocial help [COMMAND]`
|
|
644
650
|
|
|
@@ -695,7 +701,7 @@ EXAMPLES
|
|
|
695
701
|
$ bitsocial logs --since 1h -f
|
|
696
702
|
```
|
|
697
703
|
|
|
698
|
-
_See code: [src/cli/commands/logs.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
704
|
+
_See code: [src/cli/commands/logs.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/logs.ts)_
|
|
699
705
|
|
|
700
706
|
## `bitsocial update check`
|
|
701
707
|
|
|
@@ -712,7 +718,7 @@ EXAMPLES
|
|
|
712
718
|
$ bitsocial update check
|
|
713
719
|
```
|
|
714
720
|
|
|
715
|
-
_See code: [src/cli/commands/update/check.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
721
|
+
_See code: [src/cli/commands/update/check.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/update/check.ts)_
|
|
716
722
|
|
|
717
723
|
## `bitsocial update install [VERSION]`
|
|
718
724
|
|
|
@@ -741,7 +747,7 @@ EXAMPLES
|
|
|
741
747
|
$ bitsocial update install --force
|
|
742
748
|
```
|
|
743
749
|
|
|
744
|
-
_See code: [src/cli/commands/update/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
750
|
+
_See code: [src/cli/commands/update/install.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/update/install.ts)_
|
|
745
751
|
|
|
746
752
|
## `bitsocial update versions`
|
|
747
753
|
|
|
@@ -763,7 +769,7 @@ EXAMPLES
|
|
|
763
769
|
$ bitsocial update versions --limit 5
|
|
764
770
|
```
|
|
765
771
|
|
|
766
|
-
_See code: [src/cli/commands/update/versions.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.
|
|
772
|
+
_See code: [src/cli/commands/update/versions.ts](https://github.com/bitsocialnet/bitsocial-cli/blob/v0.19.42/src/cli/commands/update/versions.ts)_
|
|
767
773
|
<!-- commandsstop -->
|
|
768
774
|
|
|
769
775
|
## Contribution
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function printBanner(): void;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// ASCII banner, edited as two parallel grids.
|
|
2
|
+
//
|
|
3
|
+
// SHAPE holds the raw glyphs (braille art + figlet text). Leave these alone
|
|
4
|
+
// unless you want to change the art itself.
|
|
5
|
+
//
|
|
6
|
+
// COLORS is the paint map. Each character corresponds 1:1 to the character
|
|
7
|
+
// at the same position in SHAPE:
|
|
8
|
+
// B = blue (#1a4fd0) — the sphere
|
|
9
|
+
// S = silver (#e5e7eb) — the rings and the "Bitsocial" text
|
|
10
|
+
// . = no color (pass the glyph through as-is; use this for spaces)
|
|
11
|
+
//
|
|
12
|
+
// To retouch the art, find a glyph in SHAPE, then flip the character at the
|
|
13
|
+
// same column in the matching COLORS row. A common case: a ring cell came out
|
|
14
|
+
// blue because the sphere mask had more dots there — change its 'B' to 'S'.
|
|
15
|
+
//
|
|
16
|
+
// Both grids MUST have the same number of rows. Each row in COLORS must be at
|
|
17
|
+
// least as wide as the corresponding SHAPE row (extra chars are ignored).
|
|
18
|
+
// Palette sourced from bitsocialnet/bitsocial-web/about/tailwind.config.ts.
|
|
19
|
+
const SHAPE = [
|
|
20
|
+
" ⢀⣴⣿⣿⣦⡀ ",
|
|
21
|
+
" ⣾⣿⠁⠈⣿⣷⡀ ",
|
|
22
|
+
" ⢸⣿⡇ ⢸⣿⣇ ",
|
|
23
|
+
" ⢀⣀⣼⣿⣷⣶⣶⣶⣿⣿⣄⡀ ",
|
|
24
|
+
" ⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⡀ ",
|
|
25
|
+
" ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦ 888888b. d8b 888 d8b 888",
|
|
26
|
+
" ⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀ 888 \"88b Y8P 888 Y8P 888",
|
|
27
|
+
" ⣀⣤⣤⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⣀ 888 .88P 888 888",
|
|
28
|
+
"⣰⣿⡿⠛⠉⠉ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⠉⠉⠛⠟⣿⣦ 8888888K. 888 888888 .d8888b .d88b. .d8888b 888 8888b. 888",
|
|
29
|
+
"⠻⣷⣦⣤⣀⣀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⢀⣀⣀⣴⣿⠟ 888 \"Y88b 888 888 88K d88\"\"88b d88P\" 888 \"88b 888",
|
|
30
|
+
" ⠉⠛⠻⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠟⠛⠉ 888 888 888 888 \"Y8888b. 888 888 888 888 .d888888 888",
|
|
31
|
+
" ⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿ 888 d88P 888 Y88b. X88 Y88..88P Y88b. 888 888 888 888",
|
|
32
|
+
" ⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟ 8888888P\" 888 \"Y888 88888P' \"Y88P\" \"Y8888P 888 \"Y888888 888",
|
|
33
|
+
" ⠈⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁ ",
|
|
34
|
+
" ⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⠛⠉ ",
|
|
35
|
+
" ⢸⣿⡆ ⣿⡿ ",
|
|
36
|
+
" ⠈⢿⣷⡀⣸⣿⠃ ",
|
|
37
|
+
" ⠈⠿⣿⡿⠃ "
|
|
38
|
+
];
|
|
39
|
+
const COLORS = [
|
|
40
|
+
"................SSSSSS.......................................................................................",
|
|
41
|
+
"................SSSSSSS......................................................................................",
|
|
42
|
+
"...............SSSSSSSS......................................................................................",
|
|
43
|
+
".............BBBBBBBBSSBB....................................................................................",
|
|
44
|
+
"..........BBBBBBBBBBBSSBBBBB.................................................................................",
|
|
45
|
+
".........BBBBBBBBBBBBSSBBBBBB...............SSSSSSSS...SSS.SSS...............................SSS..........SSS",
|
|
46
|
+
".......BBBBBBBBBBBBBBSSBBBBBBBB.............SSS..SSSS..SSS.SSS...............................SSS..........SSS",
|
|
47
|
+
"..SSSSSBBBBBBBBBBBBBBSSBBBBBBBBSSSSSSS......SSS..SSSS......SSS............................................SSS",
|
|
48
|
+
"SSSSSS.BBBBBBBBBBBBBBSSBBBBBBBBSSSSSSS......SSSSSSSSS..SSS.SSSSSS.SSSSSSS...SSSSSS...SSSSSSS.SSS..SSSSSS..SSS",
|
|
49
|
+
"SSSSSS.BBBBBBBBBBBBBBSSBBBBBBBBSSSSSSS......SSS..SSSSS.SSS.SSS....SSS......SSSSSSSS.SSSSS....SSS.....SSSS.SSS",
|
|
50
|
+
"..SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS......SSS....SSS.SSS.SSS....SSSSSSSS.SSS..SSS.SSS......SSS.SSSSSSSS.SSS",
|
|
51
|
+
".......BBBBBBBBBBBBBBSSBBBBBBBBBBBBBBB......SSS...SSSS.SSS.SSSSS.......SSS.SSSSSSSS.SSSSS....SSS.SSS..SSS.SSS",
|
|
52
|
+
".........BBBBBBBBBBBBSSBBBBBBBBB............SSSSSSSSS..SSS..SSSSS..SSSSSSS..SSSSSS...SSSSSSS.SSS.SSSSSSSS.SSS",
|
|
53
|
+
"..........BBBBBBBBBBBSSBBBBBBB...............................................................................",
|
|
54
|
+
".............BBBBBBBBSSBBBB..................................................................................",
|
|
55
|
+
"...............SSSSSSSSS.....................................................................................",
|
|
56
|
+
"...............SSSSSSSS......................................................................................",
|
|
57
|
+
"................SSSSSS......................................................................................."
|
|
58
|
+
];
|
|
59
|
+
const BLUE = "\x1b[38;2;26;79;208m";
|
|
60
|
+
const SILVER = "\x1b[38;2;229;231;235m";
|
|
61
|
+
const RESET = "\x1b[0m";
|
|
62
|
+
function paint(shape, colors) {
|
|
63
|
+
let out = "";
|
|
64
|
+
let current = ".";
|
|
65
|
+
for (let i = 0; i < shape.length; i++) {
|
|
66
|
+
const glyph = shape[i];
|
|
67
|
+
const want = colors[i] ?? ".";
|
|
68
|
+
if (want !== current) {
|
|
69
|
+
if (current !== ".")
|
|
70
|
+
out += RESET;
|
|
71
|
+
if (want === "B")
|
|
72
|
+
out += BLUE;
|
|
73
|
+
else if (want === "S")
|
|
74
|
+
out += SILVER;
|
|
75
|
+
current = want;
|
|
76
|
+
}
|
|
77
|
+
out += glyph;
|
|
78
|
+
}
|
|
79
|
+
if (current !== ".")
|
|
80
|
+
out += RESET;
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
function supportsColor() {
|
|
84
|
+
if (process.env["NO_COLOR"])
|
|
85
|
+
return false;
|
|
86
|
+
if (process.env["FORCE_COLOR"])
|
|
87
|
+
return true;
|
|
88
|
+
return Boolean(process.stdout.isTTY);
|
|
89
|
+
}
|
|
90
|
+
export function printBanner() {
|
|
91
|
+
const useColor = supportsColor();
|
|
92
|
+
const lines = SHAPE.map((row, i) => (useColor ? paint(row, COLORS[i] ?? "") : row));
|
|
93
|
+
process.stdout.write(lines.join("\n") + "\n\n");
|
|
94
|
+
}
|
|
@@ -3,7 +3,11 @@ export default class Get extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
address: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
address: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
publicKey: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
11
|
};
|
|
8
12
|
run(): Promise<void>;
|
|
9
13
|
}
|
|
@@ -1,24 +1,44 @@
|
|
|
1
|
-
import { Args } from "@oclif/core";
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
2
|
import { BaseCommand } from "../../base-command.js";
|
|
3
3
|
import * as remeda from "remeda";
|
|
4
4
|
export default class Get extends BaseCommand {
|
|
5
5
|
static description = "Fetch a local or remote community, and print its json in the terminal";
|
|
6
6
|
static examples = [
|
|
7
7
|
"bitsocial community get plebmusic.bso",
|
|
8
|
-
"bitsocial community get 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu"
|
|
8
|
+
"bitsocial community get 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu",
|
|
9
|
+
"bitsocial community get --name my-community",
|
|
10
|
+
"bitsocial community get --publicKey 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu"
|
|
9
11
|
];
|
|
10
12
|
static args = {
|
|
11
13
|
address: Args.string({
|
|
12
14
|
name: "address",
|
|
13
|
-
required:
|
|
15
|
+
required: false,
|
|
14
16
|
description: "Address of the community to fetch"
|
|
15
17
|
})
|
|
16
18
|
};
|
|
19
|
+
static flags = {
|
|
20
|
+
name: Flags.string({
|
|
21
|
+
description: "Name of the community to fetch"
|
|
22
|
+
}),
|
|
23
|
+
publicKey: Flags.string({
|
|
24
|
+
description: "Public key of the community to fetch"
|
|
25
|
+
})
|
|
26
|
+
};
|
|
17
27
|
async run() {
|
|
18
28
|
const { args, flags } = await this.parse(Get);
|
|
29
|
+
const lookupParam = {};
|
|
30
|
+
if (args.address)
|
|
31
|
+
lookupParam.address = args.address;
|
|
32
|
+
if (flags.name)
|
|
33
|
+
lookupParam.name = flags.name;
|
|
34
|
+
if (flags.publicKey)
|
|
35
|
+
lookupParam.publicKey = flags.publicKey;
|
|
36
|
+
if (Object.keys(lookupParam).length === 0) {
|
|
37
|
+
this.error("At least one of address argument, --name, or --publicKey must be provided");
|
|
38
|
+
}
|
|
19
39
|
const pkc = await this._connectToPkcRpc(flags.pkcRpcUrl.toString());
|
|
20
40
|
try {
|
|
21
|
-
const community = await pkc.getCommunity(
|
|
41
|
+
const community = await pkc.getCommunity(lookupParam);
|
|
22
42
|
const communityJson = JSON.parse(JSON.stringify(community));
|
|
23
43
|
this.logJson({ posts: communityJson.posts, ...remeda.omit(communityJson, ["posts"]) }); // make sure posts is printed first, because most users won't look at it
|
|
24
44
|
}
|
|
@@ -5,6 +5,7 @@ import path from "path";
|
|
|
5
5
|
import tcpPortUsed from "tcp-port-used";
|
|
6
6
|
import { getLanIpV4Address, PKCLogger, setupDebugLogger, loadKuboConfigFile, parseMultiAddrKuboRpcToUrl, parseMultiAddrIpfsGatewayToUrl } from "../../util.js";
|
|
7
7
|
import { startDaemonServer } from "../../webui/daemon-server.js";
|
|
8
|
+
import { printBanner } from "../ascii-banner.js";
|
|
8
9
|
import { loadChallengesIntoPKC } from "../../challenge-packages/challenge-utils.js";
|
|
9
10
|
import { migrateDataDirectory } from "../../common-utils/data-migration.js";
|
|
10
11
|
import { createBsoResolvers } from "../../common-utils/resolvers.js";
|
|
@@ -149,6 +150,7 @@ export default class Daemon extends Command {
|
|
|
149
150
|
return { logFilePath, stdoutWrite };
|
|
150
151
|
}
|
|
151
152
|
async run() {
|
|
153
|
+
printBanner();
|
|
152
154
|
// Non-blocking update check — fire-and-forget, won't delay startup
|
|
153
155
|
import("../../update/npm-registry.js")
|
|
154
156
|
.then(({ fetchLatestVersion }) => fetchLatestVersion().then(async (latest) => {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { printBanner } from "../../ascii-banner.js";
|
|
2
|
+
const hook = async function (opts) {
|
|
3
|
+
// Skip when --version is being handled by version-hook
|
|
4
|
+
if (process.argv.includes("--version"))
|
|
5
|
+
return;
|
|
6
|
+
// Show banner on bare `bitsocial` invocation (no command, no help flag).
|
|
7
|
+
// oclif sets opts.id to undefined when no command is matched; argv length > 2
|
|
8
|
+
// means the user passed flags/args and expects normal command output.
|
|
9
|
+
const bareInvocation = process.argv.length <= 2;
|
|
10
|
+
const helpInvocation = !opts.id && (process.argv.includes("--help") || process.argv.includes("-h") || process.argv.includes("help"));
|
|
11
|
+
if (bareInvocation || helpInvocation) {
|
|
12
|
+
printBanner();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export default hook;
|
package/oclif.manifest.json
CHANGED
|
@@ -417,13 +417,15 @@
|
|
|
417
417
|
"address": {
|
|
418
418
|
"description": "Address of the community to fetch",
|
|
419
419
|
"name": "address",
|
|
420
|
-
"required":
|
|
420
|
+
"required": false
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
"description": "Fetch a local or remote community, and print its json in the terminal",
|
|
424
424
|
"examples": [
|
|
425
425
|
"bitsocial community get plebmusic.bso",
|
|
426
|
-
"bitsocial community get 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu"
|
|
426
|
+
"bitsocial community get 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu",
|
|
427
|
+
"bitsocial community get --name my-community",
|
|
428
|
+
"bitsocial community get --publicKey 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu"
|
|
427
429
|
],
|
|
428
430
|
"flags": {
|
|
429
431
|
"pkcRpcUrl": {
|
|
@@ -434,6 +436,20 @@
|
|
|
434
436
|
"hasDynamicHelp": false,
|
|
435
437
|
"multiple": false,
|
|
436
438
|
"type": "option"
|
|
439
|
+
},
|
|
440
|
+
"name": {
|
|
441
|
+
"description": "Name of the community to fetch",
|
|
442
|
+
"name": "name",
|
|
443
|
+
"hasDynamicHelp": false,
|
|
444
|
+
"multiple": false,
|
|
445
|
+
"type": "option"
|
|
446
|
+
},
|
|
447
|
+
"publicKey": {
|
|
448
|
+
"description": "Public key of the community to fetch",
|
|
449
|
+
"name": "publicKey",
|
|
450
|
+
"hasDynamicHelp": false,
|
|
451
|
+
"multiple": false,
|
|
452
|
+
"type": "option"
|
|
437
453
|
}
|
|
438
454
|
},
|
|
439
455
|
"hasDynamicHelp": false,
|
|
@@ -687,5 +703,5 @@
|
|
|
687
703
|
]
|
|
688
704
|
}
|
|
689
705
|
},
|
|
690
|
-
"version": "0.19.
|
|
706
|
+
"version": "0.19.42"
|
|
691
707
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitsocial/bitsocial-cli",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.42",
|
|
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",
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"hooks": {
|
|
64
64
|
"init": [
|
|
65
|
-
"./dist/cli/hooks/init/version-hook"
|
|
65
|
+
"./dist/cli/hooks/init/version-hook",
|
|
66
|
+
"./dist/cli/hooks/init/banner-hook"
|
|
66
67
|
],
|
|
67
68
|
"prerun": [
|
|
68
69
|
"./dist/cli/hooks/prerun/parse-dynamic-flags-hook"
|