Skip to content

Commit 1fa235c

Browse files
committed
docs: add comprehensive uvx usage guide
- Verified package is fully compatible with uvx - Tested with local wheel successfully - Document usage patterns and examples - Compare installation methods (uvx, uv, pipx, pip) - Include verification checklist and publishing steps Status: Ready for uvx! Works now with local wheel, will work globally after PyPI publish.
1 parent 31d04de commit 1fa235c

1 file changed

Lines changed: 225 additions & 0 deletions

File tree

UVX_USAGE.md

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
# Using markdown-vault with uvx
2+
3+
## What is uvx?
4+
5+
`uvx` is uv's command for running Python applications in isolated environments without permanent installation. It's like `npx` for Python - run tools directly without polluting your global environment.
6+
7+
## Quick Start
8+
9+
### ✅ Current Status: READY
10+
11+
The package is **fully compatible** with `uvx` right now!
12+
13+
### Local Testing (Before Publishing)
14+
15+
Run from the built wheel file:
16+
17+
```bash
18+
# Build the package first
19+
uv build
20+
21+
# Run with uvx from local wheel
22+
uvx --from dist/markdown_vault-0.0.1-py3-none-any.whl markdown-vault --help
23+
uvx --from dist/markdown_vault-0.0.1-py3-none-any.whl markdown-vault version
24+
```
25+
26+
### After Publishing to PyPI
27+
28+
Once published, users can run it directly:
29+
30+
```bash
31+
# Run the latest version
32+
uvx markdown-vault start --help
33+
34+
# Run a specific version
35+
uvx markdown-vault==0.0.1 start
36+
37+
# Start the server
38+
uvx markdown-vault start --reload
39+
40+
# With a config file
41+
uvx markdown-vault start --config /path/to/config.yaml
42+
```
43+
44+
## Usage Examples
45+
46+
### 1. One-off Server Launch
47+
48+
```bash
49+
# Quick test without installation
50+
uvx markdown-vault start --reload
51+
```
52+
53+
### 2. Generate API Key
54+
55+
```bash
56+
# Generate a key without installing
57+
uvx markdown-vault start --generate-key
58+
```
59+
60+
### 3. Check Version
61+
62+
```bash
63+
uvx markdown-vault version
64+
```
65+
66+
### 4. With Environment Variables
67+
68+
```bash
69+
# Set config via env vars
70+
MARKDOWN_VAULT_SERVER__PORT=8080 \
71+
MARKDOWN_VAULT_VAULT__PATH=/path/to/vault \
72+
uvx markdown-vault start
73+
```
74+
75+
## Configuration Options
76+
77+
### Method 1: Config File
78+
```bash
79+
uvx markdown-vault start --config config.yaml
80+
```
81+
82+
### Method 2: Environment Variables
83+
```bash
84+
export MARKDOWN_VAULT_SERVER__HOST=0.0.0.0
85+
export MARKDOWN_VAULT_SERVER__PORT=27124
86+
export MARKDOWN_VAULT_VAULT__PATH=/path/to/vault
87+
uvx markdown-vault start
88+
```
89+
90+
### Method 3: Inline (with uvx env)
91+
```bash
92+
uvx --with markdown-vault markdown-vault start
93+
```
94+
95+
## Entry Point Configuration
96+
97+
The package is configured with a CLI entry point in `pyproject.toml`:
98+
99+
```toml
100+
[project.scripts]
101+
markdown-vault = "markdown_vault.__main__:main"
102+
```
103+
104+
This means:
105+
- ✅ The `markdown-vault` command is available after installation
106+
-`uvx` can find and run it automatically
107+
- ✅ Works from PyPI once published
108+
- ✅ Works from local wheel files now
109+
110+
## Advantages of uvx
111+
112+
1. **No Installation Required** - Run without `pip install`
113+
2. **Isolated Environment** - Each run gets fresh dependencies
114+
3. **Version Pinning** - Specify exact version to run
115+
4. **Clean System** - No global package pollution
116+
5. **Quick Testing** - Try before you buy
117+
118+
## For Users (After PyPI Publishing)
119+
120+
### Installation Methods Comparison
121+
122+
| Method | Command | Use Case |
123+
|--------|---------|----------|
124+
| **uvx** (recommended) | `uvx markdown-vault start` | Quick runs, testing, CI/CD |
125+
| **uv pip** | `uv pip install markdown-vault` | Development, permanent install |
126+
| **pipx** | `pipx install markdown-vault` | Global CLI tool |
127+
| **pip** | `pip install markdown-vault` | Traditional installation |
128+
129+
### Recommended: Use uvx
130+
131+
```bash
132+
# For most users - just run it!
133+
uvx markdown-vault start --reload
134+
```
135+
136+
### Why uvx is Great for This Tool
137+
138+
- **Server Application** - Often run temporarily for specific vaults
139+
- **No Config Needed** - Can use env vars or CLI flags
140+
- **Clean Environment** - Fresh dependencies every time
141+
- **Easy Updates** - Just run `uvx markdown-vault@latest`
142+
143+
## Publishing to PyPI
144+
145+
To make this work for everyone:
146+
147+
```bash
148+
# 1. Build the package
149+
uv build
150+
151+
# 2. Upload to PyPI (requires account)
152+
uv publish
153+
154+
# Or use twine
155+
python -m twine upload dist/*
156+
```
157+
158+
After publishing, anyone can:
159+
160+
```bash
161+
uvx markdown-vault start
162+
```
163+
164+
## Verification Checklist
165+
166+
- ✅ Package builds successfully (`uv build`)
167+
- ✅ Entry point defined in `pyproject.toml`
168+
- ✅ Works with local wheel (`uvx --from dist/...`)
169+
- ✅ CLI commands work (`start`, `version`)
170+
- ✅ Help text displays correctly
171+
- ✅ All dependencies included
172+
173+
## Current Status
174+
175+
**Ready for uvx**
176+
177+
```bash
178+
# Works now (from local wheel)
179+
uvx --from dist/markdown_vault-0.0.1-py3-none-any.whl markdown-vault start --help
180+
181+
# Will work after PyPI publish
182+
uvx markdown-vault start
183+
```
184+
185+
## Alternative: pipx (Similar Tool)
186+
187+
If users prefer `pipx`:
188+
189+
```bash
190+
# Install once
191+
pipx install markdown-vault
192+
193+
# Run anytime
194+
markdown-vault start
195+
196+
# Upgrade
197+
pipx upgrade markdown-vault
198+
```
199+
200+
## Documentation for README
201+
202+
Add to README.md:
203+
204+
```markdown
205+
## Quick Start with uvx (Recommended)
206+
207+
No installation needed! Run directly:
208+
209+
\`\`\`bash
210+
uvx markdown-vault start --reload
211+
\`\`\`
212+
213+
Or install permanently:
214+
215+
\`\`\`bash
216+
pip install markdown-vault
217+
markdown-vault start --reload
218+
\`\`\`
219+
```
220+
221+
---
222+
223+
**Status**: ✅ Fully compatible with uvx!
224+
**Tested**: Works with local wheel
225+
**Ready**: Publish to PyPI for global uvx access

0 commit comments

Comments
 (0)