@skyreve/reve 1.0.2 → 1.0.4
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 +374 -136
- package/README.npm.md +86 -33
- package/bin/darwin/reve +0 -0
- package/bin/linux/reve +0 -0
- package/bin/reve +0 -0
- package/bin/windows/reve.exe +0 -0
- package/package.json +1 -1
- package/scripts/reve.js +12 -12
package/README.md
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
# Reve - SkyReve Platform Command Line Tool
|
|
2
2
|
|
|
3
|
-
Reve
|
|
3
|
+
Reve is a comprehensive command line tool that connects the SkyReve platform with GitHub repositories to manage projects, environments, and deployments seamlessly. It provides a complete workflow for syncing local development with cloud environments.
|
|
4
4
|
|
|
5
|
-
## 📋
|
|
5
|
+
## 📋 Table of Contents
|
|
6
6
|
|
|
7
|
-
1. [
|
|
8
|
-
2. [
|
|
9
|
-
3. [
|
|
10
|
-
4. [
|
|
11
|
-
5. [Reve CLI
|
|
12
|
-
6. [
|
|
7
|
+
1. [Installation](#1-installation)
|
|
8
|
+
2. [Development Setup](#2-development-setup)
|
|
9
|
+
3. [Build](#3-build)
|
|
10
|
+
4. [Environment Configuration](#4-environment-configuration)
|
|
11
|
+
5. [Using Reve CLI](#5-using-reve-cli)
|
|
12
|
+
6. [Development Tools](#6-development-tools)
|
|
13
|
+
7. [Publishing to npm](#7-publishing-to-npm)
|
|
14
|
+
8. [Project Structure](#8-project-structure)
|
|
13
15
|
|
|
14
16
|
---
|
|
15
17
|
|
|
16
|
-
## **1.
|
|
18
|
+
## **1. Installation**
|
|
17
19
|
|
|
18
|
-
### **1.1
|
|
20
|
+
### **1.1 Install via npm (Recommended)**
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
To use Reve CLI in other npm projects:
|
|
21
23
|
|
|
22
24
|
```bash
|
|
23
25
|
npm install @skyreve/reve
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
After installation, you can run it using `npx reve`:
|
|
27
29
|
|
|
28
30
|
```bash
|
|
29
31
|
npx reve --help
|
|
30
32
|
npx reve start
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
### **1.2
|
|
35
|
+
### **1.2 Global Installation**
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
To install globally:
|
|
36
38
|
|
|
37
39
|
```bash
|
|
38
40
|
npm install -g @skyreve/reve
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
After installation, you can run it directly with the `reve` command:
|
|
42
44
|
|
|
43
45
|
```bash
|
|
44
46
|
reve --help
|
|
@@ -47,11 +49,11 @@ reve start
|
|
|
47
49
|
|
|
48
50
|
---
|
|
49
51
|
|
|
50
|
-
## **2.
|
|
52
|
+
## **2. Development Setup**
|
|
51
53
|
|
|
52
|
-
### **2.1 Go
|
|
54
|
+
### **2.1 Install Go**
|
|
53
55
|
|
|
54
|
-
Reve CLI
|
|
56
|
+
Reve CLI requires **Go**. If Go is not installed, install it using the following commands:
|
|
55
57
|
|
|
56
58
|
**macOS:**
|
|
57
59
|
|
|
@@ -71,11 +73,11 @@ sudo yum install golang
|
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
**Windows:**
|
|
74
|
-
[Go
|
|
76
|
+
Download and install from the [official Go website](https://golang.org/dl/).
|
|
75
77
|
|
|
76
|
-
### **2.2
|
|
78
|
+
### **2.2 Initialize Project**
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
Clone the project and install dependencies:
|
|
79
81
|
|
|
80
82
|
```bash
|
|
81
83
|
git clone git@github.com:SkyReve/reve-cli.git
|
|
@@ -85,38 +87,38 @@ go mod tidy
|
|
|
85
87
|
|
|
86
88
|
---
|
|
87
89
|
|
|
88
|
-
## **3.
|
|
90
|
+
## **3. Build**
|
|
89
91
|
|
|
90
|
-
### **3.1
|
|
92
|
+
### **3.1 Basic Build**
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
To build a binary for the current OS:
|
|
93
95
|
|
|
94
96
|
```bash
|
|
95
97
|
make
|
|
96
98
|
```
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
or:
|
|
99
101
|
|
|
100
102
|
```bash
|
|
101
103
|
make build
|
|
102
104
|
```
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
After building, the `reve` binary will be created in the `bin/` directory:
|
|
105
107
|
|
|
106
108
|
```bash
|
|
107
109
|
bin/
|
|
108
110
|
└── reve
|
|
109
111
|
```
|
|
110
112
|
|
|
111
|
-
### **3.2
|
|
113
|
+
### **3.2 Build for All Operating Systems**
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
To build binaries for all platforms (Linux, macOS, Windows):
|
|
114
116
|
|
|
115
117
|
```bash
|
|
116
118
|
make build-all
|
|
117
119
|
```
|
|
118
120
|
|
|
119
|
-
|
|
121
|
+
Building for all OS will create files in the following structure:
|
|
120
122
|
|
|
121
123
|
```bash
|
|
122
124
|
bin/
|
|
@@ -125,204 +127,231 @@ bin/
|
|
|
125
127
|
└── windows/reve.exe
|
|
126
128
|
```
|
|
127
129
|
|
|
128
|
-
### **3.3
|
|
130
|
+
### **3.3 Verify Built Binaries**
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
Built binaries are stored in the `bin/` directory. To check:
|
|
131
133
|
|
|
132
134
|
```bash
|
|
133
135
|
ls -la bin/
|
|
134
|
-
#
|
|
136
|
+
# or
|
|
135
137
|
tree bin/
|
|
136
138
|
```
|
|
137
139
|
|
|
138
140
|
---
|
|
139
141
|
|
|
140
|
-
## **4.
|
|
142
|
+
## **4. Environment Configuration**
|
|
141
143
|
|
|
142
|
-
Reve CLI
|
|
144
|
+
Reve CLI uses the `REVE_ENV` environment variable to connect to different API servers.
|
|
143
145
|
|
|
144
|
-
### **🔹
|
|
146
|
+
### **🔹 Development Environment (dev)**
|
|
145
147
|
|
|
146
148
|
```bash
|
|
147
149
|
make run-dev
|
|
148
|
-
#
|
|
150
|
+
# or
|
|
149
151
|
REVE_ENV=dev ./bin/reve
|
|
150
152
|
```
|
|
151
153
|
|
|
152
154
|
- **BaseURL:** `http://localhost:8000`
|
|
153
155
|
- **GitHub App:** [https://github.com/apps/skyreve-staging](https://github.com/apps/skyreve-staging)
|
|
154
|
-
-
|
|
156
|
+
- **Description:** For development environment. Used for testing new features and debugging.
|
|
155
157
|
|
|
156
|
-
### **🔹
|
|
158
|
+
### **🔹 Staging Environment (staging)**
|
|
157
159
|
|
|
158
160
|
```bash
|
|
159
161
|
make run-staging
|
|
160
|
-
#
|
|
162
|
+
# or
|
|
161
163
|
REVE_ENV=staging ./bin/reve
|
|
162
164
|
```
|
|
163
165
|
|
|
164
166
|
- **BaseURL:** `https://api.hellreve.world`
|
|
165
167
|
- **GitHub App:** [https://github.com/apps/skyreve-staging](https://github.com/apps/skyreve-staging)
|
|
166
|
-
-
|
|
168
|
+
- **Description:** For staging environment. Used for final QA and validation under conditions similar to production.
|
|
167
169
|
|
|
168
|
-
### **🔹
|
|
170
|
+
### **🔹 Production Environment (production)**
|
|
169
171
|
|
|
170
172
|
```bash
|
|
171
173
|
make run-production
|
|
172
|
-
#
|
|
174
|
+
# or
|
|
173
175
|
./bin/reve
|
|
174
176
|
```
|
|
175
177
|
|
|
176
178
|
- **BaseURL:** `https://api.skyreve.cloud`
|
|
177
179
|
- **GitHub App:** [https://github.com/apps/skyreve](https://github.com/apps/skyreve)
|
|
178
|
-
-
|
|
180
|
+
- **Description:** For production environment. Used in the actual service environment provided to real users.
|
|
179
181
|
|
|
180
182
|
---
|
|
181
183
|
|
|
182
|
-
## **5. Reve CLI
|
|
184
|
+
## **5. Using Reve CLI**
|
|
183
185
|
|
|
184
|
-
### **5.1
|
|
186
|
+
### **5.1 Running via npm (Recommended)**
|
|
185
187
|
|
|
186
|
-
|
|
188
|
+
When installed via npm:
|
|
187
189
|
|
|
188
190
|
```bash
|
|
189
191
|
npx reve [COMMAND] [OPTIONS]
|
|
190
|
-
#
|
|
192
|
+
# or if installed globally
|
|
191
193
|
reve [COMMAND] [OPTIONS]
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
### **5.2
|
|
196
|
+
### **5.2 Running Binary Directly**
|
|
195
197
|
|
|
196
|
-
|
|
198
|
+
When running the built binary directly:
|
|
197
199
|
|
|
198
200
|
```bash
|
|
199
|
-
#
|
|
201
|
+
# Development environment
|
|
200
202
|
REVE_ENV=dev ./bin/reve [COMMAND] [OPTIONS]
|
|
201
203
|
|
|
202
|
-
#
|
|
204
|
+
# Staging environment
|
|
203
205
|
REVE_ENV=staging ./bin/reve [COMMAND] [OPTIONS]
|
|
204
206
|
|
|
205
|
-
#
|
|
207
|
+
# Production environment (default)
|
|
206
208
|
./bin/reve [COMMAND] [OPTIONS]
|
|
207
209
|
```
|
|
208
210
|
|
|
209
|
-
### **5.3
|
|
211
|
+
### **5.3 Getting Help**
|
|
210
212
|
|
|
211
213
|
```bash
|
|
212
214
|
reve --help
|
|
213
|
-
#
|
|
215
|
+
# or
|
|
214
216
|
npx reve --help
|
|
215
217
|
```
|
|
216
218
|
|
|
217
|
-
### **5.4
|
|
219
|
+
### **5.4 Main Commands**
|
|
218
220
|
|
|
219
|
-
#### **🔹
|
|
221
|
+
#### **🔹 Basic Commands**
|
|
220
222
|
|
|
221
|
-
|
|
|
222
|
-
| -------------------- |
|
|
223
|
-
| `reve start` |
|
|
224
|
-
| `reve login [email]` | SkyReve
|
|
225
|
-
| `reve project` |
|
|
223
|
+
| Command | Description |
|
|
224
|
+
| -------------------- | ------------------------------------------------------------------------------- |
|
|
225
|
+
| `reve start` | **Quick Start**: Complete 6-step setup process and start environment management |
|
|
226
|
+
| `reve login [email]` | Login to SkyReve platform |
|
|
227
|
+
| `reve project` | Select/create SkyReve project to work with |
|
|
226
228
|
|
|
227
|
-
#### **🔹
|
|
229
|
+
#### **🔹 Environment Management Commands (`reve env`)**
|
|
228
230
|
|
|
229
|
-
|
|
|
230
|
-
| -------------------------- |
|
|
231
|
-
| `reve env` |
|
|
232
|
-
| `reve env start` |
|
|
233
|
-
| `reve env info` |
|
|
234
|
-
| `reve env list` |
|
|
235
|
-
| `reve env link <reve_env>` | GitHub
|
|
236
|
-
| `reve env sync` |
|
|
237
|
-
| `reve env deploy` |
|
|
231
|
+
| Command | Description |
|
|
232
|
+
| -------------------------- | --------------------------------------------------------------------------- |
|
|
233
|
+
| `reve env` | Start interactive environment management (same as `reve env start`) |
|
|
234
|
+
| `reve env start` | Start interactive environment management |
|
|
235
|
+
| `reve env info` | Check project info, Git repository info, and GitHub App installation status |
|
|
236
|
+
| `reve env list` | List all Reve environments with linked GitHub branch information |
|
|
237
|
+
| `reve env link <reve_env>` | Link GitHub branch to specific Reve environment |
|
|
238
|
+
| `reve env sync` | Sync current repository branch with Reve environment |
|
|
239
|
+
| `reve env deploy` | Deploy current repository branch to Reve environment |
|
|
238
240
|
|
|
239
|
-
#### **🔹 GitHub
|
|
241
|
+
#### **🔹 GitHub Commands (`reve github`)**
|
|
240
242
|
|
|
241
|
-
|
|
|
242
|
-
| --------------------- |
|
|
243
|
-
| `reve github login` | GitHub
|
|
244
|
-
| `reve github install` |
|
|
243
|
+
| Command | Description |
|
|
244
|
+
| --------------------- | ----------------------------------------- |
|
|
245
|
+
| `reve github login` | Login to GitHub using Device Flow |
|
|
246
|
+
| `reve github install` | Install GitHub App for current repository |
|
|
245
247
|
|
|
246
|
-
### **5.5
|
|
248
|
+
### **5.5 Usage Examples**
|
|
247
249
|
|
|
248
|
-
####
|
|
250
|
+
#### **First-time Setup (Recommended)**
|
|
249
251
|
|
|
250
252
|
```bash
|
|
251
|
-
# 1.
|
|
253
|
+
# 1. Complete 6-step setup process (Quick Start)
|
|
252
254
|
reve start
|
|
253
255
|
```
|
|
254
256
|
|
|
255
|
-
|
|
257
|
+
This **Quick Start** command automatically performs the following 6 steps:
|
|
256
258
|
|
|
257
|
-
1. SkyReve
|
|
258
|
-
2.
|
|
259
|
-
3. GitHub
|
|
260
|
-
4. GitHub App
|
|
261
|
-
5.
|
|
259
|
+
1. **🔐 Step 1/6**: Login to SkyReve platform
|
|
260
|
+
2. **📁 Step 2/6**: Select/create a project
|
|
261
|
+
3. **🐙 Step 3/6**: Login to GitHub
|
|
262
|
+
4. **🔧 Step 4/6**: Install GitHub App
|
|
263
|
+
5. **📦 Step 5/6**: Link GitHub branch to Reve environment
|
|
264
|
+
6. **🚀 Step 6/6**: Start syncing Reve environment
|
|
262
265
|
|
|
263
|
-
|
|
266
|
+
After completion, you'll see: `🎉 All setup steps completed successfully!`
|
|
267
|
+
|
|
268
|
+
#### **Individual Setup**
|
|
264
269
|
|
|
265
270
|
```bash
|
|
266
|
-
# 1. SkyReve
|
|
271
|
+
# 1. Login to SkyReve platform
|
|
267
272
|
reve login your-email@example.com
|
|
268
273
|
|
|
269
|
-
# 2.
|
|
274
|
+
# 2. Select project
|
|
270
275
|
reve project
|
|
271
276
|
|
|
272
|
-
# 3. GitHub
|
|
277
|
+
# 3. Login to GitHub
|
|
273
278
|
reve github login
|
|
274
279
|
|
|
275
|
-
# 4. GitHub App
|
|
280
|
+
# 4. Install GitHub App
|
|
276
281
|
reve github install
|
|
277
282
|
|
|
278
|
-
# 5.
|
|
283
|
+
# 5. Start environment management
|
|
279
284
|
reve env start
|
|
280
285
|
```
|
|
281
286
|
|
|
282
|
-
####
|
|
287
|
+
#### **Daily Usage**
|
|
283
288
|
|
|
284
289
|
```bash
|
|
285
|
-
#
|
|
290
|
+
# Check environment list
|
|
286
291
|
reve env list
|
|
287
292
|
|
|
288
|
-
#
|
|
293
|
+
# Link branch to specific environment
|
|
289
294
|
reve env link main
|
|
290
295
|
|
|
291
|
-
#
|
|
296
|
+
# Sync current branch
|
|
292
297
|
reve env sync
|
|
293
298
|
|
|
294
|
-
#
|
|
299
|
+
# Deploy current branch
|
|
295
300
|
reve env deploy
|
|
296
301
|
|
|
297
|
-
#
|
|
302
|
+
# Force deploy (even with conflicts)
|
|
298
303
|
reve env deploy --force
|
|
299
304
|
```
|
|
300
305
|
|
|
306
|
+
### **5.6 Advanced Features**
|
|
307
|
+
|
|
308
|
+
#### **🔹 File Generation**
|
|
309
|
+
|
|
310
|
+
The `reve env sync` command automatically generates the following files in your project:
|
|
311
|
+
|
|
312
|
+
- **Settings**: `src/settings.yaml` - Project configuration
|
|
313
|
+
- **Tables**: `src/tables/*.yaml` - Database table definitions
|
|
314
|
+
- **APIs**: `src/apis/*.yaml` + `src/apis/*.apy` - API endpoint definitions and view code
|
|
315
|
+
- **Libraries**: `src/libs/*.apy` - Code library implementations
|
|
316
|
+
|
|
317
|
+
#### **🔹 Environment Management**
|
|
318
|
+
|
|
319
|
+
- **Multiple Environments**: Support for dev, staging, production environments
|
|
320
|
+
- **Branch Linking**: Link specific Git branches to Reve environments
|
|
321
|
+
- **Auto Deploy**: Configure automatic deployment on Git push
|
|
322
|
+
- **Conflict Resolution**: Handle deployment conflicts with force option
|
|
323
|
+
|
|
324
|
+
#### **🔹 GitHub Integration**
|
|
325
|
+
|
|
326
|
+
- **Device Flow Authentication**: Secure GitHub login without storing passwords
|
|
327
|
+
- **GitHub App Installation**: Automated GitHub App setup for repositories
|
|
328
|
+
- **Repository Linking**: Connect GitHub repositories to SkyReve projects
|
|
329
|
+
|
|
301
330
|
---
|
|
302
331
|
|
|
303
|
-
## **6.
|
|
332
|
+
## **6. Development Tools**
|
|
304
333
|
|
|
305
|
-
### **6.1
|
|
334
|
+
### **6.1 Clean**
|
|
306
335
|
|
|
307
|
-
|
|
336
|
+
To clean up unnecessary build files:
|
|
308
337
|
|
|
309
338
|
```bash
|
|
310
339
|
make clean
|
|
311
340
|
```
|
|
312
341
|
|
|
313
|
-
### **6.2
|
|
342
|
+
### **6.2 Test and Lint**
|
|
314
343
|
|
|
315
344
|
```bash
|
|
316
|
-
#
|
|
345
|
+
# Run tests
|
|
317
346
|
make test
|
|
318
347
|
|
|
319
|
-
#
|
|
348
|
+
# Run linter
|
|
320
349
|
make lint
|
|
321
350
|
```
|
|
322
351
|
|
|
323
|
-
### **6.3
|
|
352
|
+
### **6.3 Development Mode**
|
|
324
353
|
|
|
325
|
-
|
|
354
|
+
For quick testing during development:
|
|
326
355
|
|
|
327
356
|
```bash
|
|
328
357
|
make run
|
|
@@ -330,42 +359,251 @@ make run
|
|
|
330
359
|
|
|
331
360
|
---
|
|
332
361
|
|
|
333
|
-
## **7.
|
|
362
|
+
## **7. Publishing to npm**
|
|
363
|
+
|
|
364
|
+
### **7.1 Prerequisites**
|
|
365
|
+
|
|
366
|
+
Before publishing to npm, ensure you have:
|
|
367
|
+
|
|
368
|
+
1. **npm account**: Create an account at [npmjs.com](https://www.npmjs.com/)
|
|
369
|
+
2. **npm CLI**: Install npm CLI globally if not already installed
|
|
370
|
+
3. **Authentication**: Login to npm using `npm login`
|
|
371
|
+
|
|
372
|
+
### **7.2 Build Process**
|
|
373
|
+
|
|
374
|
+
Before publishing, you need to build the binaries for all platforms:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Build binaries for all platforms
|
|
378
|
+
npm run build
|
|
379
|
+
# or
|
|
380
|
+
make build-all
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
This creates binaries in the following structure:
|
|
384
|
+
|
|
385
|
+
```
|
|
386
|
+
bin/
|
|
387
|
+
├── linux/reve
|
|
388
|
+
├── darwin/reve
|
|
389
|
+
└── windows/reve.exe
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### **7.3 Version Management**
|
|
393
|
+
|
|
394
|
+
Update the version in `package.json` before publishing:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
# Patch version (1.0.0 -> 1.0.1)
|
|
398
|
+
npm version patch
|
|
399
|
+
|
|
400
|
+
# Minor version (1.0.0 -> 1.1.0)
|
|
401
|
+
npm version minor
|
|
402
|
+
|
|
403
|
+
# Major version (1.0.0 -> 2.0.0)
|
|
404
|
+
npm version major
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### **7.4 Publishing Steps**
|
|
408
|
+
|
|
409
|
+
1. **Login to npm**:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
npm login
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
2. **Build binaries**:
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
npm run build
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
3. **Publish to npm**:
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
npm publish
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### **7.5 Publishing to Different Registries**
|
|
428
|
+
|
|
429
|
+
#### **Publishing to npm (Public)**
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
npm publish
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
#### **Publishing to npm (Private)**
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
npm publish --access private
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### **Publishing to Custom Registry**
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
npm publish --registry https://your-registry.com
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### **7.6 Verification**
|
|
448
|
+
|
|
449
|
+
After publishing, verify the package:
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
# Check package info
|
|
453
|
+
npm info @skyreve/reve
|
|
454
|
+
|
|
455
|
+
# Test installation
|
|
456
|
+
npm install @skyreve/reve
|
|
457
|
+
npx reve --help
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### **7.7 Automated Publishing**
|
|
461
|
+
|
|
462
|
+
For automated publishing, you can use GitHub Actions or similar CI/CD tools:
|
|
463
|
+
|
|
464
|
+
```yaml
|
|
465
|
+
# .github/workflows/publish.yml
|
|
466
|
+
name: Publish to npm
|
|
467
|
+
|
|
468
|
+
on:
|
|
469
|
+
release:
|
|
470
|
+
types: [published]
|
|
471
|
+
|
|
472
|
+
jobs:
|
|
473
|
+
publish:
|
|
474
|
+
runs-on: ubuntu-latest
|
|
475
|
+
steps:
|
|
476
|
+
- uses: actions/checkout@v2
|
|
477
|
+
- uses: actions/setup-node@v2
|
|
478
|
+
with:
|
|
479
|
+
node-version: "16"
|
|
480
|
+
registry-url: "https://registry.npmjs.org"
|
|
481
|
+
- run: npm ci
|
|
482
|
+
- run: npm run build
|
|
483
|
+
- run: npm publish
|
|
484
|
+
env:
|
|
485
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### **7.8 Troubleshooting**
|
|
489
|
+
|
|
490
|
+
#### **Common Issues:**
|
|
491
|
+
|
|
492
|
+
1. **"Package already exists"**: Update version number
|
|
493
|
+
2. **"Authentication failed"**: Run `npm login` again
|
|
494
|
+
3. **"Binary not found"**: Ensure `npm run build` completed successfully
|
|
495
|
+
4. **"Permission denied"**: Check npm permissions for the package
|
|
496
|
+
|
|
497
|
+
#### **Useful Commands:**
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
# Check who you're logged in as
|
|
501
|
+
npm whoami
|
|
502
|
+
|
|
503
|
+
# Check package permissions
|
|
504
|
+
npm access ls-packages
|
|
505
|
+
|
|
506
|
+
# Unpublish (only within 24 hours)
|
|
507
|
+
npm unpublish @skyreve/reve@version
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
## **8. Project Structure**
|
|
334
513
|
|
|
335
514
|
```
|
|
336
515
|
reve-cli/
|
|
337
|
-
├── cmd/ #
|
|
338
|
-
│ ├── root.go #
|
|
339
|
-
│ ├── start.go #
|
|
340
|
-
│ ├── login.go #
|
|
341
|
-
│ ├── project.go #
|
|
342
|
-
│ ├── env.go #
|
|
343
|
-
│ ├── github.go # GitHub
|
|
344
|
-
│ ├── env/ #
|
|
345
|
-
│ │ ├── start.go #
|
|
346
|
-
│ │ ├── info.go #
|
|
347
|
-
│ │ ├── list.go #
|
|
348
|
-
│ │ ├── link.go #
|
|
349
|
-
│ │ ├── sync.go #
|
|
350
|
-
│ │ ├── deploy.go #
|
|
351
|
-
│ │ └── common.go #
|
|
352
|
-
│ └── github/ # GitHub
|
|
353
|
-
│ ├── login.go # GitHub
|
|
354
|
-
│ └── install.go # GitHub App
|
|
355
|
-
├── internal/ #
|
|
356
|
-
│ ├──
|
|
357
|
-
│ ├──
|
|
358
|
-
│ ├──
|
|
359
|
-
│ ├──
|
|
360
|
-
│ ├──
|
|
361
|
-
│
|
|
362
|
-
├──
|
|
363
|
-
├──
|
|
364
|
-
|
|
516
|
+
├── cmd/ # Command definitions
|
|
517
|
+
│ ├── root.go # Root command with logging and config
|
|
518
|
+
│ ├── start.go # Complete setup start command (6-step process)
|
|
519
|
+
│ ├── login.go # SkyReve platform login with email/password
|
|
520
|
+
│ ├── project.go # Project selection/creation
|
|
521
|
+
│ ├── env.go # Environment management command group
|
|
522
|
+
│ ├── github.go # GitHub related commands group
|
|
523
|
+
│ ├── env/ # Environment management sub-commands
|
|
524
|
+
│ │ ├── start.go # Interactive environment management
|
|
525
|
+
│ │ ├── info.go # Project and environment information
|
|
526
|
+
│ │ ├── list.go # List all environments with branch info
|
|
527
|
+
│ │ ├── link.go # Link GitHub branch to environment
|
|
528
|
+
│ │ ├── sync.go # Sync files (settings, tables, APIs, libs)
|
|
529
|
+
│ │ ├── deploy.go # Deploy to environment
|
|
530
|
+
│ │ └── common.go # Common environment functions
|
|
531
|
+
│ └── github/ # GitHub sub-commands
|
|
532
|
+
│ ├── login.go # GitHub Device Flow authentication
|
|
533
|
+
│ └── install.go # GitHub App installation
|
|
534
|
+
├── internal/ # Internal packages
|
|
535
|
+
│ ├── api/ # SkyReve API client and data structures
|
|
536
|
+
│ ├── config/ # Configuration management (.reve directory)
|
|
537
|
+
│ ├── constants/ # Application constants
|
|
538
|
+
│ ├── gen/ # File generation (YAML files for tables, APIs, etc.)
|
|
539
|
+
│ ├── git/ # Git repository operations
|
|
540
|
+
│ ├── github/ # GitHub API client
|
|
541
|
+
│ ├── http/ # HTTP client utilities
|
|
542
|
+
│ ├── logger/ # Logging system
|
|
543
|
+
│ ├── reve/ # SkyReve platform utilities
|
|
544
|
+
│ └── cmd_common/ # Common command utilities
|
|
545
|
+
├── scripts/ # Node.js wrapper scripts
|
|
546
|
+
│ └── reve.js # Cross-platform binary launcher
|
|
547
|
+
├── bin/ # Built binaries (platform-specific)
|
|
548
|
+
├── samples/ # Example files and configurations
|
|
549
|
+
├── tests/ # Test files
|
|
550
|
+
├── main.go # Application entry point
|
|
551
|
+
├── package.json # npm package configuration
|
|
552
|
+
├── go.mod # Go module definition
|
|
553
|
+
├── Makefile # Build and development commands
|
|
554
|
+
└── README.md # This file
|
|
365
555
|
```
|
|
366
556
|
|
|
557
|
+
### **8.1 Key Components**
|
|
558
|
+
|
|
559
|
+
#### **🔹 Command Structure**
|
|
560
|
+
|
|
561
|
+
- **Cobra Framework**: Modern CLI framework with subcommands and flags
|
|
562
|
+
- **Persistent Flags**: Global logging and configuration options
|
|
563
|
+
- **Command Groups**: Organized commands (`env`, `github`)
|
|
564
|
+
|
|
565
|
+
#### **🔹 Configuration Management**
|
|
566
|
+
|
|
567
|
+
- **`.reve` Directory**: Local configuration storage
|
|
568
|
+
- **Multi-Environment**: Support for dev/staging/production configs
|
|
569
|
+
- **Secure Storage**: Encrypted token storage
|
|
570
|
+
|
|
571
|
+
#### **🔹 File Generation System**
|
|
572
|
+
|
|
573
|
+
- **YAML Configuration**: Human-readable configuration files for settings, tables, and API definitions
|
|
574
|
+
- **APY Implementation**: Actual implementation code files for APIs and libraries
|
|
575
|
+
- **Modular Structure**: Separate files for tables, APIs, libraries
|
|
576
|
+
- **Template System**: Consistent file generation across environments
|
|
577
|
+
|
|
578
|
+
#### **🔹 GitHub Integration**
|
|
579
|
+
|
|
580
|
+
- **Device Flow**: Secure OAuth without password storage
|
|
581
|
+
- **App Installation**: Automated GitHub App setup
|
|
582
|
+
- **Repository Linking**: Connect repos to SkyReve projects
|
|
583
|
+
|
|
584
|
+
---
|
|
585
|
+
|
|
586
|
+
## **9. Requirements**
|
|
587
|
+
|
|
588
|
+
- **Node.js**: 14.0.0 or higher
|
|
589
|
+
- **Go**: Latest stable version
|
|
590
|
+
- **Supported OS**: macOS, Linux, Windows
|
|
591
|
+
- **Supported Architectures**: x64, arm64
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
## **10. License**
|
|
596
|
+
|
|
597
|
+
MIT
|
|
598
|
+
|
|
599
|
+
---
|
|
600
|
+
|
|
601
|
+
## **11. Support**
|
|
602
|
+
|
|
603
|
+
For issues or questions, please contact us through [GitHub Issues](https://github.com/SkyReve/reve-cli/issues).
|
|
604
|
+
|
|
367
605
|
---
|
|
368
606
|
|
|
369
|
-
### **🛠
|
|
607
|
+
### **🛠 You're now ready to use the SkyReve command line tool: `reve`! 🚀**
|
|
370
608
|
|
|
371
|
-
|
|
609
|
+
For more detailed information or help, please refer to [GitHub Issues](https://github.com/SkyReve/reve-cli/issues).
|
package/README.npm.md
CHANGED
|
@@ -1,70 +1,123 @@
|
|
|
1
1
|
# Reve
|
|
2
2
|
|
|
3
|
-
Reve
|
|
3
|
+
Reve is a command line tool for the SkyReve platform that connects your GitHub repositories with SkyReve projects and environments.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Install via npm (Recommended)
|
|
8
|
+
|
|
9
|
+
To use Reve in your npm project:
|
|
8
10
|
|
|
9
|
-
다른 npm 프로젝트에서 Reve를 사용하려면:
|
|
10
11
|
```bash
|
|
11
12
|
npm install @skyreve/reve
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
After installation, you can run it using `npx reve`:
|
|
16
|
+
|
|
15
17
|
```bash
|
|
16
18
|
npx reve --help
|
|
17
|
-
npx reve
|
|
18
|
-
npx reve init
|
|
19
|
+
npx reve start
|
|
19
20
|
```
|
|
20
21
|
|
|
21
|
-
###
|
|
22
|
+
### Global Installation
|
|
23
|
+
|
|
24
|
+
To install globally:
|
|
22
25
|
|
|
23
|
-
전역적으로 설치하려면:
|
|
24
26
|
```bash
|
|
25
27
|
npm install -g @skyreve/reve
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
After installation, you can run it directly with the `reve` command:
|
|
31
|
+
|
|
29
32
|
```bash
|
|
30
33
|
reve --help
|
|
31
|
-
reve
|
|
32
|
-
|
|
34
|
+
reve start
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
The easiest way to get started with Reve is using the **Quick Start** command:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
reve start
|
|
33
43
|
```
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
This command will guide you through a complete 6-step setup process:
|
|
46
|
+
|
|
47
|
+
1. **🔐 Step 1/6**: Login to SkyReve platform
|
|
48
|
+
2. **📁 Step 2/6**: Select/create a project
|
|
49
|
+
3. **🐙 Step 3/6**: Login to GitHub
|
|
50
|
+
4. **🔧 Step 4/6**: Install GitHub App
|
|
51
|
+
5. **📦 Step 5/6**: Link GitHub branch to Reve environment
|
|
52
|
+
6. **🚀 Step 6/6**: Start syncing Reve environment
|
|
53
|
+
|
|
54
|
+
After completion, you'll see: `🎉 All setup steps completed successfully!`
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
36
57
|
|
|
37
|
-
###
|
|
58
|
+
### Main Commands
|
|
38
59
|
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
| `reve
|
|
42
|
-
| `reve
|
|
43
|
-
| `reve
|
|
44
|
-
| `reve
|
|
45
|
-
| `reve
|
|
46
|
-
| `reve
|
|
47
|
-
| `reve
|
|
48
|
-
| `reve
|
|
60
|
+
| Command | Description |
|
|
61
|
+
| --------------------- | ---------------------------------------------- |
|
|
62
|
+
| `reve start` | **Quick Start**: Complete 6-step setup process |
|
|
63
|
+
| `reve login [email]` | Login to SkyReve platform |
|
|
64
|
+
| `reve project` | Select/create SkyReve project |
|
|
65
|
+
| `reve env` | Start interactive environment management |
|
|
66
|
+
| `reve env list` | List all Reve environments |
|
|
67
|
+
| `reve env link <env>` | Link GitHub branch to Reve environment |
|
|
68
|
+
| `reve env sync` | Sync current branch with Reve environment |
|
|
69
|
+
| `reve env deploy` | Deploy current branch to Reve environment |
|
|
70
|
+
| `reve github login` | Login to GitHub using Device Flow |
|
|
71
|
+
| `reve github install` | Install GitHub App for current repository |
|
|
49
72
|
|
|
50
|
-
###
|
|
73
|
+
### Getting Help
|
|
51
74
|
|
|
52
75
|
```bash
|
|
53
76
|
reve --help
|
|
54
|
-
#
|
|
77
|
+
# or
|
|
55
78
|
npx reve --help
|
|
56
79
|
```
|
|
57
80
|
|
|
58
|
-
|
|
81
|
+
### Daily Usage Examples
|
|
59
82
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
```bash
|
|
84
|
+
# Check environment list
|
|
85
|
+
reve env list
|
|
86
|
+
|
|
87
|
+
# Link branch to specific environment
|
|
88
|
+
reve env link main
|
|
89
|
+
|
|
90
|
+
# Sync current branch
|
|
91
|
+
reve env sync
|
|
92
|
+
|
|
93
|
+
# Deploy current branch
|
|
94
|
+
reve env deploy
|
|
95
|
+
|
|
96
|
+
# Force deploy (even with conflicts)
|
|
97
|
+
reve env deploy --force
|
|
98
|
+
```
|
|
63
99
|
|
|
64
|
-
##
|
|
100
|
+
## Requirements
|
|
101
|
+
|
|
102
|
+
- Node.js 14.0.0 or higher
|
|
103
|
+
- Supported OS: macOS, Linux, Windows
|
|
104
|
+
- Supported Architectures: x64, arm64
|
|
105
|
+
|
|
106
|
+
## License
|
|
65
107
|
|
|
66
108
|
MIT
|
|
67
109
|
|
|
68
|
-
##
|
|
110
|
+
## Support
|
|
111
|
+
|
|
112
|
+
If you encounter any issues or have questions, please report them through [GitHub Issues](https://github.com/skyreve/reve-cli/issues).
|
|
113
|
+
|
|
114
|
+
## What is SkyReve?
|
|
115
|
+
|
|
116
|
+
SkyReve is a platform that allows you to manage projects and environments by linking them with GitHub repositories and branches. Reve CLI makes it easy to:
|
|
117
|
+
|
|
118
|
+
- Connect your GitHub repositories to SkyReve projects
|
|
119
|
+
- Manage different environments (development, staging, production)
|
|
120
|
+
- Deploy your code to various environments
|
|
121
|
+
- Sync your local development with cloud environments
|
|
69
122
|
|
|
70
|
-
|
|
123
|
+
Get started today with `reve start`! 🚀
|
package/bin/darwin/reve
CHANGED
|
Binary file
|
package/bin/linux/reve
CHANGED
|
Binary file
|
package/bin/reve
CHANGED
|
Binary file
|
package/bin/windows/reve.exe
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/scripts/reve.js
CHANGED
|
@@ -9,21 +9,21 @@ const os = require('os');
|
|
|
9
9
|
const getBinaryPath = () => {
|
|
10
10
|
const platform = os.platform();
|
|
11
11
|
const arch = os.arch();
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
// 플랫폼별 디렉토리 매핑
|
|
14
14
|
const platformMap = {
|
|
15
15
|
'darwin': 'darwin',
|
|
16
|
-
'linux': 'linux',
|
|
16
|
+
'linux': 'linux',
|
|
17
17
|
'win32': 'windows'
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
const platformDir = platformMap[platform] || 'linux';
|
|
21
|
-
const binDir = path.join(__dirname, '..', 'bin',
|
|
22
|
-
|
|
21
|
+
const binDir = path.join(__dirname, '..', 'bin', platformDir);
|
|
22
|
+
|
|
23
23
|
// Windows의 경우 .exe 확장자 추가
|
|
24
24
|
const binaryName = platform === 'win32' ? 'reve.exe' : 'reve';
|
|
25
25
|
const binaryPath = path.join(binDir, binaryName);
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
return binaryPath;
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -42,14 +42,14 @@ const runBinary = (binaryPath, args) => {
|
|
|
42
42
|
stdio: 'inherit',
|
|
43
43
|
cwd: process.cwd()
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
const child = spawn(binaryPath, args, options);
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
child.on('error', (error) => {
|
|
49
49
|
console.error(`❌ Reve binary execution error: ${error.message}`);
|
|
50
50
|
process.exit(1);
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
child.on('exit', (code) => {
|
|
54
54
|
process.exit(code);
|
|
55
55
|
});
|
|
@@ -58,17 +58,17 @@ const runBinary = (binaryPath, args) => {
|
|
|
58
58
|
// 메인 실행 함수
|
|
59
59
|
const main = () => {
|
|
60
60
|
const binaryPath = getBinaryPath();
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
// 바이너리 존재 확인
|
|
63
63
|
if (!checkBinaryExists(binaryPath)) {
|
|
64
64
|
console.error(`❌ Reve binary not found: ${binaryPath}`);
|
|
65
65
|
console.error('Please run build first: npm run build');
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
// 명령행 인수 전달 (node와 스크립트 이름 제외)
|
|
70
70
|
const args = process.argv.slice(2);
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
// 바이너리 실행
|
|
73
73
|
runBinary(binaryPath, args);
|
|
74
74
|
};
|