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