|
| 1 | +# conflict - Tool Version Conflict Detection |
| 2 | + |
| 3 | +The `conflict` command checks for version conflicts between required tools and their installed versions, helping ensure compatibility before deployment. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | +```bash |
| 7 | +# Check for version conflicts |
| 8 | +nixopus conflict |
| 9 | + |
| 10 | +# Check with custom config file |
| 11 | +nixopus conflict --config-file /path/to/config.yaml |
| 12 | + |
| 13 | +# Get JSON output |
| 14 | +nixopus conflict --output json |
| 15 | +``` |
| 16 | + |
| 17 | +## Overview |
| 18 | + |
| 19 | +The conflict command analyzes your system's installed tool versions against the requirements specified in your configuration file. It helps identify potential compatibility issues by: |
| 20 | +- Verifying tool availability |
| 21 | +- Comparing installed versions with expected version ranges |
| 22 | +- Supporting various version specification formats |
| 23 | +- Providing detailed conflict reports |
| 24 | + |
| 25 | +## Usage |
| 26 | + |
| 27 | +```bash |
| 28 | +nixopus conflict [OPTIONS] |
| 29 | +``` |
| 30 | + |
| 31 | +| Option | Short | Description | Default | |
| 32 | +|--------|-------|-------------|---------| |
| 33 | +| `--config-file` | `-c` | Path to configuration file | `helpers/config.prod.yaml` | |
| 34 | +| `--timeout` | `-t` | Timeout for tool checks in seconds | `5` | |
| 35 | +| `--verbose` | `-v` | Show detailed logging | `false` | |
| 36 | +| `--output` | `-o` | Output format (text/json) | `text` | |
| 37 | + |
| 38 | +**Examples:** |
| 39 | + |
| 40 | +```bash |
| 41 | +# Basic conflict check |
| 42 | +nixopus conflict |
| 43 | + |
| 44 | +# Check with verbose output |
| 45 | +nixopus conflict --verbose |
| 46 | + |
| 47 | +# Use custom configuration file |
| 48 | +nixopus conflict --config-file /custom/config.yaml |
| 49 | + |
| 50 | +# Get JSON formatted results |
| 51 | +nixopus conflict --output json |
| 52 | + |
| 53 | +# Increase timeout for slower systems |
| 54 | +nixopus conflict --timeout 10 |
| 55 | +``` |
| 56 | + |
| 57 | +## Configuration |
| 58 | + |
| 59 | +The conflict command reads tool version requirements from your configuration file's `deps` section. |
| 60 | + |
| 61 | +### Configuration Format |
| 62 | + |
| 63 | +```yaml |
| 64 | +deps: |
| 65 | + docker: |
| 66 | + version: ">=20.0.0" |
| 67 | + git: |
| 68 | + version: ">=2.30.0" |
| 69 | + go: |
| 70 | + version: "1.20" |
| 71 | + postgresql: |
| 72 | + version: ">=14.0.0, <16.0.0" |
| 73 | +``` |
| 74 | +
|
| 75 | +### Supported Version Formats |
| 76 | +
|
| 77 | +The conflict checker supports multiple version specification formats: |
| 78 | +
|
| 79 | +| Format | Example | Description | |
| 80 | +|--------|---------|-------------| |
| 81 | +| Exact version | `"1.20.3"` | Must match exactly | |
| 82 | +| Range operators | `">=1.20.0, <2.0.0"` | Version ranges with multiple conditions | |
| 83 | +| Greater/less than | `">=1.20.0"`, `"<2.0.0"` | Single comparison operators | |
| 84 | +| Compatible release | `"~=1.20.0"` | Compatible release (Python-style) | |
| 85 | +| Major.minor only | `"1.20"` | Treated as `>=1.20.0, <1.21.0` | |
| 86 | + |
| 87 | +### Version Command Configuration |
| 88 | + |
| 89 | +You can specify custom version commands for tools in the configuration: |
| 90 | + |
| 91 | +```yaml |
| 92 | +deps: |
| 93 | + custom-tool: |
| 94 | + version: ">=2.0.0" |
| 95 | + version-command: ["custom-tool", "--show-version"] |
| 96 | +``` |
| 97 | + |
| 98 | +## Tool-Specific Support |
| 99 | + |
| 100 | +The conflict checker includes built-in support for common tools: |
| 101 | + |
| 102 | +- **Docker**: Checks container runtime version |
| 103 | +- **Git**: Verifies source control version |
| 104 | +- **Go**: Checks Go compiler version |
| 105 | +- **PostgreSQL**: Validates database version |
| 106 | +- **SSH/OpenSSH**: Checks SSH client/server versions |
| 107 | +- **Redis**: Verifies Redis server version |
| 108 | +- **Python**: Checks Python interpreter version |
0 commit comments