provisioning/docs/src/infrastructure/cli-reference.md

2 lines
23 KiB
Markdown
Raw Normal View History

# CLI Reference\n\nComplete command-line reference for Infrastructure Automation. This guide covers all commands, options, and usage patterns.\n\n## What You'll Learn\n\n- Complete command syntax and options\n- All available commands and subcommands\n- Usage examples and patterns\n- Scripting and automation\n- Integration with other tools\n- Advanced command combinations\n\n## Command Structure\n\nAll provisioning commands follow this structure:\n\n```\nprovisioning [global-options] <command> [subcommand] [command-options] [arguments]\n```\n\n### Global Options\n\nThese options can be used with any command:\n\n| Option | Short | Description | Example |\n| -------- | ------- | ------------- | --------- |\n| `--infra` | `-i` | Specify infrastructure | `--infra production` |\n| `--environment` | | Environment override | `--environment prod` |\n| `--check` | `-c` | Dry run mode | `--check` |\n| `--debug` | `-x` | Enable debug output | `--debug` |\n| `--yes` | `-y` | Auto-confirm actions | `--yes` |\n| `--wait` | `-w` | Wait for completion | `--wait` |\n| `--out` | | Output format | `--out json` |\n| `--help` | `-h` | Show help | `--help` |\n\n### Output Formats\n\n| Format | Description | Use Case |\n| -------- | ------------- | ---------- |\n| `text` | Human-readable text | Terminal viewing |\n| `json` | JSON format | Scripting, APIs |\n| `yaml` | YAML format | Configuration files |\n| `toml` | TOML format | Settings files |\n| `table` | Tabular format | Reports, lists |\n\n## Core Commands\n\n### help - Show Help Information\n\nDisplay help information for the system or specific commands.\n\n```\n# General help\nprovisioning help\n\n# Command-specific help\nprovisioning help server\nprovisioning help taskserv\nprovisioning help cluster\n\n# Show all available commands\nprovisioning help --all\n\n# Show help for subcommand\nprovisioning server help create\n```\n\n**Options:**\n\n- `--all` - Show all available commands\n- `--detailed` - Show detailed help with examples\n\n### version - Show Version Information\n\nDisplay version information for the system and dependencies.\n\n```\n# Basic version\nprovisioning version\nprovisioning --version\nprovisioning -V\n\n# Detailed version with dependencies\nprovisioning version --verbose\n\n# Show version info with title\nprovisioning --info\nprovisioning -I\n```\n\n**Options:**\n\n- `--verbose` - Show detailed version information\n- `--dependencies` - Include dependency versions\n\n### env - Environment Information\n\nDisplay current environment configuration and settings.\n\n```\n# Show environment variables\nprovisioning env\n\n# Show all environment and configuration\nprovisioning allenv\n\n# Show specific environment\nprovisioning env --environment prod\n\n# Export environment\nprovisioning env --export\n```\n\n**Output includes:**\n\n- Configuration file locations\n- Environment variables\n- Provider settings\n- Path configurations\n\n## Server Management Commands\n\n### server create - Create Servers\n\nCreate new server instances based on configuration.\n\n```\n# Create all servers in infrastructure\nprovisioning server create --infra my-infra\n\n# Dry run (check mode)\nprovisioning server create --infra my-infra --check\n\n# Create with confirmation\nprovisioning server create --infra my-infra --yes\n\n# Create and wait for completion\nprovisioning server create --infra my-infra --wait\n\n# Create specific server\nprovisioning server create web-01 --infra my-infra\n\n# Create with custom settings\nprovisioning server create --infra my-infra --settings custom.ncl\n```\n\n**Options:**\n\n- `--check`, `-c` - Dry run mode (show what would be created)\n- `--yes`, `-y` - Auto-confirm creation\n- `--wait`, `-w` - Wait for servers to be fully ready\n- `--settings`, `-s` - Custom settings file\n- `--template`, `-t` - Use specific template\n\n### server delete - Delete Servers\n\nRemove server instances and associated resources.\n\n```\n# Delete all servers\nprovisioning server delete --infra my-infra\n\n# Delete with confirmation\nprovisioning server delete --infra my-infra --yes\n\