@frontstackdev/cli 0.0.0-canary-20240830084126
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 +95 -0
- package/dist/frontstack.mjs +4615 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Frontstack CLI
|
|
2
|
+
|
|
3
|
+
Frontstack CLI is a command line interface for using Frontstack in local development.
|
|
4
|
+
|
|
5
|
+
It allows you to login to you Frontstack account, push local changes to a project or generate the API client for a project and environment.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npx frontstack
|
|
11
|
+
|
|
12
|
+
Frontstack CLI
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
-V, --version output the version number
|
|
16
|
+
-h, --help display help for command
|
|
17
|
+
|
|
18
|
+
Commands:
|
|
19
|
+
login Connect the CLI with you Frontstack account
|
|
20
|
+
logout Disconnect the CLI from your Frontstack account
|
|
21
|
+
info Show information about current project and user
|
|
22
|
+
project [options] Set current project
|
|
23
|
+
generate [options] Generate a JavaScript client for your project
|
|
24
|
+
|
|
25
|
+
help [command] display help for command
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Commands
|
|
29
|
+
|
|
30
|
+
### `frontstack login`
|
|
31
|
+
|
|
32
|
+
Login to your Frontstack account. You will be redirected to the Frontstack website to authenticate and authorize the CLI. After authorizing, you can select a project to work with using `frontstack project`.
|
|
33
|
+
|
|
34
|
+
### `frontstack info`
|
|
35
|
+
|
|
36
|
+
Provides information about the currently logged in user, their organization and currently selected project.
|
|
37
|
+
|
|
38
|
+
### `frontstack project`
|
|
39
|
+
|
|
40
|
+
Select current working project or display all projects
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# To List projects
|
|
44
|
+
frontstack project --list
|
|
45
|
+
|
|
46
|
+
# To select a project
|
|
47
|
+
frontstack project -p a2dc8820-2e52-427a-8d58-0256f28d3db9
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `frontstack generate`
|
|
51
|
+
|
|
52
|
+
Generate a JavaScript client for your specific project and environment.
|
|
53
|
+
|
|
54
|
+
Before running this command, make sure a current working project is selected, using `frontstack project`
|
|
55
|
+
|
|
56
|
+
## Development
|
|
57
|
+
|
|
58
|
+
Configs are set in the `config.ts` file. You can also control the configs using environment variables.
|
|
59
|
+
|
|
60
|
+
### Configure
|
|
61
|
+
|
|
62
|
+
By default, the CLI uses the public Frontstack API instance. You can either override the URL directly
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
FRONTSTACK_CLI_API_ROOT=[your-url] pnpm frontstack login
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
or enable dev mode (which uses the local Frontstack API instance)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
FRONTSTACK_CLI_DEV_MODE=1 pnpm frontstack login
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Run
|
|
75
|
+
|
|
76
|
+
There are two options to run the CLI in development mode:
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
1. Building the app and running the built file (recommended)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
$ pnpm frontstack [command] // e.g. pnpm frontstack info
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
1. Run using [tsx](https://tsx.is/) (this will compile the typescript files on the fly)
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
$ pnpm start [command] // e.g. pnpm start info
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Build
|
|
92
|
+
|
|
93
|
+
The application is built using [pkgroll](https://github.com/privatenumber/pkgroll). The CLI is exported as an ES module and compiled to a single file in the `dist` folder.
|
|
94
|
+
|
|
95
|
+
Build the file using `pnpm build` and run it using `node dist/frontstack.mjs`.
|