|
| 1 | +# VPM Commands Reference |
| 2 | + |
| 3 | +Complete reference for all VPM (Vix Package Manager) commands. |
| 4 | + |
| 5 | +## Command Overview |
| 6 | + |
| 7 | +| Command | Description | |
| 8 | +|---------|-------------| |
| 9 | +| `vpm init [name]` | Initialize a new Vix project | |
| 10 | +| `vpm add <package>[@version]` | Add a package dependency | |
| 11 | +| `vpm remove <package>` | Remove a package dependency | |
| 12 | +| `vpm install` | Install all dependencies | |
| 13 | +| `vpm update [package]` | Update packages | |
| 14 | +| `vpm search <query>` | Search for packages | |
| 15 | +| `vpm publish` | Publish your package | |
| 16 | +| `vpm list` | List installed packages | |
| 17 | +| `vpm info <package>` | Show package information | |
| 18 | +| `vpm config` | Configure VPM settings | |
| 19 | + |
| 20 | +## Detailed Command Reference |
| 21 | + |
| 22 | +### vpm init |
| 23 | + |
| 24 | +Initialize a new Vix project: |
| 25 | + |
| 26 | +```bash |
| 27 | +vpm init [project-name] |
| 28 | +``` |
| 29 | + |
| 30 | +**Options:** |
| 31 | +- `--template <name>` - Use a specific project template |
| 32 | +- `--author <name>` - Set author name |
| 33 | +- `--license <type>` - Set license type (MIT, Apache2.0, GPL3.0) |
| 34 | + |
| 35 | +**Example:** |
| 36 | +```bash |
| 37 | +vpm init my-app --template cli --author "John Doe" --license MIT |
| 38 | +``` |
| 39 | + |
| 40 | +### vpm add |
| 41 | + |
| 42 | +Add a package to your project: |
| 43 | + |
| 44 | +```bash |
| 45 | +vpm add <package-name>[@version] |
| 46 | +``` |
| 47 | + |
| 48 | +**Options:** |
| 49 | +- `--dev` - Add as development dependency |
| 50 | +- `--exact` - Pin to exact version |
| 51 | + |
| 52 | +**Examples:** |
| 53 | +```bash |
| 54 | +vpm add std-extra |
| 55 | +vpm add math-lib@1.0.0 |
| 56 | +vpm add test-lib --dev |
| 57 | +``` |
| 58 | + |
| 59 | +### vpm remove |
| 60 | + |
| 61 | +Remove a package from your project: |
| 62 | + |
| 63 | +```bash |
| 64 | +vpm remove <package-name> |
| 65 | +``` |
| 66 | + |
| 67 | +**Example:** |
| 68 | +```bash |
| 69 | +vpm remove std-extra |
| 70 | +``` |
| 71 | + |
| 72 | +### vpm install |
| 73 | + |
| 74 | +Install all dependencies listed in `vpm.json`: |
| 75 | + |
| 76 | +```bash |
| 77 | +vpm install |
| 78 | +``` |
| 79 | + |
| 80 | +**Options:** |
| 81 | +- `--production` - Skip development dependencies |
| 82 | +- `--force` - Force reinstall all packages |
| 83 | + |
| 84 | +### vpm update |
| 85 | + |
| 86 | +Update packages to latest versions: |
| 87 | + |
| 88 | +```bash |
| 89 | +vpm update [package-name] |
| 90 | +``` |
| 91 | + |
| 92 | +**Options:** |
| 93 | +- `--major` - Allow major version updates |
| 94 | +- `--minor` - Allow minor version updates (default) |
| 95 | +- `--patch` - Only update patch versions |
| 96 | + |
| 97 | +**Examples:** |
| 98 | +```bash |
| 99 | +vpm update # Update all |
| 100 | +vpm update std-extra # Update specific package |
| 101 | +vpm update --major # Allow breaking changes |
| 102 | +``` |
| 103 | + |
| 104 | +### vpm search |
| 105 | + |
| 106 | +Search the package registry: |
| 107 | + |
| 108 | +```bash |
| 109 | +vpm search <query> |
| 110 | +``` |
| 111 | + |
| 112 | +**Options:** |
| 113 | +- `--limit <n>` - Limit number of results |
| 114 | +- `--verbose` - Show detailed information |
| 115 | + |
| 116 | +**Example:** |
| 117 | +```bash |
| 118 | +vpm search math --limit 10 |
| 119 | +``` |
| 120 | + |
| 121 | +### vpm publish |
| 122 | + |
| 123 | +Publish your package to the registry: |
| 124 | + |
| 125 | +```bash |
| 126 | +vpm publish |
| 127 | +``` |
| 128 | + |
| 129 | +**Options:** |
| 130 | +- `--dry-run` - Test without publishing |
| 131 | +- `--tag <tag>` - Publish with a tag |
| 132 | + |
| 133 | +**Prerequisites:** |
| 134 | +- You must have an account on the Vix package registry |
| 135 | +- You must be logged in (`vpm login`) |
| 136 | + |
| 137 | +### vpm list |
| 138 | + |
| 139 | +List all installed packages: |
| 140 | + |
| 141 | +```bash |
| 142 | +vpm list |
| 143 | +``` |
| 144 | + |
| 145 | +**Output:** |
| 146 | +``` |
| 147 | +Installed packages: |
| 148 | +- std-extra@1.2.0 |
| 149 | +- math-lib@0.5.0 |
| 150 | +- test-utils@2.0.1 |
| 151 | +``` |
| 152 | + |
| 153 | +**Options:** |
| 154 | +- `--outdated` - Show only outdated packages |
| 155 | +- `--json` - Output in JSON format |
| 156 | + |
| 157 | +### vpm info |
| 158 | + |
| 159 | +Show detailed information about a package: |
| 160 | + |
| 161 | +```bash |
| 162 | +vpm info <package-name> |
| 163 | +``` |
| 164 | + |
| 165 | +**Output:** |
| 166 | +``` |
| 167 | +Package: std-extra |
| 168 | +Version: 1.2.0 |
| 169 | +Description: Extended standard library for Vix |
| 170 | +Author: Vix Community |
| 171 | +License: MIT |
| 172 | +Homepage: https://github.com/vix-lang/std-extra |
| 173 | +Dependencies: |
| 174 | + - math-lib@^0.5.0 |
| 175 | +``` |
| 176 | + |
| 177 | +### vpm config |
| 178 | + |
| 179 | +Configure VPM settings: |
| 180 | + |
| 181 | +```bash |
| 182 | +vpm config <key> [value] |
| 183 | +``` |
| 184 | + |
| 185 | +**Available Keys:** |
| 186 | +- `registry` - Package registry URL |
| 187 | +- `cache-dir` - Cache directory path |
| 188 | +- `auto-install` - Automatically install dependencies (true/false) |
| 189 | + |
| 190 | +**Examples:** |
| 191 | +```bash |
| 192 | +vpm config registry https://packages.vix-lang.org |
| 193 | +vpm config cache-dir ~/.vpm/cache |
| 194 | +vpm config auto-install true |
| 195 | +``` |
| 196 | + |
| 197 | +## Configuration File |
| 198 | + |
| 199 | +VPM uses `~/.vpm/config.toml` for global settings: |
| 200 | + |
| 201 | +```toml |
| 202 | +registry = "https://packages.vix-lang.org" |
| 203 | +cache_dir = "~/.vpm/cache" |
| 204 | +auto_install = true |
| 205 | + |
| 206 | +[publish] |
| 207 | +username = "your-username" |
| 208 | +token = "your-api-token" |
| 209 | +``` |
| 210 | + |
| 211 | +## Next Steps |
| 212 | + |
| 213 | +- [What is VPM?](what-is-vpm.md) - Overview |
| 214 | +- [Getting Started](getting-started.md) - Quick start guide |
0 commit comments