Token-efficient CLI for indexing and searching code symbols (Python-first, designed for minimal LLM/agent context size)
Project description
Sampler
CLI indexer para navegar símbolos y relaciones en codebases multiproyecto.
Versión actual: 0.1.2
Requisitos
- Python 3.11+
uv(recomendado)- Go (instalado para soporte parser Fase 1)
Instalación de Go (macOS)
brew install go
go version
Instalación
pip install sampler-cli
Para desarrollo (incluye tests, linters):
pip install -e '.[dev]'
Uso rápido
pip install sampler-cli
sampler init
sampler project add myproj /absolute/path --language python
sampler project list
sampler index myproj
sampler search add --project myproj
sampler overview /absolute/path/file.py
Demo / LLM use (token-efficient by design):
- Default outputs are compact single-line (no tables, short paths, no noise).
- Ideal for pasting into agents/LLMs with minimal context size.
- Example:
sampler search worker --project myproj→myproj:src/tasks.py:42 function process def process()
Estado actual
Implementado:
- Bootstrap inicial de Fase 0
- Configuración global con archivo
~/.sampler/config.yaml - CRUD de proyectos en config (
add,list,remove) - Esquema SQLite core + queries de index/search en
src/sampler/db.py - Discovery de archivos por lenguaje con soporte
.gitignore - Parser Python estable basado en AST
- Indexer real (hash incremental + persistencia)
- Query engine real (
search,overview) - CI básico con GitHub Actions (
pytest -q) - Tests: smoke, config, db, cli, discovery, python_parser, index_query
Nota de estabilidad:
- Se desactivó uso runtime de tree-sitter en parser Python por crash nativo (
BUS/SEGV) en indexación real. - Se mantiene estrategia AST para estabilidad en producción local.
Pendiente inmediato:
- Filtros y paginación en búsqueda
- Comandos
callers,usages,related - Parsers Go y TypeScript/JavaScript
Estructura clave
src/sampler/cli/main.py # comandos CLI
src/sampler/config.py # config global YAML
src/sampler/db.py # capa SQLite
src/sampler/indexer/builder.py # indexación de proyectos
src/sampler/indexer/store.py # persistencia de símbolos/relaciones
src/sampler/indexer/parsers/python.py # parser python estable
src/sampler/query/engine.py # search/overview
src/sampler/indexer/discover.py # discovery y filtros
tests/ # pruebas base
Ejecutar pruebas
pytest -q
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sampler_cli-0.2.0.tar.gz.
File metadata
- Download URL: sampler_cli-0.2.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3bfbfedefbd01f43ba341dbc435f259ff581af86f100c980ae5c8887e327cc4
|
|
| MD5 |
5a17cda2abc53deff8d2f7a6ad2de7b2
|
|
| BLAKE2b-256 |
7e1421b617e5f3501652bce018349a9d5ea7da053eaa6b1e88d903981391e40e
|
Provenance
The following attestation bundles were made for sampler_cli-0.2.0.tar.gz:
Publisher:
publish.yml on SamuelCarmona83/sampler-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sampler_cli-0.2.0.tar.gz -
Subject digest:
e3bfbfedefbd01f43ba341dbc435f259ff581af86f100c980ae5c8887e327cc4 - Sigstore transparency entry: 2037827596
- Sigstore integration time:
-
Permalink:
SamuelCarmona83/sampler-cli@0446b0ff021aa081ce4ba2521a042d3e1aa7d860 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/SamuelCarmona83
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0446b0ff021aa081ce4ba2521a042d3e1aa7d860 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sampler_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sampler_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
548bfa91fc4c9ecf20935914b39f6121b038a031c7dea0c269d4332e21b8c7bc
|
|
| MD5 |
5eac9347c9b40dbecd6972b07e70af62
|
|
| BLAKE2b-256 |
309db225b80d5cbe008d3ed7885cfe706197655a3e565057794645de9dd43da0
|
Provenance
The following attestation bundles were made for sampler_cli-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on SamuelCarmona83/sampler-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sampler_cli-0.2.0-py3-none-any.whl -
Subject digest:
548bfa91fc4c9ecf20935914b39f6121b038a031c7dea0c269d4332e21b8c7bc - Sigstore transparency entry: 2037827962
- Sigstore integration time:
-
Permalink:
SamuelCarmona83/sampler-cli@0446b0ff021aa081ce4ba2521a042d3e1aa7d860 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/SamuelCarmona83
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0446b0ff021aa081ce4ba2521a042d3e1aa7d860 -
Trigger Event:
release
-
Statement type: