Cli
Storage CLI
Command-line interface reference for storage.do - Cloud storage and file management
Storage CLI
Cloud storage and file management
Installation
# Install globally
npm install -g do
# Or use via npx
npx do --versionQuick Start
# Basic usage
do storage storage upload data.csvCommands
Main Command
do storage storage upload data.csvDescription: Cloud storage and file management
Usage:
do storage [options]Options
Global Options
--help, -h- Show help--version, -v- Show version--verbose- Verbose output--quiet, -q- Quiet mode--json- JSON output--config <file>- Config file path
Command-Specific Options
do storage \
--option1=value1 \
--option2=value2 \
--verboseUsage Examples
Basic Example
# Simple usage
do storage storage upload data.csvWith Options
# With configuration
do storage storage upload data.csv --verbose --jsonInteractive Mode
# Interactive prompts
do storage --interactiveBatch Operations
# Process multiple items
do storage --batch items.jsonPipeline Integration
# Use with pipes
cat data.json | do storage --stdin | jq '.'Configuration
Config File
Create .doconfig in your project:
{
"storage": {
"option1": "value1",
"option2": "value2"
}
}Environment Variables
export DO_STORAGE_OPTION1=value1
export DO_STORAGE_OPTION2=value2
do storage storage upload data.csvOutput Formats
Default Output
do storage storage upload data.csv
# ✓ Operation completed
# Result: ...JSON Output
do storage storage upload data.csv --json
# {
# "success": true,
# "result": { ... }
# }Verbose Output
do storage storage upload data.csv --verbose
# → Starting operation...
# → Processing...
# → Completed in 1.2sScripting
Bash Scripts
#!/bin/bash
# Check if successful
if do storage storage upload data.csv; then
echo "Success!"
else
echo "Failed!"
exit 1
fiCI/CD Integration
# GitHub Actions
- name: Run Storage
run: |
do storage storage upload data.csv \
--config prod.json \
--quietError Handling
Exit Codes
0- Success1- General error2- Invalid arguments3- Timeout4- Not found
Error Messages
# Capture errors
do storage storage upload data.csv 2>errors.log
# Handle errors
if ! do storage storage upload data.csv; then
echo "Error occurred, check errors.log"
exit 1
fiDebugging
# Debug mode
DEBUG=* do storage storage upload data.csv
# Dry run
do storage storage upload data.csv --dry-run
# Verbose + timing
time do storage storage upload data.csv --verboseBest Practices
- Use Config Files - Store configuration in
.doconfig - Environment Variables - Use for sensitive data
- Error Handling - Check exit codes in scripts
- JSON Output - Use
--jsonfor parsing results - Verbose Mode - Use
--verbosefor debugging