Skip to content

Commit 448c499

Browse files
committed
docs(cli): Add profiling and post-mortem debugging instructions
1 parent 7bb3a66 commit 448c499

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

docs/cli.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
* [Cleaning up](#cleaning-up)
2727
* [Inspecting and Manupulating Files in an Indexed Project](#inspecting-and-manupulating-files-in-an-indexed-project)
2828
* [Debugging and Diagnosing](#debugging-and-diagnosing)
29+
* [Profiling](#profiling)
30+
* [Post-mortem debugging](#post-mortem-debugging)
2931
* [Shell Completion](#shell-completion)
3032
* [Hardware Acceleration](#hardware-acceleration)
3133
* [For Developers](#for-developers)
@@ -551,6 +553,21 @@ VECTORCODE_LOG_LEVEL=INFO vectorcode vectorise file1.py file2.lua
551553
> Depending on the MCP/LSP client implementation, you may need to take extra
552554
> steps to make sure the environment variables are captured by VectorCode.
553555
556+
#### Profiling
557+
558+
When you pass `--debug` parameter to the CLI, VectorCode will track the call
559+
stacks with [cprofile](https://docs.python.org/3/library/profile.html). The
560+
stats will be saved to the log directory mentioned above. You may use an
561+
external stats viewer (like [snakeviz](https://jiffyclub.github.io/snakeviz/))
562+
to load the profiling stats for a better viewing experience.
563+
564+
#### Post-mortem debugging
565+
566+
VectorCode can work with [coredumpy](https://github.com/gaogaotiantian/coredumpy)
567+
to snapshot an exception so that developers can inspect the error
568+
asynchronously. To use this, you'd need to install the `vectorcode[debug]`
569+
dependency group: `uv tool install vectorcode[debug]`.
570+
554571
## Shell Completion
555572

556573
VectorCode supports shell completion for bash/zsh/tcsh. You can use `vectorcode -s {bash,zsh,tcsh}`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ dev = [
7171
"pytest-asyncio>=0.25.3",
7272
"debugpy>=1.8.12",
7373
"basedpyright>=1.29.2",
74-
"coredumpy>=0.4.1",
7574
]
7675

7776
[project.optional-dependencies]
7877
legacy = ["numpy<2.0.0", "torch==2.2.2", "transformers<=4.49.0"]
7978
intel = ['optimum[openvino]', 'openvino']
8079
lsp = ['pygls<2.0.0', 'lsprotocol']
8180
mcp = ['mcp<2.0.0', 'pydantic']
81+
debug = ["coredumpy>=0.4.1"]
8282

8383
[tool.basedpyright]
8484
typeCheckingMode = "standard"

0 commit comments

Comments
 (0)