Skip to main content

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 myprojmyproj: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

sampler_cli-0.2.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sampler_cli-0.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

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

Hashes for sampler_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e3bfbfedefbd01f43ba341dbc435f259ff581af86f100c980ae5c8887e327cc4
MD5 5a17cda2abc53deff8d2f7a6ad2de7b2
BLAKE2b-256 7e1421b617e5f3501652bce018349a9d5ea7da053eaa6b1e88d903981391e40e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sampler_cli-0.2.0.tar.gz:

Publisher: publish.yml on SamuelCarmona83/sampler-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for sampler_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 548bfa91fc4c9ecf20935914b39f6121b038a031c7dea0c269d4332e21b8c7bc
MD5 5eac9347c9b40dbecd6972b07e70af62
BLAKE2b-256 309db225b80d5cbe008d3ed7885cfe706197655a3e565057794645de9dd43da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sampler_cli-0.2.0-py3-none-any.whl:

Publisher: publish.yml on SamuelCarmona83/sampler-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page