@ludeo/cli 1.1.0 → 1.1.2

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,355 +1,125 @@
1
1
  # Ludeo CLI
2
2
 
3
- A comprehensive command-line tool for studios to upload game builds and manage content on the Ludeo platform with complete file upload capabilities.
3
+ The official Ludeo CLI tool for uploading game builds to the Ludeo platform. Install via npm for easy setup and automatic updates.
4
4
 
5
- ## 🚀 Features
5
+ ## Installation
6
6
 
7
- - **Complete Build Uploads**: Upload both build metadata and all build files in one command
8
- - **Multipart File Uploads**: Automatically handles large files (>100MB) using multipart uploads
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
16
-
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
7
  ```bash
29
- git clone <repository>
30
- cd ludeo-cli
31
- make build
32
- ```
33
-
34
- ### Install Locally
35
- ```bash
36
- make install
8
+ npm install -g @ludeo/cli
37
9
  ```
38
10
 
39
- ## 🚀 Quick Start
40
-
41
- ### Option 1: NPM Installation (Recommended for most users)
11
+ Verify the installation:
42
12
  ```bash
43
- # Install globally
44
- npm install -g @ludeo/cli
45
-
46
- # Verify installation
47
13
  ludeo --version
48
-
49
- # Authenticate
50
- ludeo auth login --access-token YOUR_ACCESS_TOKEN
51
14
  ```
52
15
 
53
- ### Option 2: Build from Source
54
- #### 1. Build the CLI
55
- ```bash
56
- make build
57
- ```
16
+ ## Quick Start
58
17
 
59
- #### 2. Authenticate
18
+ ### 1. Authentication
19
+ Get your access token from the Ludeo platform and authenticate:
60
20
  ```bash
61
- ./build/ludeo auth login --access-token YOUR_ACCESS_TOKEN
21
+ ludeo auth login --access-token YOUR_ACCESS_TOKEN
62
22
  ```
63
23
 
64
- ### 3. Upload a Complete Build
24
+ ### 2. Upload Your Build
25
+ Upload your game build with a simple command:
65
26
  ```bash
66
- ./build/ludeo builds upload \
27
+ ludeo builds upload \
67
28
  --game-id YOUR_GAME_ID \
68
29
  --exec-path ./builds/game.exe \
69
30
  --local-directory ./builds
70
31
  ```
71
32
 
72
- ## 📚 Usage
73
-
74
- ### Authentication Commands
33
+ ### 3. Optional Parameters
34
+ Add version information and descriptions:
75
35
  ```bash
76
- # Login with access token
77
- ludeo auth login --access-token <token>
78
-
79
- # Check authentication status
80
- ludeo auth status
81
-
82
- # Validate current access token
83
- ludeo auth validate
84
-
85
- # Logout and clear credentials
86
- ludeo auth logout
36
+ ludeo builds upload \
37
+ --game-id YOUR_GAME_ID \
38
+ --exec-path ./builds/game.exe \
39
+ --local-directory ./builds \
40
+ --game-version "1.2.3" \
41
+ --changes-description "Bug fixes and performance improvements"
87
42
  ```
88
43
 
89
- ### Builds Commands
44
+ ### 4. Manage Builds
90
45
  ```bash
91
- # Upload a complete build (metadata + files)
92
- ludeo builds upload [flags]
93
-
94
- # List builds for a game version
95
- ludeo builds list --game-id <id>
46
+ # List your builds
47
+ ludeo builds list --game-id YOUR_GAME_ID
96
48
 
97
49
  # Get build details
98
- ludeo builds get --game-id <id> --build-id <id>
50
+ ludeo builds get --game-id YOUR_GAME_ID --build-id BUILD_ID
99
51
  ```
100
52
 
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)
105
-
106
- ### Upload Optional Flags
107
- - `--game-version`: Game version (e.g., 1.2.3)
108
- - `--sdk-version`: SDK version (e.g., 2.0.0)
109
- - `--runtime-environment`: Runtime environment (e.g., windows, linux)
110
- - `--changes-description`: Description of changes in this build
111
- - `--base-build-id`: Base build ID for modification builds
112
- - `--major-build-id`: Major build ID for minor builds
113
- - `--request-id`: Request ID for tracking
114
-
115
- ## 🔐 Authentication Flow
116
-
117
- The CLI implements a secure authentication flow that validates access tokens before any upload operation:
118
-
119
- 1. **Token Storage**: Access tokens are stored securely in `~/.ludeo/config.json`
120
- 2. **Pre-upload Validation**: Every upload operation automatically validates the token first
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
124
-
125
- ### Security Features
126
- - **Automatic Validation**: Tokens are validated before every API operation
127
- - **Session Persistence**: Valid sessions are maintained for the duration of the token
128
- - **Secure Storage**: Tokens are stored in user's home directory with appropriate permissions
129
- - **No Token Logging**: Only first/last 4 characters of tokens are displayed in logs
53
+ ## Features
130
54
 
131
- ## 🔧 How It Works
55
+ - **Easy Upload**: Upload complete game builds with a single command
56
+ - **Large File Support**: Automatically handles large files and multiple files
57
+ - **Progress Tracking**: Real-time progress updates during uploads
58
+ - **Cross-Platform**: Works on Windows, macOS, and Linux
59
+ - **Automatic Updates**: Keep your CLI up to date with npm
132
60
 
133
- ### Complete Upload Process
134
- The CLI performs a complete upload in the following steps:
135
-
136
- 1. **Validation**: Validates the local directory and build parameters
137
- 2. **Base Path Derivation**: Automatically derives `basePath` from the root folder name of `--local-directory`
138
- - Example: `--local-directory ./builds` → `basePath = "builds"`
139
- - Example: `--local-directory ./game-assets` → `basePath = "game-assets"`
140
- 3. **Build Creation**: Creates build metadata via the sonic-server API with the derived `basePath`
141
- 4. **File Upload**: Uploads all files to S3 via the cloud-builds service
142
- - Small files (<100MB): Direct upload
143
- - Large files (≥100MB): Multipart upload with concurrent parts
144
- 5. **File Registration**: Registers uploaded files with the cloud-builds service
145
- 6. **Completion**: Marks the upload as complete
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
-
153
- ### Base Path Derivation
154
- The CLI automatically derives the `basePath` from your `--local-directory`:
61
+ ## Updating
155
62
 
156
63
  ```bash
157
- # If you specify:
158
- --local-directory ./builds
159
-
160
- # The CLI will derive:
161
- basePath = "builds"
162
-
163
- # And send to the API:
164
- {
165
- "basePath": "builds",
166
- "execPath": "./builds/game.exe", # Your input unchanged
167
- "localDirectory": "./builds" # Your input unchanged
168
- }
64
+ npm update -g @ludeo/cli
169
65
  ```
170
66
 
171
- This matches exactly how the UI works - the system derives the base path from the uploaded directory structure.
172
-
173
- ### File Upload Features
174
- - **Automatic Multipart**: Files over 100MB automatically use multipart uploads
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
179
- - **Cross-Platform**: Handles Windows and Unix path separators
180
-
181
- ### Performance
182
- - **High-Performance Concurrent Uploads**: 32 workers for maximum throughput
183
- - **Multipart Optimization**: Large files split into 100MB parts for optimal performance
184
- - **Connection Reuse**: HTTP connections reused for better performance
185
- - **Progress Reporting**: Real-time feedback with detailed worker statistics
186
- - **Upload State Persistence**: Recovery from interruptions in `~/.ludeo-upload-state/`
187
-
188
- ## ⚙️ Configuration
189
-
190
- The CLI stores configuration in `~/.ludeo/config.json`. You can also use environment variables:
67
+ ## CI/CD Integration
191
68
 
192
- - `LUDEO_ACCESS_TOKEN`: Your Ludeo access token
193
- - `LUDEO_ENVIRONMENT`: Target environment (staging, production)
194
- - `LUDEO_API_BASE_URL`: Sonic-server API base URL
195
- - `LUDEO_CLOUD_BUILDS_URL`: Cloud-builds API base URL
69
+ ### GitHub Actions
70
+ ```yaml
71
+ - name: Install Ludeo CLI
72
+ run: npm install -g @ludeo/cli
196
73
 
197
- ### Environment Support
198
-
199
- The CLI supports three environments:
200
-
201
- #### Staging (Default)
202
- ```json
203
- {
204
- "environment": "staging",
205
- "api_base_url": "https://services.stg.use1.ludeo.com/api/v3",
206
- "cloud_builds_url": "https://services.stg.use1.ludeo.com/api/v3/cloud-builds"
207
- }
208
- ```
209
-
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"
74
+ - name: Upload Build
75
+ run: |
76
+ ludeo auth login --access-token ${{ secrets.LUDEO_ACCESS_TOKEN }}
77
+ ludeo builds upload \
78
+ --game-id ${{ env.GAME_ID }} \
79
+ --exec-path ./builds/game.exe \
80
+ --local-directory ./builds
252
81
  ```
253
82
 
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
- ```
83
+ ## Troubleshooting
263
84
 
264
- ## 🛠️ Development
85
+ ### Installation Issues
265
86
 
266
- ### Building
87
+ **Binary not found error:**
267
88
  ```bash
268
- make build
89
+ npm rebuild @ludeo/cli
269
90
  ```
270
91
 
271
- ### Testing
92
+ **Permission issues (macOS/Linux):**
272
93
  ```bash
273
- make test
94
+ sudo npm install -g @ludeo/cli
274
95
  ```
275
96
 
276
- ### Local Development
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
287
- go run main.go builds upload --help
288
- ```
289
-
290
- ## 🚨 Troubleshooting
97
+ **Windows issues:**
98
+ - Run PowerShell as Administrator
99
+ - Ensure Node.js is properly installed
291
100
 
292
101
  ### Common Issues
293
102
 
294
- 1. **Authentication Errors**
295
- - Ensure access token is valid and not expired
296
- - Check that the access token has upload permissions
297
-
298
- 2. **File Upload Failures**
299
- - Verify local directory exists and is readable
300
- - Check network connectivity to S3 endpoints
301
- - Ensure files are not corrupted or locked
302
-
303
- 3. **Large File Issues**
304
- - Multipart uploads require stable network connections
305
- - Very large files (>1GB) may take significant time
306
- - Monitor progress output for upload status
307
- - Upload state is automatically saved for recovery
308
-
309
- 4. **Path Issues**
310
- - Use forward slashes (/) in paths for cross-platform compatibility
311
- - Ensure executable path is relative to base path
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
-
318
- ### Debug Mode
319
- Enable debug output by setting the log level:
320
- ```bash
321
- export LUDEO_LOG_LEVEL=debug
322
- ludeo builds upload [flags]
323
- ```
324
-
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
103
+ **Authentication errors:**
104
+ - Verify your access token is valid
105
+ - Check token permissions with `ludeo auth status`
334
106
 
335
- ## 📖 API Reference
107
+ **Upload failures:**
108
+ - Ensure your build directory exists and is readable
109
+ - Check your internet connection
110
+ - Verify file paths are correct
336
111
 
337
- ### Service Interfaces
338
- - **`builds.Service`**: Basic build operations (metadata only)
339
- - **`builds.CompleteUploadService`**: Complete upload operations including files
112
+ **Large files:**
113
+ - Large files may take time to upload
114
+ - Ensure stable internet connection
340
115
 
341
- ### Key Endpoints
342
- - **Authentication**: `{{baseUrl}}/authentication/cli`
343
- - **Builds**: `{{baseUrl}}/sonic-server/builds`
344
- - **Cloud Builds**: `{{cloudBuildsUrl}}/uploads`
116
+ ## Support
345
117
 
346
- ## 🤝 Support
118
+ Need help? Here's how to get support:
347
119
 
348
- For issues and questions:
349
- - Check the troubleshooting section above
350
- - Review the CLI output for error details
351
- - Contact the Ludeo platform team
120
+ 1. Check this README and troubleshooting section
121
+ 2. Run `npm rebuild @ludeo/cli` if you encounter issues
122
+ 3. Contact the Ludeo platform team for additional assistance
352
123
 
353
- ## 📄 License
124
+ For detailed documentation and advanced usage, visit the [Ludeo Developer Portal](https://developers.ludeo.com).
354
125
 
355
- This project is proprietary to Ludeo and its partners.
package/dist/ludeo CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Ludeo CLI - Upload game builds and manage content on the Ludeo platform",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -31,7 +31,6 @@
31
31
  "files": [
32
32
  "bin/",
33
33
  "dist/",
34
- "README.md",
35
34
  "LICENSE"
36
35
  ],
37
36
  "os": [