Skip to content

Commit 3850116

Browse files
authored
Update cli_commands_reference.md
1 parent 16a935e commit 3850116

1 file changed

Lines changed: 176 additions & 103 deletions

File tree

docs/cli_commands_reference.md

Lines changed: 176 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,195 +1,268 @@
1-
# omnipkg CLI Commands Reference
1+
# Omnipkg CLI Documentation
2+
*The intelligent Python package manager that eliminates dependency hell*
23

3-
This document provides a comprehensive overview of all `omnipkg` command-line interface (CLI) commands and their usage.
4+
## Quick Start
45

5-
## Global Options
6+
```bash
7+
# Install packages with smart conflict resolution
8+
8pkg install requests numpy>=1.20
9+
10+
# Install multiple versions of the same package
11+
8pkg install uv==0.7.13 uv==0.7.14
612

7-
* `-v`, `--version`: Displays the current version of `omnipkg`.
13+
# See what's installed
14+
8pkg list
815

9-
## Commands
16+
# Explore a package interactively
17+
8pkg info tensorflow
18+
19+
# Try the demos
20+
8pkg demo
21+
```
1022

1123
---
1224

13-
### `omnipkg install <package_spec> [package_spec...]`
25+
## Core Commands
26+
27+
### 📦 Package Management
1428

15-
**Description**: The primary command for installing packages. `omnipkg` intelligently manages versions, automatically resolving conflicts by creating isolated "bubbles" for conflicting versions while keeping your main environment stable.
29+
#### `8pkg install <package_spec> [package_spec...]`
30+
Install packages with intelligent conflict resolution. Omnipkg automatically handles version conflicts by creating isolated "bubbles" while keeping your main environment stable.
1631

17-
**Arguments**:
18-
* `<package_spec>`: One or more package specifications (e.g., `"requests"`, `"numpy==1.26.4"`, `"django>=3.0,<4.0"`).
19-
* `-r`, `--requirement <FILE>`: Install packages listed in a `requirements.txt`-like file.
32+
**Options:**
33+
- `-r, --requirement <FILE>` - Install from requirements file
2034

21-
**Examples**:
35+
**Examples:**
2236
```bash
23-
# Install a specific version of a package
24-
omnipkg install flask==2.3.0
37+
# Basic install
38+
8pkg install flask==2.3.0
2539

26-
# Install multiple packages
27-
omnipkg install requests==2.32.4 tqdm
40+
# Multiple packages
41+
8pkg install requests tqdm pandas
2842

29-
# Install multiple versions of the same package (omnipkg will bubble one)
30-
omnipkg install uv==0.7.13 uv==0.7.14
43+
# From requirements file
44+
8pkg install -r requirements.txt
3145

32-
# Install from a requirements file
33-
omnipkg install -r my_project_requirements.txt
46+
# Multiple versions (omnipkg handles conflicts automatically)
47+
8pkg install numpy==1.24.0 numpy==1.26.4
3448
```
3549

36-
---
50+
#### `8pkg install-with-deps <package> --dependency <dep>...`
51+
Install a package with specific dependency versions - perfect for AI/ML workflows where you need exact version combinations.
3752

38-
### `omnipkg install-with-deps <package_spec> [--dependency <dep_spec>...]`
53+
```bash
54+
# Install TensorFlow with specific NumPy version
55+
8pkg install-with-deps tensorflow==2.13.0 --dependency numpy==1.24.3
3956

40-
**Description**: Installs a package while allowing you to specify exact versions for its direct or transitive dependencies. This is particularly useful for complex ecosystems like AI/ML where a specific combination of a main package and its underlying libraries (e.g., TensorFlow with a precise NumPy version) is required. `omnipkg` will ensure these versions are present, bubbling them if they conflict with your main environment.
57+
# Multiple dependencies
58+
8pkg install-with-deps torch==2.0.0 --dependency numpy==1.24.3 --dependency pillow==9.5.0
59+
```
4160

42-
**Arguments**:
43-
* `<package_spec>`: The main package to install (e.g., `"tensorflow==2.13.0"`).
44-
* `--dependency <dep_spec>`: One or more explicit dependency versions (e.g., `"numpy==1.24.3"`, `"typing-extensions==4.5.0"`). Can be used multiple times.
61+
#### `8pkg uninstall <package> [--yes]`
62+
Intelligently remove packages with interactive version selection.
4563

46-
**Example**:
4764
```bash
48-
omnipkg install-with-deps tensorflow==2.13.0 --dependency numpy==1.24.3 --dependency typing-extensions==4.5.0
65+
8pkg uninstall old-library
66+
8pkg uninstall torch --yes # Skip confirmation
4967
```
5068

5169
---
5270

53-
### `omnipkg list [filter]`
71+
### 📋 Information & Status
5472

55-
**Description**: Displays all packages `omnipkg` is aware of, distinguishing between versions active in your main Python environment and those stored in isolated "bubbles."
73+
#### `8pkg list [filter]`
74+
View all managed packages, showing active vs bubbled versions.
75+
76+
```bash
77+
8pkg list # All packages
78+
8pkg list tensor # Filter by name
79+
```
5680

57-
**Arguments**:
58-
* `[filter]`: An optional string to filter package names (e.g., `"flask"` will show `flask` and `flask-login`).
81+
#### `8pkg info <package> [--version <version>]`
82+
Interactive package explorer with detailed metadata and version management.
5983

60-
**Examples**:
6184
```bash
62-
# List all managed packages
63-
omnipkg list
85+
8pkg info requests
86+
8pkg info numpy --version 1.24.3
87+
```
88+
89+
#### `8pkg status`
90+
Environment health dashboard showing active packages, bubble usage, and system status.
6491

65-
# List packages matching a filter
66-
omnipkg list tensor
92+
```bash
93+
8pkg status
6794
```
6895

6996
---
7097

71-
### `omnipkg status`
98+
### 🔄 Environment Management
7299

73-
**Description**: Provides a high-level overview of your `omnipkg`-managed Python environment's health. It shows the active `site-packages` path, the number of active packages, the total size and count of isolated bubbles, and fun status messages about critical tools like `pip` and `uv`.
100+
#### `8pkg swap <type> <version>`
101+
Switch between different versions of packages or Python interpreters at runtime.
74102

75-
**Usage**:
76103
```bash
77-
omnipkg status
104+
8pkg swap python 3.11 # Switch Python version
105+
8pkg swap numpy 1.24.0 # Switch package version
78106
```
79107

80-
---
81-
82-
### `omnipkg info <package_name> [--version <version_spec>]`
108+
#### `8pkg revert [--yes]`
109+
Restore environment to last known good state - your "undo" button.
83110

84-
**Description**: Provides a detailed interactive dashboard for a specific package. You can explore its metadata, dependencies, active status, and any bubbled versions.
111+
```bash
112+
8pkg revert
113+
8pkg revert --yes # Skip confirmation
114+
```
85115

86-
**Arguments**:
87-
* `<package_name>`: The name of the package to inspect (e.g., `"requests"`, `"numpy"`).
88-
* `--version <version_spec>`: Optional. Specify a particular version to inspect directly (e.g., `"1.24.3"`). If omitted, `omnipkg` might offer interactive choices.
116+
#### `8pkg run <script_path> [args...]`
117+
Run Python scripts with auto-healing - if version conflicts occur, omnipkg automatically resolves them and re-runs.
89118

90-
**Examples**:
91119
```bash
92-
omnipkg info flask-login
93-
omnipkg info uv --version 0.7.14
120+
8pkg run my_script.py
121+
8pkg run analysis.py --input data.csv
94122
```
95123

96124
---
97125

98-
### `omnipkg demo`
126+
### 🐍 Python Management
127+
128+
#### `8pkg python <subcommand>`
129+
Manage Python interpreters in your environment.
99130

100-
**Description**: An interactive showcase of `omnipkg`'s core version-switching capabilities. This is highly recommended for new users to see `omnipkg` in action on various package types.
131+
**Subcommands:**
132+
- `adopt <version>` - Add a Python version to omnipkg management
133+
- `remove <version>` - Remove a managed Python version
134+
- `switch <version>` - Switch to a different Python version
135+
- `rescan` - Refresh the Python interpreter registry
101136

102-
**Usage**:
103137
```bash
104-
omnipkg demo
138+
8pkg python adopt 3.11
139+
8pkg python switch 3.12
140+
8pkg python remove 3.9
105141
```
106-
Follow the on-screen prompts to select a demo (Python module switching, binary switching, C-extension switching, complex dependency switching).
107142

108143
---
109144

110-
### `omnipkg stress-test`
145+
### 🧹 Maintenance
111146

112-
**Description**: A heavy-duty demonstration of `omnipkg`'s resilience with large, complex scientific computing packages (NumPy, SciPy). It performs a series of challenging installations and runtime version swaps to prove `omnipkg`'s ability to handle previously "impossible" dependency scenarios.
147+
#### `8pkg prune <package> [--keep-latest N] [--yes]`
148+
Clean up old bubbled versions to save disk space.
113149

114-
**Usage**:
115150
```bash
116-
omnipkg stress-test
151+
8pkg prune tensorflow --keep-latest 3 # Keep 3 most recent versions
152+
8pkg prune numpy --yes # Remove all old versions
117153
```
118-
**(Note**: This demo currently requires Python 3.11. Future versions of `omnipkg` will enable cross-Python-version interpreter hot-swapping.)
119154

120-
---
155+
#### `8pkg rebuild-kb [--force]`
156+
Refresh omnipkg's knowledge base of package metadata.
157+
158+
```bash
159+
8pkg rebuild-kb # Standard refresh
160+
8pkg rebuild-kb --force # Complete rebuild
161+
```
121162

122-
### `omnipkg revert [--yes]`
163+
#### `8pkg reset [--yes]`
164+
Clear omnipkg's Redis knowledge base (keeps actual packages).
123165

124-
**Description**: Your "undo" button for environment changes. `omnipkg` maintains "last known good" snapshots of your environment. This command restores your main environment to the state of the last snapshot, effectively reversing any unintended changes (e.g., downgrades caused by `pip` or `uv`).
166+
```bash
167+
8pkg reset --yes
168+
```
125169

126-
**Arguments**:
127-
* `--yes`, `-y`: Skip the confirmation prompt.
170+
#### `8pkg reset-config [--yes]`
171+
Delete configuration file to trigger fresh setup.
128172

129-
**Examples**:
130173
```bash
131-
omnipkg revert
132-
omnipkg revert --yes
174+
8pkg reset-config --yes
133175
```
134176

135177
---
136178

137-
### `omnipkg uninstall <package_name> [package_name...] [--yes]`
138-
139-
**Description**: Intelligently removes packages. By default, it will prompt you to select which versions (active, bubbled, or all non-protected) of a package to remove. It handles associated files and cleans up its knowledge base.
179+
### ⚙️ Configuration
140180

141-
**Arguments**:
142-
* `<package_name>`: One or more package names to uninstall.
143-
* `--yes`, `-y`: Skip confirmation prompts for removal.
181+
#### `8pkg config <action> [key] [value]`
182+
Manage omnipkg settings.
144183

145-
**Examples**:
146184
```bash
147-
omnipkg uninstall old-library
148-
omnipkg uninstall torch --yes
185+
8pkg config view # Show current config
186+
8pkg config set language es # Set display language
187+
8pkg config get redis.host # Get specific setting
149188
```
150-
**(Note**: `omnipkg`'s core dependencies and `omnipkg` itself are protected from accidental uninstallation from the active environment.)
151189

152190
---
153191

154-
### `omnipkg rebuild-kb [--force]`
192+
## Interactive Demos
155193

156-
**Description**: Refreshes `omnipkg`'s internal knowledge base. `omnipkg` stores rich metadata about your packages and their file hashes in Redis. Use this command if you suspect the knowledge base is out of sync or corrupted, or after manually altering installed packages (not recommended).
194+
### `8pkg demo`
195+
Interactive showcase of version-switching capabilities. Great for new users!
157196

158-
**Arguments**:
159-
* `--force`, `-f`: Ignore existing cache and force a complete rebuild of all package metadata and file hashes.
197+
**Demo Types:**
198+
- Python module switching
199+
- Binary switching
200+
- C-extension switching
201+
- Complex dependency switching
160202

161-
**Usage**:
162-
```bash
163-
omnipkg rebuild-kb
164-
omnipkg rebuild-kb --force
165-
```
203+
### `8pkg stress-test`
204+
Heavy-duty demonstration with large scientific packages (NumPy, SciPy). Shows omnipkg handling "impossible" dependency scenarios.
205+
206+
*Note: Currently requires Python 3.11*
166207

167208
---
168209

169-
### `omnipkg reset [--yes]`
210+
## Global Options
170211

171-
**Description**: Deletes `omnipkg`'s entire Redis knowledge base. This will clear all package metadata, hash indexes, and bubble tracking data. It does NOT delete actual package files from your system. Use this for a complete clean slate if `omnipkg` is misbehaving severely, then follow up with `omnipkg rebuild-kb`.
212+
- `-v, --version` - Show omnipkg version
213+
- `-h, --help` - Show help message
214+
- `--lang CODE` - Override display language (e.g., `es`, `de`, `ja`)
172215

173-
**Arguments**:
174-
* `--yes`, `-y`: Skip the confirmation prompt.
216+
---
175217

176-
**Usage**:
177-
```bash
178-
omnipkg reset
179-
omnipkg reset --yes
180-
```
218+
## Key Concepts
219+
220+
**🫧 Bubbles**: Isolated package versions that don't conflict with your main environment
221+
222+
**🔄 Runtime Switching**: Change package/Python versions without restarting your environment
223+
224+
**🧠 Knowledge Base**: Redis-powered metadata system that tracks all packages and their relationships
225+
226+
**🛡️ Auto-Healing**: Automatic resolution of version conflicts when running scripts
181227

182228
---
183229

184-
### `omnipkg reset-config [--yes]`
230+
## Common Workflows
231+
232+
### Setting up a new project
233+
```bash
234+
# Install your main dependencies
235+
8pkg install django>=4.0 psycopg2-binary
236+
237+
# Add development tools
238+
8pkg install pytest black flake8
239+
240+
# Check everything is working
241+
8pkg status
242+
```
243+
244+
### Handling version conflicts
245+
```bash
246+
# Install conflicting versions (omnipkg handles it)
247+
8pkg install numpy==1.24.0 scipy # scipy needs numpy>=1.26.0
185248

186-
**Description**: Deletes `omnipkg`'s local configuration file (`~/.config/omnipkg/config.json`). The next time `omnipkg` is executed, it will run through the first-time setup process again, allowing you to reconfigure paths or Redis connections.
249+
# Switch between versions as needed
250+
8pkg swap numpy 1.26.0 # For scipy work
251+
8pkg swap numpy 1.24.0 # For legacy code
187252

188-
**Arguments**:
189-
* `--yes`, `-y`: Skip the confirmation prompt.
253+
# Or let auto-healing handle it
254+
8pkg run legacy_script.py # Automatically uses numpy 1.24.0
255+
```
190256

191-
**Usage**:
257+
### Cleaning up your environment
192258
```bash
193-
omnipkg reset-config
194-
omnipkg reset-config --yes
259+
# See what's taking up space
260+
8pkg list
261+
262+
# Remove old versions
263+
8pkg prune tensorflow --keep-latest 2
264+
8pkg prune numpy --keep-latest 1
265+
266+
# Check the results
267+
8pkg status
195268
```

0 commit comments

Comments
 (0)