Skip to content

Commit 45395bc

Browse files
authored
Documentation updates (#167)
* feat(cli): migrate to uv package manager. * docs(cli): Add migration guide from `pipx` to `uv` * Auto generate docs * docs(cli): add `--index-strategy unsafe-best-match` to CPU-only installation guide * docs(cli): fix typo in installation instructions and change heading layout. * docs(nvim): update neovim version in docs * Auto generate docs --------- Co-authored-by: Davidyz <[email protected]>
1 parent 175174a commit 45395bc

File tree

5 files changed

+57
-30
lines changed

5 files changed

+57
-30
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ attach the relevant config here:
3636
```
3737

3838
**Platform information:**
39-
- If the issue is about the CLI, attach the output of `pipx runpip vectorcode freeze`:
39+
- If the issue is about the CLI, attach a list of packages in the Python virtual environment:
40+
- for `pipx`, run `pipx runpip vectorcode freeze`;
41+
- for `uv`, run `uv tool run --from=vectorcode python -m ensurepip && uv tool run --from=vectorcode python -m pip freeze`.
4042
```
4143
4244
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Enhancement
3+
about: Discuss what new features can be added, or existing features improved.
4+
title: "[FEAT]"
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the feature you want**
11+
12+
> Tell me about the feature, ideally with a scenario where this feature would be
13+
useful.
14+
15+
**Complimentary Material**
16+
17+
> If there's any material that may help me implement/test this feature, please
18+
list them here.

doc/VectorCode.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,15 @@ you can use the following plugin spec:
8282
{
8383
"Davidyz/VectorCode",
8484
version = "*",
85-
build = "pipx upgrade vectorcode", -- recommended if you set `version = "*"` or follow the main branch
85+
build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date
86+
-- build = "pipx upgrade vectorcode", -- If you used pipx to install the CLI
8687
dependencies = { "nvim-lua/plenary.nvim" },
8788
}
8889
<
8990

9091

91-
This plugin is developed and tested (sort of) under the latest stable release
92-
(specifically the package provided in the Extra
93-
<https://archlinux.org/packages/extra/x86_64/neovim/> repository of Arch
94-
Linux).
92+
This plugin is developed and tested on neovim _v0.11_. It may work on older
93+
versions, but I do not test on them before publishing.
9594

9695
NIX ~
9796

docs/cli.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
* [Installation](#installation)
77
* [Install from Source](#install-from-source)
8+
* [Migration from `pipx`](#migration-from-pipx)
89
* [Chromadb](#chromadb)
9-
* [For Windows Users](#for-windows-users)
10+
* [For Windows Users](#for-windows-users)
1011
* [Legacy Environments](#legacy-environments)
1112
* [Nix](#nix)
1213
* [Getting Started](#getting-started)
@@ -44,42 +45,50 @@ compiler because the core components of the vector database (ChromaDB) contains
4445
c++ and rust code.
4546

4647
The recommended way of
47-
installation is through [`pipx`](https://pipx.pypa.io/stable/), which will
48+
installation is through [`uv`](https://docs.astral.sh/uv/), which will
4849
create a virtual environment for the package itself that doesn't mess up with
4950
your system Python or project-local virtual environments.
5051

51-
After installing `pipx`, run:
52+
After installing `uv`, run:
5253
```bash
53-
pipx install vectorcode
54+
uv tool install vectorcode
5455
```
5556
in your shell. To specify a particular version of Python, use the `--python`
56-
flag. For example, `pipx install vectorcode --python python3.11`. For hardware
57+
flag. For example, `uv tool install vectorcode --python python3.11`. For hardware
5758
accelerated embedding, refer to [the relevant section](#hardware-acceleration).
58-
If you want a cpu-only installation without CUDA dependences required by
59-
default by pytorch, run:
59+
If you want a CPU-only installation without CUDA dependencies required by
60+
default by PyTorch, run:
6061
```bash
61-
PIP_INDEX_URL="https://download.pytorch.org/whl/cpu" PIP_EXTRA_INDEX_URL="https://pypi.org/simple" pipx install vectorcode
62+
uv tool install vectorcode --index https://download.pytorch.org/whl/cpu --index-strategy unsafe-best-match
6263
```
6364

6465
If you need to install multiple dependency group (for [LSP](#lsp-mode) or
6566
[MCP](#mcp-server)), you can use the following syntax:
6667
```bash
67-
pipx install vectorcode[lsp,mcp]
68+
uv tool install vectorcode[lsp,mcp]
6869
```
6970
> [!NOTE]
7071
> The command only install VectorCode and `SentenceTransformer`, the default
71-
> embedding engine. To use a different embedding function supported by Chromadb,
72-
> you may need to use `pipx inject` to install extra dependences to the virtual
73-
> environment that `pipx` creates for VectorCode. This may include OpenAI,
74-
> Ollama and other self/cloud-hosted embedding model providers.
72+
> embedding engine. If you need to install an extra dependency, you can use
73+
> `uv tool install vectorcode --with <your_deps_here>`
7574
7675
### Install from Source
77-
To install from source, either `git clone` this reposority and run `pipx install
78-
<path_to_vectorcode_repo>`, or use the git URL:
76+
To install from source, either `git clone` this repository and run `uv tool install
77+
<path_to_vectorcode_repo>`, or use `pipx`:
7978
```bash
8079
pipx install git+https://github.com/Davidyz/VectorCode
8180
```
8281

82+
### Migration from `pipx`
83+
84+
The motivation behind the change from `pipx` to `uv tool` is mainly the
85+
performance. The caching mechanism in uv makes it a lot faster than `pipx` for a
86+
lot of operations. If you installed VectorCode via `pipx`, you can continue to
87+
use `pipx` to manage your VectorCode installation. If you wish to switch to
88+
`uv`, you need to uninstall VectorCode using `pipx` and then use `uv` to install
89+
it as described above. All your VectorCode configurations and database files
90+
will work out of the box on your new install.
91+
8392
### Chromadb
8493
[Chromadb](https://www.trychroma.com/) is the vector database used by VectorCode
8594
to store and retrieve the code embeddings. Although it is already bundled with
@@ -94,19 +103,19 @@ will significantly reduce the IO overhead and avoid potential race condition.
94103
> ChromaDB recently released v1.0.0, which may not work with VectorCode. I'm
95104
> testing with v1.0.0 and will publish a new release when it's ready.
96105
97-
#### For Windows Users
106+
### For Windows Users
98107

99108
Windows support is not officially tested at this moment. [This PR](https://github.com/Davidyz/VectorCode/pull/40)
100109
tracks my progress trying to provide better experiences for windows users.
101110

102111
### Legacy Environments
103112

104113
If your environment doesn't support `numpy` version 2.0+, the default,
105-
unconstrained numpy picked by `pipx` may not work for you. In this case, you can
106-
try installing the package by `pipx install vectorcode[legacy]`, which enforces
114+
unconstrained numpy may not work for you. In this case, you can
115+
try installing the package by `uv tool install vectorcode[legacy]`, which enforces
107116
numpy `v1.x`. If this doesn't help, please open an issue with your OS, CPU
108117
architecture, python version and the vectorcode virtual environment
109-
(`pipx runpip vectorcode freeze`).
118+
(`uv tool run --from=vectorcode python -m ensurepip && uv tool run --from=vectorcode python -m pip freeze`).
110119

111120
### Nix
112121

docs/neovim.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,14 @@ you can use the following plugin spec:
7171
{
7272
"Davidyz/VectorCode",
7373
version = "*",
74-
build = "pipx upgrade vectorcode", -- recommended if you set `version = "*"` or follow the main branch
74+
build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date
75+
-- build = "pipx upgrade vectorcode", -- If you used pipx to install the CLI
7576
dependencies = { "nvim-lua/plenary.nvim" },
7677
}
7778
```
7879

79-
> This plugin is developed and tested (sort of) under the latest stable release
80-
> (specifically the package provided in the
81-
> [Extra](https://archlinux.org/packages/extra/x86_64/neovim/)
82-
> repository of Arch Linux).
80+
> This plugin is developed and tested on neovim _v0.11_. It may work on older
81+
> versions, but I do not test on them before publishing.
8382
8483
### Nix
8584

0 commit comments

Comments
 (0)