Skip to content

Commit 1d76eeb

Browse files
committed
Add VPM Docs
1 parent 2450290 commit 1d76eeb

11 files changed

Lines changed: 1514 additions & 1 deletion

File tree

.vitepress/config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export default defineConfig({
123123
text: 'VPM 包管理器',
124124
collapsed: true,
125125
items: [
126+
{ text: 'VPM 主页', link: '/vpm/zh_CN/' },
126127
{ text: '什么是 VPM?', link: '/vpm/zh_CN/what-is-vpm' },
127128
{ text: '快速入门', link: '/vpm/zh_CN/getting-started' },
128129
{ text: '命令参考', link: '/vpm/zh_CN/commands' },
@@ -132,6 +133,7 @@ export default defineConfig({
132133
text: 'VPM Package Manager',
133134
collapsed: true,
134135
items: [
136+
{ text: 'VPM Main Page', link: '/vpm/en/' },
135137
{ text: 'What is VPM?', link: '/vpm/en/what-is-vpm' },
136138
{ text: 'Getting Started', link: '/vpm/en/getting-started' },
137139
{ text: 'Commands Reference', link: '/vpm/en/commands' },
@@ -180,6 +182,7 @@ export default defineConfig({
180182
text: 'VPM 包管理器',
181183
collapsed: true,
182184
items: [
185+
{ text: 'VPM 主页', link: '/vpm/zh-CN/' },
183186
{ text: '什么是 VPM?', link: '/vpm/zh_CN/what-is-vpm' },
184187
{ text: '快速入门', link: '/vpm/zh_CN/getting-started' },
185188
{ text: '命令参考', link: '/vpm/zh_CN/commands' },
@@ -189,6 +192,7 @@ export default defineConfig({
189192
text: 'VPM Package Manager',
190193
collapsed: true,
191194
items: [
195+
{ text: 'VPM Main Page', link: '/vpm/en/' },
192196
{ text: 'What is VPM?', link: '/vpm/en/what-is-vpm' },
193197
{ text: 'Getting Started', link: '/vpm/en/getting-started' },
194198
{ text: 'Commands Reference', link: '/vpm/en/commands' },

vpm

Lines changed: 0 additions & 1 deletion
This file was deleted.

vpm/en/commands.md

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

Comments
 (0)