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