@skyreve/reve 1.0.2 → 1.0.3
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 +313 -135
- package/README.npm.md +86 -33
- package/package.json +1 -1
- package/scripts/reve.js +12 -12
package/README.md
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
# Reve - SkyReve Platform Command Line Tool
|
|
2
2
|
|
|
3
|
-
Reve
|
|
3
|
+
Reve is a command line tool that connects the SkyReve platform with GitHub repositories to manage projects and environments seamlessly.
|
|
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)
|
|
13
14
|
|
|
14
15
|
---
|
|
15
16
|
|
|
16
|
-
## **1.
|
|
17
|
+
## **1. Installation**
|
|
17
18
|
|
|
18
|
-
### **1.1
|
|
19
|
+
### **1.1 Install via npm (Recommended)**
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
To use Reve CLI in other npm projects:
|
|
21
22
|
|
|
22
23
|
```bash
|
|
23
24
|
npm install @skyreve/reve
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
After installation, you can run it using `npx reve`:
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
30
|
npx reve --help
|
|
30
31
|
npx reve start
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
### **1.2
|
|
34
|
+
### **1.2 Global Installation**
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
To install globally:
|
|
36
37
|
|
|
37
38
|
```bash
|
|
38
39
|
npm install -g @skyreve/reve
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
After installation, you can run it directly with the `reve` command:
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
reve --help
|
|
@@ -47,11 +48,11 @@ reve start
|
|
|
47
48
|
|
|
48
49
|
---
|
|
49
50
|
|
|
50
|
-
## **2.
|
|
51
|
+
## **2. Development Setup**
|
|
51
52
|
|
|
52
|
-
### **2.1 Go
|
|
53
|
+
### **2.1 Install Go**
|
|
53
54
|
|
|
54
|
-
Reve CLI
|
|
55
|
+
Reve CLI requires **Go**. If Go is not installed, install it using the following commands:
|
|
55
56
|
|
|
56
57
|
**macOS:**
|
|
57
58
|
|
|
@@ -71,11 +72,11 @@ sudo yum install golang
|
|
|
71
72
|
```
|
|
72
73
|
|
|
73
74
|
**Windows:**
|
|
74
|
-
[Go
|
|
75
|
+
Download and install from the [official Go website](https://golang.org/dl/).
|
|
75
76
|
|
|
76
|
-
### **2.2
|
|
77
|
+
### **2.2 Initialize Project**
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
Clone the project and install dependencies:
|
|
79
80
|
|
|
80
81
|
```bash
|
|
81
82
|
git clone git@github.com:SkyReve/reve-cli.git
|
|
@@ -85,38 +86,38 @@ go mod tidy
|
|
|
85
86
|
|
|
86
87
|
---
|
|
87
88
|
|
|
88
|
-
## **3.
|
|
89
|
+
## **3. Build**
|
|
89
90
|
|
|
90
|
-
### **3.1
|
|
91
|
+
### **3.1 Basic Build**
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
To build a binary for the current OS:
|
|
93
94
|
|
|
94
95
|
```bash
|
|
95
96
|
make
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
or:
|
|
99
100
|
|
|
100
101
|
```bash
|
|
101
102
|
make build
|
|
102
103
|
```
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
After building, the `reve` binary will be created in the `bin/` directory:
|
|
105
106
|
|
|
106
107
|
```bash
|
|
107
108
|
bin/
|
|
108
109
|
└── reve
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
### **3.2
|
|
112
|
+
### **3.2 Build for All Operating Systems**
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
To build binaries for all platforms (Linux, macOS, Windows):
|
|
114
115
|
|
|
115
116
|
```bash
|
|
116
117
|
make build-all
|
|
117
118
|
```
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
Building for all OS will create files in the following structure:
|
|
120
121
|
|
|
121
122
|
```bash
|
|
122
123
|
bin/
|
|
@@ -125,204 +126,207 @@ bin/
|
|
|
125
126
|
└── windows/reve.exe
|
|
126
127
|
```
|
|
127
128
|
|
|
128
|
-
### **3.3
|
|
129
|
+
### **3.3 Verify Built Binaries**
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
Built binaries are stored in the `bin/` directory. To check:
|
|
131
132
|
|
|
132
133
|
```bash
|
|
133
134
|
ls -la bin/
|
|
134
|
-
#
|
|
135
|
+
# or
|
|
135
136
|
tree bin/
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
---
|
|
139
140
|
|
|
140
|
-
## **4.
|
|
141
|
+
## **4. Environment Configuration**
|
|
141
142
|
|
|
142
|
-
Reve CLI
|
|
143
|
+
Reve CLI uses the `REVE_ENV` environment variable to connect to different API servers.
|
|
143
144
|
|
|
144
|
-
### **🔹
|
|
145
|
+
### **🔹 Development Environment (dev)**
|
|
145
146
|
|
|
146
147
|
```bash
|
|
147
148
|
make run-dev
|
|
148
|
-
#
|
|
149
|
+
# or
|
|
149
150
|
REVE_ENV=dev ./bin/reve
|
|
150
151
|
```
|
|
151
152
|
|
|
152
153
|
- **BaseURL:** `http://localhost:8000`
|
|
153
154
|
- **GitHub App:** [https://github.com/apps/skyreve-staging](https://github.com/apps/skyreve-staging)
|
|
154
|
-
-
|
|
155
|
+
- **Description:** For development environment. Used for testing new features and debugging.
|
|
155
156
|
|
|
156
|
-
### **🔹
|
|
157
|
+
### **🔹 Staging Environment (staging)**
|
|
157
158
|
|
|
158
159
|
```bash
|
|
159
160
|
make run-staging
|
|
160
|
-
#
|
|
161
|
+
# or
|
|
161
162
|
REVE_ENV=staging ./bin/reve
|
|
162
163
|
```
|
|
163
164
|
|
|
164
165
|
- **BaseURL:** `https://api.hellreve.world`
|
|
165
166
|
- **GitHub App:** [https://github.com/apps/skyreve-staging](https://github.com/apps/skyreve-staging)
|
|
166
|
-
-
|
|
167
|
+
- **Description:** For staging environment. Used for final QA and validation under conditions similar to production.
|
|
167
168
|
|
|
168
|
-
### **🔹
|
|
169
|
+
### **🔹 Production Environment (production)**
|
|
169
170
|
|
|
170
171
|
```bash
|
|
171
172
|
make run-production
|
|
172
|
-
#
|
|
173
|
+
# or
|
|
173
174
|
./bin/reve
|
|
174
175
|
```
|
|
175
176
|
|
|
176
177
|
- **BaseURL:** `https://api.skyreve.cloud`
|
|
177
178
|
- **GitHub App:** [https://github.com/apps/skyreve](https://github.com/apps/skyreve)
|
|
178
|
-
-
|
|
179
|
+
- **Description:** For production environment. Used in the actual service environment provided to real users.
|
|
179
180
|
|
|
180
181
|
---
|
|
181
182
|
|
|
182
|
-
## **5. Reve CLI
|
|
183
|
+
## **5. Using Reve CLI**
|
|
183
184
|
|
|
184
|
-
### **5.1
|
|
185
|
+
### **5.1 Running via npm (Recommended)**
|
|
185
186
|
|
|
186
|
-
|
|
187
|
+
When installed via npm:
|
|
187
188
|
|
|
188
189
|
```bash
|
|
189
190
|
npx reve [COMMAND] [OPTIONS]
|
|
190
|
-
#
|
|
191
|
+
# or if installed globally
|
|
191
192
|
reve [COMMAND] [OPTIONS]
|
|
192
193
|
```
|
|
193
194
|
|
|
194
|
-
### **5.2
|
|
195
|
+
### **5.2 Running Binary Directly**
|
|
195
196
|
|
|
196
|
-
|
|
197
|
+
When running the built binary directly:
|
|
197
198
|
|
|
198
199
|
```bash
|
|
199
|
-
#
|
|
200
|
+
# Development environment
|
|
200
201
|
REVE_ENV=dev ./bin/reve [COMMAND] [OPTIONS]
|
|
201
202
|
|
|
202
|
-
#
|
|
203
|
+
# Staging environment
|
|
203
204
|
REVE_ENV=staging ./bin/reve [COMMAND] [OPTIONS]
|
|
204
205
|
|
|
205
|
-
#
|
|
206
|
+
# Production environment (default)
|
|
206
207
|
./bin/reve [COMMAND] [OPTIONS]
|
|
207
208
|
```
|
|
208
209
|
|
|
209
|
-
### **5.3
|
|
210
|
+
### **5.3 Getting Help**
|
|
210
211
|
|
|
211
212
|
```bash
|
|
212
213
|
reve --help
|
|
213
|
-
#
|
|
214
|
+
# or
|
|
214
215
|
npx reve --help
|
|
215
216
|
```
|
|
216
217
|
|
|
217
|
-
### **5.4
|
|
218
|
+
### **5.4 Main Commands**
|
|
218
219
|
|
|
219
|
-
#### **🔹
|
|
220
|
+
#### **🔹 Basic Commands**
|
|
220
221
|
|
|
221
|
-
|
|
|
222
|
-
| -------------------- |
|
|
223
|
-
| `reve start` |
|
|
224
|
-
| `reve login [email]` | SkyReve
|
|
225
|
-
| `reve project` |
|
|
222
|
+
| Command | Description |
|
|
223
|
+
| -------------------- | ------------------------------------------------------------------------------- |
|
|
224
|
+
| `reve start` | **Quick Start**: Complete 6-step setup process and start environment management |
|
|
225
|
+
| `reve login [email]` | Login to SkyReve platform |
|
|
226
|
+
| `reve project` | Select/create SkyReve project to work with |
|
|
226
227
|
|
|
227
|
-
#### **🔹
|
|
228
|
+
#### **🔹 Environment Management Commands (`reve env`)**
|
|
228
229
|
|
|
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` |
|
|
230
|
+
| Command | Description |
|
|
231
|
+
| -------------------------- | --------------------------------------------------------------------------- |
|
|
232
|
+
| `reve env` | Start interactive environment management (same as `reve env start`) |
|
|
233
|
+
| `reve env start` | Start interactive environment management |
|
|
234
|
+
| `reve env info` | Check project info, Git repository info, and GitHub App installation status |
|
|
235
|
+
| `reve env list` | List all Reve environments with linked GitHub branch information |
|
|
236
|
+
| `reve env link <reve_env>` | Link GitHub branch to specific Reve environment |
|
|
237
|
+
| `reve env sync` | Sync current repository branch with Reve environment |
|
|
238
|
+
| `reve env deploy` | Deploy current repository branch to Reve environment |
|
|
238
239
|
|
|
239
|
-
#### **🔹 GitHub
|
|
240
|
+
#### **🔹 GitHub Commands (`reve github`)**
|
|
240
241
|
|
|
241
|
-
|
|
|
242
|
-
| --------------------- |
|
|
243
|
-
| `reve github login` | GitHub
|
|
244
|
-
| `reve github install` |
|
|
242
|
+
| Command | Description |
|
|
243
|
+
| --------------------- | ----------------------------------------- |
|
|
244
|
+
| `reve github login` | Login to GitHub using Device Flow |
|
|
245
|
+
| `reve github install` | Install GitHub App for current repository |
|
|
245
246
|
|
|
246
|
-
### **5.5
|
|
247
|
+
### **5.5 Usage Examples**
|
|
247
248
|
|
|
248
|
-
####
|
|
249
|
+
#### **First-time Setup (Recommended)**
|
|
249
250
|
|
|
250
251
|
```bash
|
|
251
|
-
# 1.
|
|
252
|
+
# 1. Complete 6-step setup process (Quick Start)
|
|
252
253
|
reve start
|
|
253
254
|
```
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
This **Quick Start** command automatically performs the following 6 steps:
|
|
256
257
|
|
|
257
|
-
1. SkyReve
|
|
258
|
-
2.
|
|
259
|
-
3. GitHub
|
|
260
|
-
4. GitHub App
|
|
261
|
-
5.
|
|
258
|
+
1. **🔐 Step 1/6**: Login to SkyReve platform
|
|
259
|
+
2. **📁 Step 2/6**: Select/create a project
|
|
260
|
+
3. **🐙 Step 3/6**: Login to GitHub
|
|
261
|
+
4. **🔧 Step 4/6**: Install GitHub App
|
|
262
|
+
5. **📦 Step 5/6**: Link GitHub branch to Reve environment
|
|
263
|
+
6. **🚀 Step 6/6**: Start syncing Reve environment
|
|
262
264
|
|
|
263
|
-
|
|
265
|
+
After completion, you'll see: `🎉 All setup steps completed successfully!`
|
|
266
|
+
|
|
267
|
+
#### **Individual Setup**
|
|
264
268
|
|
|
265
269
|
```bash
|
|
266
|
-
# 1. SkyReve
|
|
270
|
+
# 1. Login to SkyReve platform
|
|
267
271
|
reve login your-email@example.com
|
|
268
272
|
|
|
269
|
-
# 2.
|
|
273
|
+
# 2. Select project
|
|
270
274
|
reve project
|
|
271
275
|
|
|
272
|
-
# 3. GitHub
|
|
276
|
+
# 3. Login to GitHub
|
|
273
277
|
reve github login
|
|
274
278
|
|
|
275
|
-
# 4. GitHub App
|
|
279
|
+
# 4. Install GitHub App
|
|
276
280
|
reve github install
|
|
277
281
|
|
|
278
|
-
# 5.
|
|
282
|
+
# 5. Start environment management
|
|
279
283
|
reve env start
|
|
280
284
|
```
|
|
281
285
|
|
|
282
|
-
####
|
|
286
|
+
#### **Daily Usage**
|
|
283
287
|
|
|
284
288
|
```bash
|
|
285
|
-
#
|
|
289
|
+
# Check environment list
|
|
286
290
|
reve env list
|
|
287
291
|
|
|
288
|
-
#
|
|
292
|
+
# Link branch to specific environment
|
|
289
293
|
reve env link main
|
|
290
294
|
|
|
291
|
-
#
|
|
295
|
+
# Sync current branch
|
|
292
296
|
reve env sync
|
|
293
297
|
|
|
294
|
-
#
|
|
298
|
+
# Deploy current branch
|
|
295
299
|
reve env deploy
|
|
296
300
|
|
|
297
|
-
#
|
|
301
|
+
# Force deploy (even with conflicts)
|
|
298
302
|
reve env deploy --force
|
|
299
303
|
```
|
|
300
304
|
|
|
301
305
|
---
|
|
302
306
|
|
|
303
|
-
## **6.
|
|
307
|
+
## **6. Development Tools**
|
|
304
308
|
|
|
305
|
-
### **6.1
|
|
309
|
+
### **6.1 Clean**
|
|
306
310
|
|
|
307
|
-
|
|
311
|
+
To clean up unnecessary build files:
|
|
308
312
|
|
|
309
313
|
```bash
|
|
310
314
|
make clean
|
|
311
315
|
```
|
|
312
316
|
|
|
313
|
-
### **6.2
|
|
317
|
+
### **6.2 Test and Lint**
|
|
314
318
|
|
|
315
319
|
```bash
|
|
316
|
-
#
|
|
320
|
+
# Run tests
|
|
317
321
|
make test
|
|
318
322
|
|
|
319
|
-
#
|
|
323
|
+
# Run linter
|
|
320
324
|
make lint
|
|
321
325
|
```
|
|
322
326
|
|
|
323
|
-
### **6.3
|
|
327
|
+
### **6.3 Development Mode**
|
|
324
328
|
|
|
325
|
-
|
|
329
|
+
For quick testing during development:
|
|
326
330
|
|
|
327
331
|
```bash
|
|
328
332
|
make run
|
|
@@ -330,42 +334,216 @@ make run
|
|
|
330
334
|
|
|
331
335
|
---
|
|
332
336
|
|
|
333
|
-
## **7.
|
|
337
|
+
## **7. Publishing to npm**
|
|
338
|
+
|
|
339
|
+
### **7.1 Prerequisites**
|
|
340
|
+
|
|
341
|
+
Before publishing to npm, ensure you have:
|
|
342
|
+
|
|
343
|
+
1. **npm account**: Create an account at [npmjs.com](https://www.npmjs.com/)
|
|
344
|
+
2. **npm CLI**: Install npm CLI globally if not already installed
|
|
345
|
+
3. **Authentication**: Login to npm using `npm login`
|
|
346
|
+
|
|
347
|
+
### **7.2 Build Process**
|
|
348
|
+
|
|
349
|
+
Before publishing, you need to build the binaries for all platforms:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
# Build binaries for all platforms
|
|
353
|
+
npm run build
|
|
354
|
+
# or
|
|
355
|
+
make build-all
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
This creates binaries in the following structure:
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
bin/
|
|
362
|
+
├── linux/reve
|
|
363
|
+
├── darwin/reve
|
|
364
|
+
└── windows/reve.exe
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### **7.3 Version Management**
|
|
368
|
+
|
|
369
|
+
Update the version in `package.json` before publishing:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
# Patch version (1.0.0 -> 1.0.1)
|
|
373
|
+
npm version patch
|
|
374
|
+
|
|
375
|
+
# Minor version (1.0.0 -> 1.1.0)
|
|
376
|
+
npm version minor
|
|
377
|
+
|
|
378
|
+
# Major version (1.0.0 -> 2.0.0)
|
|
379
|
+
npm version major
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### **7.4 Publishing Steps**
|
|
383
|
+
|
|
384
|
+
1. **Login to npm**:
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
npm login
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
2. **Build binaries**:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
npm run build
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
3. **Publish to npm**:
|
|
397
|
+
```bash
|
|
398
|
+
npm publish
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### **7.5 Publishing to Different Registries**
|
|
402
|
+
|
|
403
|
+
#### **Publishing to npm (Public)**
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
npm publish
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### **Publishing to npm (Private)**
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
npm publish --access private
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
#### **Publishing to Custom Registry**
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
npm publish --registry https://your-registry.com
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### **7.6 Verification**
|
|
422
|
+
|
|
423
|
+
After publishing, verify the package:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Check package info
|
|
427
|
+
npm info @skyreve/reve
|
|
428
|
+
|
|
429
|
+
# Test installation
|
|
430
|
+
npm install @skyreve/reve
|
|
431
|
+
npx reve --help
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### **7.7 Automated Publishing**
|
|
435
|
+
|
|
436
|
+
For automated publishing, you can use GitHub Actions or similar CI/CD tools:
|
|
437
|
+
|
|
438
|
+
```yaml
|
|
439
|
+
# .github/workflows/publish.yml
|
|
440
|
+
name: Publish to npm
|
|
441
|
+
|
|
442
|
+
on:
|
|
443
|
+
release:
|
|
444
|
+
types: [published]
|
|
445
|
+
|
|
446
|
+
jobs:
|
|
447
|
+
publish:
|
|
448
|
+
runs-on: ubuntu-latest
|
|
449
|
+
steps:
|
|
450
|
+
- uses: actions/checkout@v2
|
|
451
|
+
- uses: actions/setup-node@v2
|
|
452
|
+
with:
|
|
453
|
+
node-version: "16"
|
|
454
|
+
registry-url: "https://registry.npmjs.org"
|
|
455
|
+
- run: npm ci
|
|
456
|
+
- run: npm run build
|
|
457
|
+
- run: npm publish
|
|
458
|
+
env:
|
|
459
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### **7.8 Troubleshooting**
|
|
463
|
+
|
|
464
|
+
#### **Common Issues:**
|
|
465
|
+
|
|
466
|
+
1. **"Package already exists"**: Update version number
|
|
467
|
+
2. **"Authentication failed"**: Run `npm login` again
|
|
468
|
+
3. **"Binary not found"**: Ensure `npm run build` completed successfully
|
|
469
|
+
4. **"Permission denied"**: Check npm permissions for the package
|
|
470
|
+
|
|
471
|
+
#### **Useful Commands:**
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Check who you're logged in as
|
|
475
|
+
npm whoami
|
|
476
|
+
|
|
477
|
+
# Check package permissions
|
|
478
|
+
npm access ls-packages
|
|
479
|
+
|
|
480
|
+
# Unpublish (only within 24 hours)
|
|
481
|
+
npm unpublish @skyreve/reve@version
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## **8. Project Structure**
|
|
334
487
|
|
|
335
488
|
```
|
|
336
489
|
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
|
-
│ ├── config/ #
|
|
357
|
-
│ ├── constants/ #
|
|
358
|
-
│ ├── git/ # Git
|
|
490
|
+
├── cmd/ # Command definitions
|
|
491
|
+
│ ├── root.go # Root command
|
|
492
|
+
│ ├── start.go # Complete setup start command
|
|
493
|
+
│ ├── login.go # Login command
|
|
494
|
+
│ ├── project.go # Project selection command
|
|
495
|
+
│ ├── env.go # Environment management command
|
|
496
|
+
│ ├── github.go # GitHub related commands
|
|
497
|
+
│ ├── env/ # Environment management sub-commands
|
|
498
|
+
│ │ ├── start.go # Environment management start
|
|
499
|
+
│ │ ├── info.go # Project info check
|
|
500
|
+
│ │ ├── list.go # Environment list
|
|
501
|
+
│ │ ├── link.go # Branch linking
|
|
502
|
+
│ │ ├── sync.go # Synchronization
|
|
503
|
+
│ │ ├── deploy.go # Deployment
|
|
504
|
+
│ │ └── common.go # Common functions
|
|
505
|
+
│ └── github/ # GitHub sub-commands
|
|
506
|
+
│ ├── login.go # GitHub login
|
|
507
|
+
│ └── install.go # GitHub App installation
|
|
508
|
+
├── internal/ # Internal packages
|
|
509
|
+
│ ├── config/ # Configuration management
|
|
510
|
+
│ ├── constants/ # Constant definitions
|
|
511
|
+
│ ├── git/ # Git related functionality
|
|
359
512
|
│ ├── github/ # GitHub API
|
|
360
|
-
│ ├── logger/ #
|
|
361
|
-
│ └── reve/ # Reve API
|
|
362
|
-
├──
|
|
363
|
-
|
|
364
|
-
|
|
513
|
+
│ ├── logger/ # Logging
|
|
514
|
+
│ └── reve/ # Reve API and utilities
|
|
515
|
+
├── scripts/ # Node.js wrapper scripts
|
|
516
|
+
│ └── reve.js # Main wrapper script
|
|
517
|
+
├── bin/ # Built binaries
|
|
518
|
+
├── main.go # Main entry point
|
|
519
|
+
├── package.json # npm package configuration
|
|
520
|
+
├── go.mod # Go module definition
|
|
521
|
+
└── README.md # This file
|
|
365
522
|
```
|
|
366
523
|
|
|
367
524
|
---
|
|
368
525
|
|
|
369
|
-
|
|
526
|
+
## **9. Requirements**
|
|
527
|
+
|
|
528
|
+
- **Node.js**: 14.0.0 or higher
|
|
529
|
+
- **Go**: Latest stable version
|
|
530
|
+
- **Supported OS**: macOS, Linux, Windows
|
|
531
|
+
- **Supported Architectures**: x64, arm64
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## **10. License**
|
|
536
|
+
|
|
537
|
+
MIT
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## **11. Support**
|
|
542
|
+
|
|
543
|
+
For issues or questions, please contact us through [GitHub Issues](https://github.com/SkyReve/reve-cli/issues).
|
|
544
|
+
|
|
545
|
+
---
|
|
546
|
+
|
|
547
|
+
### **🛠 You're now ready to use the SkyReve command line tool: `reve`! 🚀**
|
|
370
548
|
|
|
371
|
-
|
|
549
|
+
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/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
|
};
|