Cli
Traces CLI
Command-line interface reference for traces.do - Trace collection and analysis
Traces CLI
Trace collection and analysis
Installation
# Install globally
npm install -g do
# Or use via npx
npx do --versionQuick Start
# Basic usage
do analytics traces track conversionCommands
Main Command
do analytics traces track conversionDescription: Trace collection and analysis
Usage:
do traces [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 traces \
--option1=value1 \
--option2=value2 \
--verboseUsage Examples
Basic Example
# Simple usage
do analytics traces track conversionWith Options
# With configuration
do analytics traces track conversion --verbose --jsonInteractive Mode
# Interactive prompts
do traces --interactiveBatch Operations
# Process multiple items
do traces --batch items.jsonPipeline Integration
# Use with pipes
cat data.json | do traces --stdin | jq '.'Configuration
Config File
Create .doconfig in your project:
{
"traces": {
"option1": "value1",
"option2": "value2"
}
}Environment Variables
export DO_TRACES_OPTION1=value1
export DO_TRACES_OPTION2=value2
do analytics traces track conversionOutput Formats
Default Output
do analytics traces track conversion
# ✓ Operation completed
# Result: ...JSON Output
do analytics traces track conversion --json
# {
# "success": true,
# "result": { ... }
# }Verbose Output
do analytics traces track conversion --verbose
# → Starting operation...
# → Processing...
# → Completed in 1.2sScripting
Bash Scripts
#!/bin/bash
# Check if successful
if do analytics traces track conversion; then
echo "Success!"
else
echo "Failed!"
exit 1
fiCI/CD Integration
# GitHub Actions
- name: Run Traces
run: |
do analytics traces track conversion \
--config prod.json \
--quietError Handling
Exit Codes
0- Success1- General error2- Invalid arguments3- Timeout4- Not found
Error Messages
# Capture errors
do analytics traces track conversion 2>errors.log
# Handle errors
if ! do analytics traces track conversion; then
echo "Error occurred, check errors.log"
exit 1
fiDebugging
# Debug mode
DEBUG=* do analytics traces track conversion
# Dry run
do analytics traces track conversion --dry-run
# Verbose + timing
time do analytics traces track conversion --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