-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnosis.1
57 lines (57 loc) · 1.24 KB
/
gnosis.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.TH GNOSIS 1 "August 2023" "Version 1.0.0" "Gnosis Manual - VentGrey"
.SH NAME
gnosis \- generate TypeScript definition files from PocketBase JSON output
.SH SYNOPSIS
.B gnosis
.RB [ \-i
.RB < input.json > ]
.RB [ \-o
.RB < output.d.ts > ]
.SH DESCRIPTION
.PP
.B gnosis
is a CLI tool designed to generate TypeScript definition files from PocketBase JSON outputs. PocketBase JSON outputs typically contain a list of items, each with a special field @collectionName that specifies the type of the item. Gnosis uses this field to determine the name of the TypeScript interface it generates.
.SH OPTIONS
.TP
.B \-i, \-\-input
Specify the input JSON file.
.TP
.B \-o, \-\-output
Specify the output .d.ts file. If not specified, the result will be printed to stdout.
.SH EXAMPLES
.PP
Imagine you have a PocketBase JSON output from a collection named "bands", which looks like:
.PP
.nf
{
"page": 1,
"items": [
{
"@collectionName": "bands",
"name": "Opeth",
"genre": "Progressive Metal",
...
},
...
]
}
.fi
.PP
Running:
.PP
.nf
.BR $ " gnosis -i pocketbase.json"
.fi
.PP
Will print:
.PP
.nf
interface Bands {
name: string;
genre: string;
...
}
.fi
.SH AUTHOR
.PP
Written by VentGrey.