Dgraph CLI
The Dgraph command-line interface (CLI) provides comprehensive tools for deploying and managing Dgraph in self-managed environments. Whether you're running Dgraph on on-premises infrastructure or cloud platforms (AWS, GCP, Azure), the CLI gives you complete control over your deployment.
CLI Structure
The Dgraph CLI is built around the root dgraph command and its subcommands. Many commands support their own subcommands, creating a hierarchical structure. For example, dgraph acl requires you to specify a subcommand like add, del, info, or mod.
Available Commands
The Dgraph CLI includes the following command groups:
Core Commands
dgraph alpha- Run Dgraph Alpha database nodesdgraph zero- Run Dgraph Zero management nodes
Data Loading Commands
dgraph bulk- Bulk load data with the Bulk Loaderdgraph live- Load data with the Live Loaderdgraph restore- Restore backups from Enterprise Edition
Security Commands
dgraph acl- Manage Access Control Lists (ACL)dgraph audit- Decrypt audit filesdgraph cert- Manage TLS certificates
Debug Commands
dgraph debug- Debug Dgraph instancesdgraph debuginfo- Generate debug information
Utility Commands
dgraph completion- Generate shell completion scriptsdgraph conv- Convert geographic files to RDFdgraph decrypt- Decrypt exported filesdgraph export_backup- Export binary backupsdgraph increment- Test with transactional counterdgraph lsbackup- List backup informationdgraph migrate- Migrate from MySQL to Dgraphdgraph upgrade- Upgrade Dgraph versions
Configuration
Dgraph provides flexible configuration options:
- Superflags - Learn about compound flags for complex commands
- Configuration Guide - Configure using flags, environment variables, or config files
Getting Help
You can view help for any command using the --help flag:
dgraph --help # Show all available commands
dgraph alpha --help # Show alpha-specific options
dgraph acl add --help # Show help for acl add subcommand