@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 CHANGED
@@ -1,44 +1,46 @@
1
1
  # Reve - SkyReve Platform Command Line Tool
2
2
 
3
- Reve SkyReve 플랫폼과 GitHub 저장소를 연결하여 프로젝트와 환경을 관리하는 커맨드라인 도구입니다.
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
- ## 📋 목차 (Table of Contents)
5
+ ## 📋 Table of Contents
6
6
 
7
- 1. [설치 방법](#1-설치-방법-installation)
8
- 2. [개발 환경 설정](#2-개발-환경-설정-development-setup)
9
- 3. [빌드](#3-빌드-build)
10
- 4. [환경별 바이너리 설명](#4-환경별-바이너리-설명)
11
- 5. [Reve CLI 사용법](#5-reve-cli-사용법-using-reve-cli)
12
- 6. [개발 도구](#6-개발-도구-development-tools)
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. 설치 방법 (Installation)**
18
+ ## **1. Installation**
17
19
 
18
- ### **1.1 npm을 통한 설치 (권장)**
20
+ ### **1.1 Install via npm (Recommended)**
19
21
 
20
- 다른 npm 프로젝트에서 Reve CLI 사용하려면:
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
- 설치 `npx reve` 명령어로 실행할 있습니다:
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
- 설치 `reve` 명령어로 직접 실행할 있습니다:
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. 개발 환경 설정 (Development Setup)**
52
+ ## **2. Development Setup**
51
53
 
52
- ### **2.1 Go 설치**
54
+ ### **2.1 Install Go**
53
55
 
54
- Reve CLI **Go**를 필요로 합니다. Go 설치되지 않았다면 아래 명령어로 설치하세요:
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 공식 웹사이트](https://golang.org/dl/)에서 설치 파일을 다운로드하여 설치하세요.
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. 빌드 (Build)**
90
+ ## **3. Build**
89
91
 
90
- ### **3.1 기본 빌드**
92
+ ### **3.1 Basic Build**
91
93
 
92
- 현재 OS용 바이너리를 빌드하려면:
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
- 빌드가 완료되면 `bin/` 디렉토리에 `reve` 바이너리가 생성됩니다:
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 모든 OS(Linux, macOS, Windows)용 바이너리 빌드**
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
- 모든 OS 대한 바이너리를 빌드하면 아래와 같은 구조로 파일이 생성됩니다:
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
- 빌드된 바이너리는 `bin/` 디렉토리에 저장됩니다. 확인하려면:
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 환경 변수 `REVE_ENV`를 통해 다른 API 서버를 사용합니다.
144
+ Reve CLI uses the `REVE_ENV` environment variable to connect to different API servers.
143
145
 
144
- ### **🔹 개발 환경 (dev)**
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
- ### **🔹 스테이징 환경 (staging)**
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
- - **설명:** 스테이징 환경용입니다. 운영 환경과 유사한 조건에서 최종 QA 검증에 사용됩니다.
168
+ - **Description:** For staging environment. Used for final QA and validation under conditions similar to production.
167
169
 
168
- ### **🔹 운영 환경 (production)**
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 사용법 (Using `reve`)**
184
+ ## **5. Using Reve CLI**
183
185
 
184
- ### **5.1 npm을 통한 실행 (권장)**
186
+ ### **5.1 Running via npm (Recommended)**
185
187
 
186
- npm으로 설치한 경우:
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` | 작업할 SkyReve 프로젝트 선택 |
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
- #### **🔹 환경 관리 명령어 (`reve env`)**
229
+ #### **🔹 Environment Management Commands (`reve env`)**
228
230
 
229
- | 명령어 | 설명 |
230
- | -------------------------- | --------------------------------------------------------- |
231
- | `reve env` | 대화형 환경 관리 시작 (`reve env start`와 동일한 동작) |
232
- | `reve env start` | 대화형 환경 관리 시작 |
233
- | `reve env info` | 프로젝트 정보, Git 저장소 정보, GitHub App 설치 상태 확인 |
234
- | `reve env list` | 모든 Reve 환경과 연결된 GitHub 브랜치 정보 나열 |
235
- | `reve env link <reve_env>` | GitHub 브랜치를 특정 Reve 환경에 연결 |
236
- | `reve env sync` | 현재 저장소 브랜치를 Reve 환경과 동기화 |
237
- | `reve env deploy` | 현재 저장소 브랜치를 Reve 환경에 배포 |
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 관련 명령어 (`reve github`)**
241
+ #### **🔹 GitHub Commands (`reve github`)**
240
242
 
241
- | 명령어 | 설명 |
242
- | --------------------- | -------------------------------------- |
243
- | `reve github login` | GitHub Device Flow를 사용하여 로그인 |
244
- | `reve github install` | 현재 저장소에 GitHub App 설치 |
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. 개발 도구 (Development Tools)**
332
+ ## **6. Development Tools**
304
333
 
305
- ### **6.1 정리 (Clean)**
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
- │ ├── config/ # 설정 관리
357
- │ ├── constants/ # 상수 정의
358
- │ ├── git/ # Git 관련 기능
359
- │ ├── github/ # GitHub API
360
- │ ├── logger/ # 로깅
361
- └── reve/ # Reve API 및 유틸리티
362
- ├── main.go # 메인 진입점
363
- ├── go.mod # Go 모듈 정의
364
- └── README.md # 파일
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
- ### **🛠 이제 SkyReve command line tool: `reve`를 사용할 준비가 완료되었습니다! 🚀**
607
+ ### **🛠 You're now ready to use the SkyReve command line tool: `reve`! 🚀**
370
608
 
371
- 자세한 정보나 도움이 필요하시면 [GitHub Issues](https://github.com/SkyReve/reve-cli/issues)에서 문의해 주세요.
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 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
- ### npm을 통한 설치 (권장)
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
- 설치 `npx reve` 명령어로 실행할 있습니다:
15
+ After installation, you can run it using `npx reve`:
16
+
15
17
  ```bash
16
18
  npx reve --help
17
- npx reve status
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
- 설치 `reve` 명령어로 직접 실행할 있습니다:
30
+ After installation, you can run it directly with the `reve` command:
31
+
29
32
  ```bash
30
33
  reve --help
31
- reve status
32
- reve init
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 init` | SkyReve 프로젝트 초기화 |
42
- | `reve sync` | 원격 데이터와 동기화 |
43
- | `reve status` | 프로젝트 상태 확인 |
44
- | `reve deploy` | 프로젝트 배포 |
45
- | `reve switch` | 프로젝트 브랜치 전환 |
46
- | `reve github-init` | GitHub 연동 초기화 |
47
- | `reve github-link` | GitHub 저장소 연결 |
48
- | `reve github-unlink` | GitHub 저장소 연결 해제 |
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
- - Node.js 14.0.0 이상
61
- - 지원 OS: macOS, Linux, Windows
62
- - 지원 아키텍처: x64, arm64
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
- 문제가 있거나 질문이 있으시면 [GitHub Issues](https://github.com/skyreve/reve-cli/issues)를 통해 문의해주세요.
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
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyreve/reve",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Reve - A command line tool for Reve platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
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', 'release', platformDir);
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
  };