Summary
Add a command-line interface for Vectorless, implemented in Python using the existing Python SDK.
Motivation
-
Current 8 Rust examples essentially act as ad-hoc CLI scripts — a formal CLI is needed
-
pip install vectorless already installs the SDK; adding CLI costs nothing extra
-
One package name serves both: from vectorless import Engine (library) and vectorless index ... (CLI)
-
No new crate needed — avoids maintaining a separate vectorless-cli Rust crate
Commands
vectorless init EngineBuilder::new() + workspace init
vectorless add engine.index(IndexContext)
vectorless list engine.list()
vectorless info engine.info(doc_id)
vectorless remove engine.remove(doc_id)
vectorless query engine.query(QueryContext)
vectorless ask engine.query() × N (REPL loop)
vectorless tree engine.get_tree(doc_id)
vectorless stats engine.stats()
Architecture
python/vectorless/
__init__.py # existing
cli/ # new
__init__.py # CLI entry point
main.py # click/typer app + command routing
commands/
__init__.py
init.py # init
add.py # add → engine.index
list_cmd.py # list
info.py # info
remove.py # remove
query.py # query → engine.query
ask.py # interactive REPL
tree.py # tree visualization
stats.py # workspace stats
config_cmd.py # config management
output.py # output formatting (text/json/table)
workspace.py # .vectorless/ directory management
Entry point in pyproject.toml:
[project.scripts]
vectorless = "vectorless.cli.main:app"
Implementation Notes
- All engine calls are async, CLI needs
asyncio.run() wrapper
--verbose flag on query shows Agent navigation steps
--format json for script integration
ask REPL uses prompt_toolkit for history/completion
- Workspace config stored in
.vectorless/config.toml
Summary
Add a command-line interface for Vectorless, implemented in Python using the existing Python SDK.
Motivation
Current 8 Rust examples essentially act as ad-hoc CLI scripts — a formal CLI is needed
pip install vectorlessalready installs the SDK; adding CLI costs nothing extraOne package name serves both:
from vectorless import Engine(library) andvectorless index ...(CLI)No new crate needed — avoids maintaining a separate
vectorless-cliRust crateCommands
Architecture
Entry point in
pyproject.toml:Implementation Notes
asyncio.run()wrapper--verboseflag onqueryshows Agent navigation steps--format jsonfor script integrationaskREPL usesprompt_toolkitfor history/completion.vectorless/config.toml