CLI configuration and utility commands for environment information, settings management, and system diagnostics.
Comprehensive environment and system information for debugging and issue reporting.
/**
* Display environment information for debugging
* @param options - Information display options
*/
gatsby info [options]
interface InfoOptions {
clipboard?: boolean; // -C, --clipboard copy to clipboard automatically
}Usage Examples:
# Display environment information
gatsby info
# Copy information to clipboard automatically
gatsby info --clipboard
gatsby info -CInformation Categories:
System Information:
Runtime Information:
Browser Information:
Development Tools:
Gatsby Packages:
Sample Output:
System:
OS: macOS 13.4.1
CPU: (8) arm64 Apple M1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
Browsers:
Chrome: 114.0.5735.133
Edge: Not Found
Firefox: Not Found
Safari: 16.5.2
npmPackages:
gatsby: ^5.14.0 => 5.14.0
gatsby-cli: ^5.14.0 => 5.14.0
gatsby-plugin-image: ^3.14.0 => 3.14.0Automatic copying of environment information for easy sharing and issue reporting.
/**
* Clipboard functionality for environment information
* Automatically copies output to system clipboard
*/
interface ClipboardConfig {
clipboard: boolean; // Enable automatic clipboard copying
}Platform Support:
pbcopy commandUsage Examples:
# Copy to clipboard (works on macOS and Windows)
gatsby info --clipboard
# Linux with GUI
DISPLAY=:0 gatsby info --clipboard
# Linux TTY (clipboard disabled automatically)
gatsby info --clipboard # Still displays output, no clipboardManage CLI-specific configuration settings and preferences.
/**
* CLI configuration management
* @param cmd - Configuration command (set)
* @param key - Configuration key to modify
* @param value - New value for the configuration key
*/
gatsby options <cmd> [key] [value]
type ConfigCommand = "set";
type ConfigKey = "pm" | "package-manager";
type ConfigValue = "npm" | "yarn";Usage Examples:
# View current configuration
gatsby options
# Set package manager to yarn
gatsby options set pm yarn
gatsby options set package-manager yarn
# Set package manager to npm
gatsby options set pm npm
gatsby options set package-manager npmConfiguration Storage:
/**
* Configuration storage interface
* Uses Gatsby's centralized configuration system
*/
interface ConfigStore {
get(key: string): any; // Retrieve configuration value
set(key: string, value: any): void; // Set configuration value
}
/**
* Package manager configuration
*/
type PackageManager = "yarn" | "npm";Supported Configuration Keys:
cli.packageManager - Preferred package manager for gatsby newManage package manager preferences for project creation and dependency management.
/**
* Package manager preference management
* Controls which package manager gatsby new uses
*/
interface PackageManagerConfig {
packageManager: PackageManager; // Preferred package manager
}
/**
* Package manager utility functions
*/
function getPackageManager(): PackageManager;
function setPackageManager(packageManager: PackageManager): void;Package Manager Detection:
Configuration Impact:
gatsby new dependency installationDisplay version information for Gatsby CLI and related packages.
/**
* Version information display
* Shows CLI version and local Gatsby version
*/
gatsby --version
gatsby -vUsage Examples:
# Show version information
gatsby --version
gatsby -vVersion Display Logic:
/**
* Version information structure
*/
interface VersionInfo {
cliVersion: string; // gatsby-cli package version
gatsbyVersion?: string; // Local gatsby version (if in project)
projectPath?: string; // Current project path
}Sample Output:
# Outside Gatsby project
Gatsby CLI version: 5.14.0
# Inside Gatsby project
Gatsby CLI version: 5.14.0
Gatsby version: 5.14.0
Note: this is the Gatsby version for the site at: /Users/dev/my-gatsby-siteTelemetry and analytics configuration (feature deprecated and disabled).
/**
* Telemetry configuration (deprecated)
* All telemetry is now disabled by default
*/
gatsby telemetry [options]
interface TelemetryOptions {
enable?: boolean; // Enable telemetry (no effect)
disable?: boolean; // Disable telemetry (no effect)
}Usage Examples:
# Check telemetry status (always disabled)
gatsby telemetry
# Attempt to enable (no effect)
gatsby telemetry --enable
# Attempt to disable (no effect)
gatsby telemetry --disableTelemetry Status:
Manage user feedback and survey preferences for Gatsby CLI development.
/**
* Feedback preference management
* Controls whether user feedback prompts are shown
*/
gatsby feedback [options]
interface FeedbackOptions {
enable?: boolean; // --enable feedback requests
disable?: boolean; // --disable feedback requests
}Usage Examples:
# Check current feedback preferences
gatsby feedback
# Enable feedback requests
gatsby feedback --enable
# Disable feedback requests
gatsby feedback --disableFeedback System:
Feedback Types:
Advanced diagnostic information for troubleshooting complex issues.
Node.js Version Validation:
Dependency Analysis:
Environment Validation:
Management of Gatsby CLI configuration files and settings persistence.
/**
* Configuration file management
* Handles persistent storage of CLI preferences
*/
interface ConfigFileManager {
configPath: string; // Configuration file location
load(): Record<string, any>; // Load configuration from file
save(config: Record<string, any>): void; // Save configuration to file
reset(): void; // Reset to default configuration
}Configuration Locations:
~/Library/Preferences/gatsby-cli/%APPDATA%/gatsby-cli/~/.config/gatsby-cli/Configuration Persistence:
Configuration management includes comprehensive error handling:
Configuration Errors:
Environment Errors:
Recovery Strategies:
Configuration management integrates with common development workflows:
Project Initialization:
CI/CD Integration:
Team Collaboration: