@6labs/cli
v0.2.1
Published
Bulk-upload gameplay clips to the 6labs Gameplay Library
Readme
@6labs/cli
The official command-line tool for uploading gameplay videos to your 6Labs Gameplay Library.
Upload individual files or complete folders, including subfolders, with support for concurrent uploads, videos up to 20 GB, tags, and script-friendly exit codes. For smaller uploads, use 6Labs Studio > Gameplay Library > Upload videos.
Prerequisites
Before using the CLI, make sure you have:
- Node.js 18.17 or later.
- A 6labs account with access to the game you are uploading for.
- Your 6labs upload key.
- To obtain an upload key, please contact [email protected].
- Your game's numeric App ID (for example, 12345).
- Go to Testing > your game > Gameplay Library > Get recorder, then copy the App ID.
- Videos in .mp4, .mov, .webm, or .avi format.
Note: The CLI is supported on macOS, Windows, and Linux.
1. Install
Install the package globally to make the 6labs command available from any directory:
npm install -g @6labs/cli
6labs --versionYou can also run the CLI with npx without installing it globally:
npx @6labs/cli videos upload ./gameplay --app-id 12345 --api-key "<your upload key>" --game-name "My Game" --tags "tutorial,onboarding"Important Information
- On macOS or Linux, if npm reports an EACCES or permission error while installing a global package, do not use sudo as a workaround.
- Instead, install Node.js through a version manager such as nvm, which keeps global packages in your user directory. See the npm documentation.
2. Upload Gameplay Videos
No CLI sign-in is required. To upload videos, provide your upload key using --api-key, the target game's numeric App ID, and one or more files, folders, or matching patterns.
2.1 Upload Key
Pass your 6labs upload key using --api-key. Enclose the upload key in quotes, as shown in the examples.
Treat the key like a password: don't share it, and don't write it into scripts or files you commit. Your shell saves the commands you run in its history, key included, so clear that history on a shared computer.
2.2 Preview an Upload
Use --dry-run to see which videos the CLI would upload without transferring any files. A dry run sends nothing to 6Labs and needs no --api-key.
6labs videos upload ./gameplay --game-name "My Game" --app-id 12345 --tags "tutorial,onboarding" --dry-runSample output:
skipped empty.mov -- empty file
6labs Gameplay Library
game My Game (app 12345)
tags tutorial, onboarding
files 2 · 160 MB · 3 at a time
intro.mp4 46 MB
level-1_boss.mp4 114 MB
Dry run -- nothing was uploaded.2.3 Upload Videos
Upload a folder, file, or matching pattern with the numeric app ID for the target game and your upload key:
6labs videos upload ./gameplay --app-id 12345 --api-key "<your upload key>" --game-name "My Game" --tags "tutorial,onboarding"Inputs and behavior
- Pass folders, individual files, or patterns. Folder uploads include subfolders.
- Supported formats are .mp4, .mov, .webm, and .avi. Unsupported files and hidden folders are ignored.
- Videos from subfolders include the folder path in their name. Duplicate names get a numeric suffix.
- Use
--tags "a,b"to add tags and--concurrency <n>to change the default of three simultaneous uploads. - Failed uploads are retried once without stopping the rest. Retry failed files by name to avoid uploading successful files again.
Note: Uploaded videos appear in Gameplay Library with Source = CLI. Processing can take up to 24 hours; videos can be used in tests after processing completes.
3. Commands and Options
3.1 Commands
| Command | Description |
| --- | --- |
| 6labs videos upload <paths...> | Upload videos to the Gameplay Library. |
3.2 Options
| Option | Applies to | Description |
| --- | --- | --- |
| --app-id <id> | videos upload | Required. Numeric app ID of the target game. |
| --api-key <key> | videos upload | Required. Your 6labs upload key. Not needed with --dry-run. |
| --tags "a,b" | videos upload | Comma-separated tags applied to the upload. |
| --game-name <name> | videos upload | Label shown in CLI output. |
| --concurrency <n> | videos upload | Number of simultaneous uploads. Default: 3. |
| --dry-run | videos upload | Preview the upload without transferring files. |
| --help, -h | Global | Show commands and options. |
| --version, -v | Global | Show the installed version. |
3.3 Environment Variables
| Variable | Description |
| --- | --- |
| DO_NOT_TRACK | Set to 1 to disable usage reporting (see Security and Privacy). |
4. Use CLI in Scripts
The upload command can be used in scripts or scheduled jobs:
6labs videos upload "/recordings/$(date +%F)" --app-id 12345 --api-key "$UPLOAD_KEY" --game-name "My Game" --tags "nightly"Exit codes
| Code | Meaning |
| --- | --- |
| 0 | Command completed successfully. |
| 1 | At least one video failed to upload. |
| 2 | No upload was attempted because the command was invalid, nothing could be uploaded, no --api-key was given, or the upload key was not accepted. |
Note: When output is redirected to a file or pipe, the CLI omits the live progress line. Scripts need no sign-in step: pass the key to --api-key from your CI's secret store (here, $UPLOAD_KEY), rather than writing it into the script.
5. Security and Privacy
- The CLI authenticates uploads using your upload key. Browser sign-in is not required.
- Videos upload over HTTPS using short-lived upload URLs. The CLI reads local video files but does not modify them.
- After each upload, the CLI sends 6labs a usage record: the upload key it used, and how many files it uploaded and how many failed. The usage report does not include filenames, file paths, or tags.
- Set
DO_NOT_TRACK=1to turn this off.
- Set
6. Troubleshooting
| Problem | What to do |
| --- | --- |
| 6labs: command not found / not recognized | Open a new terminal. If needed, run npm prefix -g and add npm's global binary folder to PATH. |
| EACCES / permission denied during installation | Use a Node.js version manager instead of sudo. |
| Unsupported engine or syntax error | Upgrade to Node.js 18.17 or later. |
| No upload key. Pass the upload key … with --api-key | Add --api-key "<your upload key>" to the upload command — see 2.1. |
| 6labs login has been removed | No sign-in is needed. Run 6labs videos upload with --api-key. |
| The upload key passed with --api-key was not accepted for app … | Verify your upload key and confirm that --app-id matches the target game's numeric App ID. |
| --app-id is required and must be the numeric app id | Pass the game's numeric App ID, not its name or package name. Find it in Studio: Gameplay Library > Get recorder > App ID. |
| Nothing to upload / no supported videos found | Pass a folder, file, or pattern containing .mp4, .mov, .webm, or .avi files. |
| no match <path> | Check the path and quote paths containing spaces. |
| File is empty or over 20 GB | Use a valid saved recording; split or re-encode files over 20 GB. |
| rejected … / FAILED … | Confirm access to the game and retry the file by name. Contact support if the problem continues. |
7. Update and Uninstall
Update:
npm install -g @6labs/cli@latestUninstall:
npm uninstall -g @6labs/cli8. Support
For questions, issues, or feedback, contact [email protected]. Include 6labs --version and the command you ran when useful.
9. License
Proprietary. © BlueStacks. Free for anyone to install and use. See LICENSE for the terms.
