x02-cli
v1.1.0
Published
Official CLI tool for X02 file hosting platform
Maintainers
Readme
X02 CLI
Official command-line interface for the X02 file hosting platform.
Installation
npm install -g x02-cliFor local development:
cd cli
npm install
npm linkQuick Start
x02 login
x02 upload screenshot.png
x02 upload screenshot.png report.pdf notes.txt
x02 upload --url https://example.com/photo.jpg
x02 list
x02 info screenshot.pngIf you are already logged in and want to switch accounts:
x02 logout
x02 loginOr replace the saved key directly:
x02 login --replace --key YOUR_API_KEYCommands
Authentication
x02 login
x02 login --key YOUR_API_KEY
x02 login --replace --key YOUR_API_KEY
x02 logout
x02 statusFile Operations
x02 upload file.png
x02 upload file1.png file2.jpg file3.pdf
x02 upload file.png --expiry 1d --copy
x02 upload file1.png file2.jpg --dry-run
x02 upload --url https://example.com/photo.jpg
x02 upload --url https://example.com/photo.jpg --expiry 1d --copy
x02 list
x02 list --json
x02 info file.png
x02 delete file.png --forceBulk upload is supported by passing multiple files to x02 upload. You can also upload images from remote URLs using the --url option.
Folder Operations
x02 folder list
x02 folder create Screenshots
x02 folder delete Screenshots
x02 folder move file.png Screenshots
x02 folder move file.png --rootConfiguration
x02 config
x02 config get baseUrl
x02 config set baseUrl https://x02.me
x02 config set autoCopy true
x02 config delete defaultFolderSupported config keys:
apiKeybaseUrlautoCopyverbosedefaultFolder
Environment Overrides
Environment variables take precedence over stored config:
X02_API_KEY=your-key
X02_BASE_URL=https://x02.me
X02_AUTO_COPY=true
X02_VERBOSE=true
X02_DEFAULT_FOLDER=ScreenshotsBehavior Notes
- Configuration is stored in
~/.x02/config.json. upload --dry-runanddelete --dry-runvalidate input without making API changes.- Bulk upload is supported:
x02 upload file1.png file2.jpg file3.pdf - URL upload is supported:
x02 upload --url https://example.com/photo.jpg - Auth-protected commands fail with exit code
1when no API key is configured. - Running
x02 loginwhile already logged in gives guidance instead of overwriting the saved account. npm startprints CLI help and exits successfully.
Development
cd cli
npm test
node bin/x02.js --helpRequirements
- Node.js
>=18
Support
- Website: https://x02.me
- API Docs: https://x02.me/api-docs
