Domo Query CLI
A simple command-line interface for exploring your
Domo data pipelines, datasets, and dataflows.
Features
- 🔍 Data Discovery - Search and explore datasets, dataflows, and cards
- 🔗 Data Lineage - Trace data flow with focused Mermaid diagrams
- 📊 Pipeline Monitoring - Track dataflow execution and health scores
- 👥 Team Management - List and explore users and groups
- 📝 Flexible Output - Unified
--format=json and --export flags across all commands
- 🚀 Performance - Built-in caching to minimize API calls
- 🎯 Smart Autocomplete - Interactive command discovery with tab completion
- 💾 File Export - Export results to JSON or Markdown files with
--export flags
Prerequisites
For Users (Pre-built Binary)
- Domo Instance: Access to a Domo instance (e.g., yourcompany.domo.com)
- Credentials:
- API Token
- OAuth Client ID and Secret
For Development
- Node.js: Version 18 or higher
- Yarn: Version 4.x (via Corepack)
- Git: For cloning the repository
Installation
[!CAUTION]
Pre-release, very early in development. Iterative changes to be expected.
Use only if you know what you’re doing.
Quick Install (Recommended)
# Clone the repository
git clone https://github.com/jsade/domo-query-cli.git
cd domo-query-cli
# Standard installation (copies binary)
./install.sh
# OR for developers (creates auto-updating symlink)
./install.sh --symlink
# or
yarn install:dev
The installation script will:
- Install dependencies
- Build a standalone executable
- Install it to your system PATH (
$HOME/.local/bin or /usr/local/bin)
- Set up configuration files
Symlink mode (recommended for developers):
- Creates a symlink instead of copying the binary
- Automatically uses the latest version after running
yarn build:dist
- No manual reinstallation needed during development
Manual Installation
If you prefer to build from source:
# Clone the repository
git clone https://github.com/jsade/domo-query-cli.git
cd domo-query-cli
# Enable Corepack for Yarn 4
corepack enable
# Install dependencies
yarn install
# Build standalone executable
yarn build:dist
# The executable will be in release/domo-query-cli
# Copy it to a directory in your PATH
cp release/domo-query-cli /usr/local/bin/
# Copy environment variables template
cp .env.example ~/.domo-cli/.env
Development Setup
Developer Installation (Auto-Updating)
For active development, install the CLI in symlink mode for automatic updates:
# Install as symlink (auto-updates on rebuild)
yarn install:dev
# Build the executable
yarn build:dist
# CLI is now globally available and automatically updated!
domo-query-cli --version
Uninstall:
yarn uninstall
Build from Source
# Build TypeScript for development
yarn build
# Run development mode (watch for changes)
yarn dev
# Run the CLI locally without building
yarn start
# or
yarn shell
Create Standalone Executables
# Build distributable executable for current platform
yarn build:dist
# Executable will be in release/domo-query-cli
# Archive will be in release/domo-query-cli-<platform>.zip
Development Workflow
# Run tests
yarn test
yarn test:watch # Watch mode
yarn test:coverage # With coverage
# Code quality
yarn check # Run all checks (format, lint, types)
yarn format # Format code
yarn lint # Lint code
yarn lint:fix # Fix linting issues
yarn typecheck # TypeScript type checking
# Generate API types from OpenAPI specs
yarn generate:types
Configuration
Edit the .env file in the project root:
# Your Domo instance
DOMO_API_HOST=yourcompany.domo.com
# Authentication
# API Token
DOMO_API_TOKEN=your-api-token-here
# OAuth
DOMO_CLIENT_ID=your-client-id
DOMO_CLIENT_SECRET=your-client-secret
# Optional settings
DOMO_EXPORT_PATH=./exports
LOG_PATH=./logs
Getting API Credentials
API Token:
- Log into Domo → Admin → Security → Access Tokens
- Create new token with appropriate permissions
- Required for: dataflow execution, dataset property updates
OAuth Credentials:
- Go to Admin → Security → Client Management
- Create new client application
- Copy Client ID and Secret
- Sufficient for: read operations, listing resources
Note: Some operations require specific authentication methods. API tokens provide broader permissions than OAuth for write operations.
Proxy Configuration
For corporate proxies, add to .env:
HTTPS_PROXY=http://proxy.company.com:8080
HTTP_PROXY=http://proxy.company.com:8080
NO_PROXY=localhost,127.0.0.1,*.internal.company.com
# For self-signed certificates (development only)
NODE_TLS_REJECT_UNAUTHORIZED=0
Quick Start
-
Start the interactive CLI:
# If installed via install.sh
domo-query-cli
# Or run directly from release directory
./release/domo-query-cli
# Or for development
yarn start
-
Type help to see all available commands
-
Begin exploring your data!
For non-interactive usage (scripts, automation, CI/CD), see CLI.md for comprehensive documentation.
Contributing
Contributions are welcome! See CONTRIBUTING.md for setup, workflow, tests, and release process.
Command Reference
📚 For comprehensive command documentation and non-interactive usage, see CLI.md
Output Options
All commands support unified output flags:
--format=json - Output JSON to stdout
--export - Export to timestamped JSON file
--export=md - Export as Markdown
--export=both - Export both JSON and Markdown
--export-path=<dir> - Custom export directory
--output=<path> - Write to specific file
See CLI.md for complete documentation and examples.
Core Commands
| Command |
Description |
list-datasets [search] |
List all datasets with filtering and search |
get-dataset <id> |
Get detailed dataset information |
get-dataset-parents <id> |
Get immediate parents for a dataset (API-required); returns parent nodes keyed like DATAFLOW24 |
get-dataset-children <id> |
Get immediate children for a dataset (API-required); returns child nodes keyed like CARD123 |
update-dataset-properties <id> |
Update dataset name, description, tags (requires API token) |
list-dataflows [search] |
List or search dataflows |
get-dataflow <id> |
Get dataflow details and execution history |
execute-dataflow <id> |
Trigger a dataflow to run |
show-lineage <id> |
Visualize data lineage with Mermaid diagrams |
list-cards |
List all accessible Domo cards |
list-users [search] |
List all users with optional search and role filtering |
get-user <id> |
Get detailed user information including group memberships |
list-groups [search] |
List all groups with optional search and type filtering |
get-group <id> |
Get group details with member information |
cache-status |
View or clear cache |
help |
Show all available commands |
Common Examples
Interactive Mode
# Start the interactive shell
domo-query-cli
# Inside the shell:
> list-datasets sales # Search for sales datasets
> get-dataset abc-123-def # Get specific dataset details
> execute-dataflow 12345 # Run a dataflow
> show-lineage abc-123 --diagram # Visualize data lineage
> help # See all commands
Get Dataset Parents (JSON)
domo-query-cli get-dataset-parents <dataset-id> --format=json
Returns a JSON parents array of full nodes and a keyed map (<TYPE><ID>, e.g., DATAFLOW24) for O(1) lookup. Parent nodes include a name field when available (e.g., dataflow or dataset names).
Get Dataset Children (JSON)
domo-query-cli get-dataset-children <dataset-id> --format=json
Returns a JSON children array of full nodes and a keyed map (<TYPE><ID>, e.g., CARD1213...) for O(1) lookup. Child nodes include a name field when available (e.g., card title, dataset name, or dataflow name).
Non-Interactive Mode (Scripts & Automation)
# List datasets with pagination
domo-query-cli list-datasets --limit 10 --offset 20
# Get JSON output for processing
domo-query-cli list-datasets --format=json | jq '.data[]'
# Export to timestamped JSON file
domo-query-cli list-datasets --export
# Export both JSON and Markdown
domo-query-cli get-dataflow 12345 --export=both
# Export to custom location
domo-query-cli show-lineage abc-123 --export-path=/path/to/exports
# Write to specific file
domo-query-cli list-users --output=users.json
# Update dataset properties
domo-query-cli update-dataset-properties abc-123 \
--name "Q4 Sales Data" \
--tags "sales,q4,2024" \
--no-confirm
# Execute dataflow with authentication
domo-query-cli --token YOUR_API_TOKEN execute-dataflow 12345
# Run in read-only mode (prevents destructive operations)
domo-query-cli --read-only list-dataflows
Monitoring Dataflows
#!/bin/bash
# Monitor dataflow execution status
FLOW_ID="12345"
if domo-query-cli execute-dataflow "$FLOW_ID"; then
echo "Dataflow started successfully"
# Check execution status
domo-query-cli list-dataflow-executions "$FLOW_ID" --limit 1
else
echo "Failed to start dataflow"
exit 1
fi
User and Group Management
# List users by role with JSON output
domo-query-cli list-users --role Admin --format=json
# Get user details and export to file
domo-query-cli get-user 871428330 --export
# Find groups and export results
domo-query-cli list-groups "engineering" --export=both
domo-query-cli get-group 1324037627 --format=json
# Use offline mode with cached data
domo-query-cli get-user 871428330 --offline
domo-query-cli get-group 1324037627 --offline --export
Troubleshooting
macOS Issues
“Permission Denied”
chmod +x domo-query-cli
“Developer cannot be verified”
- System Preferences → Security & Privacy → Allow Anyway
- Or run:
xattr -d com.apple.quarantine domo-query-cli
Connection Issues
- Verify DOMO_API_HOST (no https://)
- Check credentials are valid
- For proxy: ensure HTTPS_PROXY is set
- For SSL: set NODE_TLS_REJECT_UNAUTHORIZED=0 (dev only)
API Token Issues
- Ensure token has necessary permissions
- API tokens required for dataflow operations
- Use OAuth for dataset/card operations
General Tips
- Check logs in LOG_PATH directory
- Clear cache with
cache-status --clear
- Use tab completion for commands and IDs
Built with ❤️ for the Domo community
评论