Commands for version information, help, shell completions, cache management, and system utilities. These commands support development workflows and system integration.
Display version information for dprint and its components.
# Display version information
dprint version
dprint -v
dprint -V
dprint --versionUsage Examples:
# Standard version output
dprint version
# Output: dprint 0.50.1
# Version information includes:
# - dprint binary version
# - Build information
# - Platform detailsComprehensive help information for commands and options.
# General help
dprint help
dprint --help
dprint -h
# Command-specific help
dprint <COMMAND> --helpUsage Examples:
# General help
dprint help
# Format command help
dprint fmt --help
# Configuration help
dprint config --help
# Get help when no arguments provided
dprint # Shows help automaticallyGenerate shell completion scripts for various shells to enable tab completion.
# Generate completions for specific shell
dprint completions <SHELL>
# Supported shells:
# - bash
# - zsh
# - fish
# - powershellUsage Examples:
# Generate bash completions
dprint completions bash
# Generate zsh completions
dprint completions zsh
# Generate fish completions
dprint completions fish
# Generate PowerShell completions
dprint completions powershellInstallation Examples:
# Bash completion installation
dprint completions bash > ~/.local/share/bash-completion/completions/dprint
# Zsh completion installation
dprint completions zsh > ~/.zsh/completions/_dprint
# Fish completion installation
dprint completions fish > ~/.config/fish/completions/dprint.fish
# PowerShell completion installation (Windows)
dprint completions powershell | Out-String | Invoke-ExpressionManage dprint's internal caches for plugins and formatting results.
# Clear all caches
dprint clear-cacheUsage Examples:
# Clear all caches (plugins, formatting results, etc.)
dprint clear-cache
# Use cases:
# - Plugin loading issues
# - Outdated formatting cache
# - Storage space cleanup
# - Development/debuggingCache Types Cleared:
Display license information for dprint and its dependencies.
# Display license information
dprint licenseUsage Examples:
# Show license text
dprint license
# Output includes:
# - dprint license (MIT)
# - Third-party dependency licenses
# - Copyright informationUpdate dprint to the latest available version.
# Upgrade to latest version
dprint upgradeUsage Examples:
# Check for and install latest version
dprint upgrade
# Upgrade process:
# 1. Check current version
# 2. Query latest available version
# 3. Download and install if newer version available
# 4. Verify installationUpgrade Behavior:
# Cache directory override
DPRINT_CACHE_DIR=/custom/cache/path
# Disable upgrade checks
DPRINT_NO_UPGRADE_CHECK=1
# Configuration file override
DPRINT_CONFIG=/path/to/dprint.json# Standard exit codes for utility commands
0 # Success
1 # General error
10 # Argument parsing error# Supported platforms:
# - Linux (x86_64, aarch64)
# - macOS (x86_64, aarch64)
# - Windows (x86_64)
# Platform-specific features:
# - Windows: Registry integration
# - macOS: Homebrew integration
# - Linux: Package manager integration# CI pipeline examples
# GitHub Actions
- name: Check formatting
run: dprint check
- name: Install dprint
run: |
curl -fsSL https://dprint.dev/install.sh | sh
export PATH="$HOME/.dprint/bin:$PATH"
# GitLab CI
script:
- dprint check --allow-no-files
# Jenkins
stage('Format Check') {
steps {
sh 'dprint check'
}
}# package.json scripts
{
"scripts": {
"format": "dprint fmt",
"format:check": "dprint check",
"format:diff": "dprint fmt --diff",
"lint": "dprint check && eslint src/",
"precommit": "dprint check --staged"
}
}
# Makefile integration
.PHONY: format check
format:
dprint fmt
check:
dprint check
install-dprint:
cargo install dprint# VS Code settings.json
{
"dprint.path": "/path/to/dprint",
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true
}
# Vim/Neovim configuration
autocmd BufWritePre * :!dprint fmt %
# Emacs configuration
(add-hook 'before-save-hook 'dprint-format-buffer)# Command not found
which dprint # Check if dprint is in PATH
echo $PATH # Verify PATH includes dprint location
# Permission errors
chmod +x ~/.dprint/bin/dprint # Fix executable permissions
# Cache issues
dprint clear-cache # Clear corrupted cache
# Version conflicts
dprint upgrade # Update to latest version# Verbose output for debugging
dprint --log-level debug <command>
# System information
dprint version # Check version
env | grep DPRINT # Check environment variables
# Configuration debugging
dprint output-resolved-config # Check resolved config# Cache optimization
export DPRINT_CACHE_DIR=/fast/storage/path
# Process optimization
ulimit -n 4096 # Increase file descriptor limit
# Network optimization (for plugin downloads)
export HTTP_PROXY=http://proxy:8080
export HTTPS_PROXY=http://proxy:8080