Skip to content

Commit b07ce4c

Browse files
authored
chore : conflict command docs (#307)
1 parent e187dd6 commit b07ce4c

File tree

4 files changed

+139
-23
lines changed

4 files changed

+139
-23
lines changed

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export default withMermaid(
8888
collapsed: true,
8989
items: [
9090
{ text: 'preflight', link: '/cli/commands/preflight.md' },
91+
{ text: 'conflict', link: '/cli/commands/conflict.md' },
9192
{ text: 'install', link: '/cli/commands/install.md' },
9293
{ text: 'uninstall', link: '/cli/commands/uninstall.md' },
9394
{ text: 'service', link: '/cli/commands/service.md' },

docs/cli/cli-reference.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ $ nixopus [OPTIONS] COMMAND [ARGS]...
1717

1818
* `preflight`: Preflight checks for system compatibility
1919
* `clone`: Clone a repository
20+
* `conflict`: Check for tool version conflicts
2021
* `conf`: Manage configuration
2122
* `service`: Manage Nixopus services
2223
* `proxy`: Manage Nixopus proxy (Caddy) configuration
2324
* `install`: Install Nixopus
2425
* `uninstall`: Uninstall Nixopus
2526
* `version`: Show version information
26-
* `test`: Run tests (only in DEVELOPMENT environment)
2727

2828
## `nixopus preflight`
2929

@@ -127,6 +127,24 @@ $ nixopus clone [OPTIONS] COMMAND [ARGS]...
127127
* `-t, --timeout INTEGER`: Timeout in seconds [default: 10]
128128
* `--help`: Show this message and exit.
129129

130+
## `nixopus conflict`
131+
132+
Check for tool version conflicts
133+
134+
**Usage**:
135+
136+
```console
137+
$ nixopus conflict [OPTIONS] COMMAND [ARGS]...
138+
```
139+
140+
**Options**:
141+
142+
* `-c, --config-file TEXT`: Path to configuration file [default: helpers/config.prod.yaml]
143+
* `-t, --timeout INTEGER`: Timeout for tool checks in seconds [default: 5]
144+
* `-v, --verbose`: Verbose output
145+
* `-o, --output TEXT`: Output format (text/json) [default: text]
146+
* `--help`: Show this message and exit.
147+
130148
## `nixopus conf`
131149

132150
Manage configuration
@@ -500,21 +518,3 @@ $ nixopus version [OPTIONS] COMMAND [ARGS]...
500518
**Options**:
501519

502520
* `--help`: Show this message and exit.
503-
504-
## `nixopus test`
505-
506-
Run tests (only in DEVELOPMENT environment)
507-
508-
**Usage**:
509-
510-
```console
511-
$ nixopus test [OPTIONS] [TARGET] COMMAND [ARGS]...
512-
```
513-
514-
**Arguments**:
515-
516-
* `[TARGET]`: Test target (e.g., version)
517-
518-
**Options**:
519-
520-
* `--help`: Show this message and exit.

docs/cli/commands/conflict.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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

docs/cli/index.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ nixopus install
2323
| Command | Description | Key Subcommands |
2424
|---------|-------------|-----------------|
2525
| **[preflight](./commands/preflight.md)** | System readiness checks | check, ports, deps |
26+
| **[conflict](./commands/conflict.md)** | Tool version conflict detection | - |
2627
| **[install](./commands/install.md)** | Complete Nixopus installation | ssh, deps |
2728
| **[uninstall](./commands/uninstall.md)** | Remove Nixopus from system | - |
2829
| **[service](./commands/service.md)** | Control Docker services | up, down, ps, restart |
@@ -39,16 +40,19 @@ nixopus install
3940
# 1. Check system requirements
4041
nixopus preflight check
4142

42-
# 2. Install with custom domains
43+
# 2. Verify tool versions
44+
nixopus conflict
45+
46+
# 3. Install with custom domains
4347
nixopus install --api-domain api.example.com --view-domain app.example.com
4448

45-
# 3. Start services
49+
# 4. Start services
4650
nixopus service up --detach
4751

48-
# 4. Load proxy configuration
52+
# 5. Load proxy configuration
4953
nixopus proxy load
5054

51-
# 5. Verify everything is running
55+
# 6. Verify everything is running
5256
nixopus service ps
5357
```
5458

@@ -69,6 +73,9 @@ nixopus service restart
6973
# Clone repository
7074
nixopus clone --branch develop
7175

76+
# Check for version conflicts
77+
nixopus conflict --config-file config.dev.yaml
78+
7279
# Preview installation
7380
nixopus install --dry-run
7481

0 commit comments

Comments
 (0)