@ludeo/cli 1.0.0 → 1.1.0
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 +163 -60
- package/dist/ludeo +0 -0
- package/dist/ludeo-darwin-amd64 +0 -0
- package/dist/ludeo-darwin-arm64 +0 -0
- package/dist/ludeo-linux-amd64 +0 -0
- package/dist/ludeo-linux-arm64 +0 -0
- package/dist/ludeo-windows-amd64.exe +0 -0
- package/dist/ludeo-windows-arm64.exe +0 -0
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
1
|
# Ludeo CLI
|
|
2
2
|
|
|
3
|
-
A command-line tool for studios to upload game builds and manage content on the Ludeo platform.
|
|
3
|
+
A comprehensive command-line tool for studios to upload game builds and manage content on the Ludeo platform with complete file upload capabilities.
|
|
4
4
|
|
|
5
|
-
## Features
|
|
5
|
+
## 🚀 Features
|
|
6
6
|
|
|
7
7
|
- **Complete Build Uploads**: Upload both build metadata and all build files in one command
|
|
8
8
|
- **Multipart File Uploads**: Automatically handles large files (>100MB) using multipart uploads
|
|
9
|
-
- **Concurrent Uploads**: Uploads multiple files simultaneously for
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
9
|
+
- **Concurrent Uploads**: Uploads multiple files simultaneously with 32 workers for maximum performance
|
|
10
|
+
- **Upload Recovery**: Automatic retry logic with exponential backoff and state persistence
|
|
11
|
+
- **Progress Tracking**: Real-time progress updates during file uploads with worker statistics
|
|
12
|
+
- **Dynamic Service Selection**: Automatically chooses between local and API services
|
|
13
|
+
- **Secure Authentication**: Access token-based authentication with automatic validation
|
|
14
|
+
- **Environment Support**: Staging, production, and development environment support
|
|
15
|
+
- **Session Management**: Automatic token validation and session refresh
|
|
13
16
|
|
|
14
|
-
##
|
|
17
|
+
## 🏗️ Architecture
|
|
18
|
+
|
|
19
|
+
The CLI uses a dynamic service architecture that automatically adapts based on your authentication status:
|
|
20
|
+
|
|
21
|
+
- **Authenticated Mode**: Full API service with complete file uploads via cloud-builds
|
|
22
|
+
- **Local Mode**: Metadata-only service for development and testing
|
|
23
|
+
- **Automatic Fallback**: Seamlessly switches between services as needed
|
|
24
|
+
|
|
25
|
+
## 📦 Installation
|
|
26
|
+
|
|
27
|
+
### Build from Source
|
|
28
|
+
```bash
|
|
29
|
+
git clone <repository>
|
|
30
|
+
cd ludeo-cli
|
|
31
|
+
make build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Install Locally
|
|
35
|
+
```bash
|
|
36
|
+
make install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🚀 Quick Start
|
|
15
40
|
|
|
16
41
|
### Option 1: NPM Installation (Recommended for most users)
|
|
17
42
|
```bash
|
|
@@ -39,13 +64,12 @@ make build
|
|
|
39
64
|
### 3. Upload a Complete Build
|
|
40
65
|
```bash
|
|
41
66
|
./build/ludeo builds upload \
|
|
42
|
-
--game-
|
|
43
|
-
--base-path ./builds \
|
|
67
|
+
--game-id YOUR_GAME_ID \
|
|
44
68
|
--exec-path ./builds/game.exe \
|
|
45
69
|
--local-directory ./builds
|
|
46
70
|
```
|
|
47
71
|
|
|
48
|
-
## Usage
|
|
72
|
+
## 📚 Usage
|
|
49
73
|
|
|
50
74
|
### Authentication Commands
|
|
51
75
|
```bash
|
|
@@ -68,18 +92,18 @@ ludeo auth logout
|
|
|
68
92
|
ludeo builds upload [flags]
|
|
69
93
|
|
|
70
94
|
# List builds for a game version
|
|
71
|
-
ludeo builds list --game-
|
|
95
|
+
ludeo builds list --game-id <id>
|
|
72
96
|
|
|
73
97
|
# Get build details
|
|
74
|
-
ludeo builds get --game-
|
|
98
|
+
ludeo builds get --game-id <id> --build-id <id>
|
|
75
99
|
```
|
|
76
100
|
|
|
77
|
-
|
|
78
|
-
- `--game-
|
|
79
|
-
- `--exec-path`: Path to the executable (
|
|
80
|
-
- `--local-directory`: Local directory containing all build files
|
|
101
|
+
### Upload Required Flags
|
|
102
|
+
- `--game-id`: Game ID (required)
|
|
103
|
+
- `--exec-path`: Path to the executable relative to local directory (required)
|
|
104
|
+
- `--local-directory`: Local directory containing all build files (required)
|
|
81
105
|
|
|
82
|
-
|
|
106
|
+
### Upload Optional Flags
|
|
83
107
|
- `--game-version`: Game version (e.g., 1.2.3)
|
|
84
108
|
- `--sdk-version`: SDK version (e.g., 2.0.0)
|
|
85
109
|
- `--runtime-environment`: Runtime environment (e.g., windows, linux)
|
|
@@ -88,15 +112,15 @@ ludeo builds get --game-version-id <id> --build-id <id>
|
|
|
88
112
|
- `--major-build-id`: Major build ID for minor builds
|
|
89
113
|
- `--request-id`: Request ID for tracking
|
|
90
114
|
|
|
91
|
-
## Authentication Flow
|
|
115
|
+
## 🔐 Authentication Flow
|
|
92
116
|
|
|
93
117
|
The CLI implements a secure authentication flow that validates access tokens before any upload operation:
|
|
94
118
|
|
|
95
119
|
1. **Token Storage**: Access tokens are stored securely in `~/.ludeo/config.json`
|
|
96
120
|
2. **Pre-upload Validation**: Every upload operation automatically validates the token first
|
|
97
|
-
3. **API Endpoint**: Calls `{{baseUrl}}/
|
|
98
|
-
4. **Session Management**:
|
|
99
|
-
5. **Secure Uploads**: All subsequent uploads use the
|
|
121
|
+
3. **API Endpoint**: Calls `{{baseUrl}}/authentication/cli` with Authorization header
|
|
122
|
+
4. **Session Management**: Receives session token from authentication endpoint
|
|
123
|
+
5. **Secure Uploads**: All subsequent uploads use the session token as Bearer token
|
|
100
124
|
|
|
101
125
|
### Security Features
|
|
102
126
|
- **Automatic Validation**: Tokens are validated before every API operation
|
|
@@ -104,34 +128,7 @@ The CLI implements a secure authentication flow that validates access tokens bef
|
|
|
104
128
|
- **Secure Storage**: Tokens are stored in user's home directory with appropriate permissions
|
|
105
129
|
- **No Token Logging**: Only first/last 4 characters of tokens are displayed in logs
|
|
106
130
|
|
|
107
|
-
##
|
|
108
|
-
|
|
109
|
-
### Basic Complete Upload
|
|
110
|
-
```bash
|
|
111
|
-
ludeo builds upload \
|
|
112
|
-
--game-version-id 123 \
|
|
113
|
-
--exec-path ./builds/game.exe \
|
|
114
|
-
--local-directory ./builds
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Upload with Optional Parameters
|
|
118
|
-
```bash
|
|
119
|
-
ludeo builds upload \
|
|
120
|
-
--game-version-id 123 \
|
|
121
|
-
--exec-path ./builds/game.exe \
|
|
122
|
-
--local-directory ./builds \
|
|
123
|
-
--game-version "1.2.3" \
|
|
124
|
-
--sdk-version "2.1.0" \
|
|
125
|
-
--changes-description "Bug fixes and performance improvements" \
|
|
126
|
-
--runtime-environment "windows"
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### List Builds
|
|
130
|
-
```bash
|
|
131
|
-
ludeo builds list --game-version-id 123
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## How It Works
|
|
131
|
+
## 🔧 How It Works
|
|
135
132
|
|
|
136
133
|
### Complete Upload Process
|
|
137
134
|
The CLI performs a complete upload in the following steps:
|
|
@@ -147,6 +144,12 @@ The CLI performs a complete upload in the following steps:
|
|
|
147
144
|
5. **File Registration**: Registers uploaded files with the cloud-builds service
|
|
148
145
|
6. **Completion**: Marks the upload as complete
|
|
149
146
|
|
|
147
|
+
### Dynamic Service Selection
|
|
148
|
+
The CLI automatically chooses the appropriate service based on your authentication status:
|
|
149
|
+
|
|
150
|
+
- **With Access Token**: Uses complete API service with file uploads
|
|
151
|
+
- **Without Token**: Falls back to local service (metadata only)
|
|
152
|
+
|
|
150
153
|
### Base Path Derivation
|
|
151
154
|
The CLI automatically derives the `basePath` from your `--local-directory`:
|
|
152
155
|
|
|
@@ -169,18 +172,20 @@ This matches exactly how the UI works - the system derives the base path from th
|
|
|
169
172
|
|
|
170
173
|
### File Upload Features
|
|
171
174
|
- **Automatic Multipart**: Files over 100MB automatically use multipart uploads
|
|
172
|
-
- **Concurrent Processing**: Up to
|
|
173
|
-
- **
|
|
174
|
-
- **
|
|
175
|
+
- **Concurrent Processing**: Up to 32 files uploaded simultaneously for maximum performance
|
|
176
|
+
- **Upload Recovery**: Automatic retry with exponential backoff and state persistence
|
|
177
|
+
- **Progress Tracking**: Real-time progress updates with worker statistics
|
|
178
|
+
- **Error Handling**: Graceful error handling without stopping other uploads
|
|
175
179
|
- **Cross-Platform**: Handles Windows and Unix path separators
|
|
176
180
|
|
|
177
181
|
### Performance
|
|
178
|
-
- **Concurrent Uploads**:
|
|
182
|
+
- **High-Performance Concurrent Uploads**: 32 workers for maximum throughput
|
|
179
183
|
- **Multipart Optimization**: Large files split into 100MB parts for optimal performance
|
|
180
184
|
- **Connection Reuse**: HTTP connections reused for better performance
|
|
181
|
-
- **Progress Reporting**: Real-time feedback
|
|
185
|
+
- **Progress Reporting**: Real-time feedback with detailed worker statistics
|
|
186
|
+
- **Upload State Persistence**: Recovery from interruptions in `~/.ludeo-upload-state/`
|
|
182
187
|
|
|
183
|
-
## Configuration
|
|
188
|
+
## ⚙️ Configuration
|
|
184
189
|
|
|
185
190
|
The CLI stores configuration in `~/.ludeo/config.json`. You can also use environment variables:
|
|
186
191
|
|
|
@@ -189,16 +194,74 @@ The CLI stores configuration in `~/.ludeo/config.json`. You can also use environ
|
|
|
189
194
|
- `LUDEO_API_BASE_URL`: Sonic-server API base URL
|
|
190
195
|
- `LUDEO_CLOUD_BUILDS_URL`: Cloud-builds API base URL
|
|
191
196
|
|
|
192
|
-
###
|
|
197
|
+
### Environment Support
|
|
198
|
+
|
|
199
|
+
The CLI supports three environments:
|
|
200
|
+
|
|
201
|
+
#### Staging (Default)
|
|
193
202
|
```json
|
|
194
203
|
{
|
|
195
204
|
"environment": "staging",
|
|
196
|
-
"api_base_url": "https://services.stg.use1.ludeo.com/api/v3
|
|
205
|
+
"api_base_url": "https://services.stg.use1.ludeo.com/api/v3",
|
|
197
206
|
"cloud_builds_url": "https://services.stg.use1.ludeo.com/api/v3/cloud-builds"
|
|
198
207
|
}
|
|
199
208
|
```
|
|
200
209
|
|
|
201
|
-
|
|
210
|
+
#### Production
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"environment": "production",
|
|
214
|
+
"api_base_url": "https://services.ludeo.com/api/v3",
|
|
215
|
+
"cloud_builds_url": "https://services.ludeo.com/api/v3/cloud-builds"
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
#### Development (Internal Use Only)
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"environment": "development",
|
|
223
|
+
"api_base_url": "http://localhost:80/api/v3",
|
|
224
|
+
"cloud_builds_url": "http://localhost:80/api/v3/cloud-builds"
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Environment Variables
|
|
229
|
+
You can set the environment using environment variables:
|
|
230
|
+
- `LUDEO_ENVIRONMENT`: Set to "development", "staging", or "production"
|
|
231
|
+
|
|
232
|
+
## 📋 Examples
|
|
233
|
+
|
|
234
|
+
### Basic Complete Upload
|
|
235
|
+
```bash
|
|
236
|
+
ludeo builds upload \
|
|
237
|
+
--game-id 123 \
|
|
238
|
+
--exec-path ./builds/game.exe \
|
|
239
|
+
--local-directory ./builds
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Upload with Optional Parameters
|
|
243
|
+
```bash
|
|
244
|
+
ludeo builds upload \
|
|
245
|
+
--game-id 123 \
|
|
246
|
+
--exec-path ./builds/game.exe \
|
|
247
|
+
--local-directory ./builds \
|
|
248
|
+
--game-version "1.2.3" \
|
|
249
|
+
--sdk-version "2.1.0" \
|
|
250
|
+
--changes-description "Bug fixes and performance improvements" \
|
|
251
|
+
--runtime-environment "windows"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### List Builds
|
|
255
|
+
```bash
|
|
256
|
+
ludeo builds list --game-id 123
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Get Build Details
|
|
260
|
+
```bash
|
|
261
|
+
ludeo builds get --game-id 123 --build-id 456
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## 🛠️ Development
|
|
202
265
|
|
|
203
266
|
### Building
|
|
204
267
|
```bash
|
|
@@ -212,10 +275,19 @@ make test
|
|
|
212
275
|
|
|
213
276
|
### Local Development
|
|
214
277
|
```bash
|
|
278
|
+
# For local development, use environment variables (recommended)
|
|
279
|
+
export LUDEO_ENVIRONMENT=development
|
|
280
|
+
./ludeo auth login --access-token YOUR_TOKEN
|
|
281
|
+
|
|
282
|
+
# Note: --env flag is hidden from users and only available for internal development
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Go Development
|
|
286
|
+
```bash
|
|
215
287
|
go run main.go builds upload --help
|
|
216
288
|
```
|
|
217
289
|
|
|
218
|
-
## Troubleshooting
|
|
290
|
+
## 🚨 Troubleshooting
|
|
219
291
|
|
|
220
292
|
### Common Issues
|
|
221
293
|
|
|
@@ -232,11 +304,17 @@ go run main.go builds upload --help
|
|
|
232
304
|
- Multipart uploads require stable network connections
|
|
233
305
|
- Very large files (>1GB) may take significant time
|
|
234
306
|
- Monitor progress output for upload status
|
|
307
|
+
- Upload state is automatically saved for recovery
|
|
235
308
|
|
|
236
309
|
4. **Path Issues**
|
|
237
310
|
- Use forward slashes (/) in paths for cross-platform compatibility
|
|
238
311
|
- Ensure executable path is relative to base path
|
|
239
312
|
|
|
313
|
+
5. **Service Selection Issues**
|
|
314
|
+
- Check authentication status with `ludeo auth status`
|
|
315
|
+
- Verify access token is properly stored
|
|
316
|
+
- Check environment configuration
|
|
317
|
+
|
|
240
318
|
### Debug Mode
|
|
241
319
|
Enable debug output by setting the log level:
|
|
242
320
|
```bash
|
|
@@ -244,9 +322,34 @@ export LUDEO_LOG_LEVEL=debug
|
|
|
244
322
|
ludeo builds upload [flags]
|
|
245
323
|
```
|
|
246
324
|
|
|
247
|
-
|
|
325
|
+
### Service Mode Debugging
|
|
326
|
+
The CLI provides detailed logging about which service is being used:
|
|
327
|
+
- **API Service**: Full functionality with file uploads and concurrent processing
|
|
328
|
+
- **Local Service**: Metadata only, no file uploads
|
|
329
|
+
|
|
330
|
+
### Concurrent Upload Debugging
|
|
331
|
+
- **Upload State**: Check `~/.ludeo-upload-state/` for recovery files
|
|
332
|
+
- **Worker Statistics**: Monitor progress output for active worker counts
|
|
333
|
+
- **Retry Logic**: Failed uploads automatically retry with exponential backoff
|
|
334
|
+
|
|
335
|
+
## 📖 API Reference
|
|
336
|
+
|
|
337
|
+
### Service Interfaces
|
|
338
|
+
- **`builds.Service`**: Basic build operations (metadata only)
|
|
339
|
+
- **`builds.CompleteUploadService`**: Complete upload operations including files
|
|
340
|
+
|
|
341
|
+
### Key Endpoints
|
|
342
|
+
- **Authentication**: `{{baseUrl}}/authentication/cli`
|
|
343
|
+
- **Builds**: `{{baseUrl}}/sonic-server/builds`
|
|
344
|
+
- **Cloud Builds**: `{{cloudBuildsUrl}}/uploads`
|
|
345
|
+
|
|
346
|
+
## 🤝 Support
|
|
248
347
|
|
|
249
348
|
For issues and questions:
|
|
250
349
|
- Check the troubleshooting section above
|
|
251
350
|
- Review the CLI output for error details
|
|
252
351
|
- Contact the Ludeo platform team
|
|
352
|
+
|
|
353
|
+
## 📄 License
|
|
354
|
+
|
|
355
|
+
This project is proprietary to Ludeo and its partners.
|
package/dist/ludeo
ADDED
|
Binary file
|
package/dist/ludeo-darwin-amd64
CHANGED
|
Binary file
|
package/dist/ludeo-darwin-arm64
CHANGED
|
Binary file
|
package/dist/ludeo-linux-amd64
CHANGED
|
Binary file
|
package/dist/ludeo-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludeo/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Ludeo CLI - Upload game builds and manage content on the Ludeo platform",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ludeo": "
|
|
7
|
+
"ludeo": "bin/ludeo.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "make build-all",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "https://github.com/ludeo/cli.git"
|
|
26
|
+
"url": "git+https://github.com/ludeo/cli.git"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=16.0.0"
|
|
@@ -44,4 +44,3 @@
|
|
|
44
44
|
"arm64"
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
|
-
|