/

Loading...
The DataChonk CLI lets you scan databases, generate models, and chat with the Brain directly from your terminal.
brew tap datachonk/tap
brew install datachonkcurl -fsSL https://datachonk.dev/install.sh | bash# npm
npm install -g @datachonk/cli
# yarn
yarn global add @datachonk/cli
# pnpm
pnpm add -g @datachonk/cligit clone https://github.com/datachonk/datachonk.git
cd datachonk/cli
npm install
npm run build
npm linkRequirements: Node.js 18+ is required. Install with brew install node on macOS.
Set your API key to connect to your DataChonk account:
datachonk config set apiKey YOUR_API_KEYOr set the DATACHONK_API_KEY environment variable.
initInitialize DataChonk in your project directory
datachonk init [options]| Option | Description |
|---|---|
| --api-key <key> | Set your API key |
| --project <id> | Link to existing project |
scanScan a database to discover tables and relationships
datachonk scan [options]| Option | Description |
|---|---|
| -t, --type <type> | Database type (postgresql, mysql, snowflake, bigquery, redshift) |
| -h, --host <host> | Database host |
| -p, --port <port> | Database port |
| -d, --database <db> | Database name |
| -u, --user <user> | Database user |
| --password <pass> | Database password |
| -s, --schemas <list> | Comma-separated schemas to scan |
| -o, --output <file> | Output results to file |
| --sync | Sync results to DataChonk cloud |
| --json | Output as JSON |
generateGenerate dbt models using AI
datachonk generate <type> <name> [options]| Option | Description |
|---|---|
| --goal <text> | Description of what you want |
| --tables <list> | Source tables to use |
| --output <dir> | Output directory |
chatInteractive chat with the Brain
datachonk chat [message]| Option | Description |
|---|---|
| --model <id> | Focus on specific model |
| --context <file> | Add file as context |
lineageAnalyze model lineage
datachonk lineage [model]| Option | Description |
|---|---|
| --upstream | Show only upstream dependencies |
| --downstream | Show only downstream dependencies |
| --depth <n> | Maximum depth to traverse |
| --json | Output as JSON |
configManage configuration
datachonk config <subcommand>| Option | Description |
|---|---|
| set <key> <value> | Set a configuration value |
| get <key> | Get a configuration value |
| list | List all configuration |
| connections add | Add a database connection |
| connections list | List saved connections |
cacheManage the local cache for faster scans
datachonk cache <subcommand>| Option | Description |
|---|---|
| status | Show cache statistics and size |
| clear | Clear all cached data |
| clear --schema <name> | Clear cache for specific schema |
| --ttl <hours> | Set cache TTL (default: 24h) |
pluginsManage DataChonk plugins
datachonk plugins <subcommand>| Option | Description |
|---|---|
| list | List installed plugins |
| install <name> | Install a plugin from npm |
| uninstall <name> | Remove an installed plugin |
| create <name> | Scaffold a new plugin project |
| --local | List only local plugins |
templatesManage code generation templates
datachonk templates <subcommand>| Option | Description |
|---|---|
| list | List available templates |
| show <name> | Display template content |
| export <name> | Export template to local file |
| import <file> | Import custom template |
| reset | Reset all templates to defaults |
validateValidate generated models and configurations
datachonk validate [options]| Option | Description |
|---|---|
| --strict | Enable strict validation rules |
| --fix | Auto-fix common issues |
| --format <type> | Output format (text, json, junit) |
| --project-id <id> | Validate specific project |
pushPush generated models to GitHub
datachonk push [options]| Option | Description |
|---|---|
| --branch <name> | Target branch (default: main) |
| --pr | Create a pull request |
| --message <text> | Commit message |
| --dry-run | Preview changes without pushing |
semanticManage semantic layer definitions
datachonk semantic <subcommand>| Option | Description |
|---|---|
| generate --model <name> | Generate semantic model from fact table |
| validate | Validate semantic definitions |
| query --metric <name> | Preview metric query |
| --group-by <dims> | Dimensions to group by |
datachonk scan \
--type postgresql \
--host localhost \
--port 5432 \
--database analytics \
--user postgres \
--schemas public,staging \
--syncdatachonk generate staging orders \
--goal "Clean and standardize the raw orders table" \
--tables raw.ordersdatachonk chat
> Create a fact table that joins orders with customers
> Add a metric for monthly recurring revenue
> Generate tests for the customer dimension