Symbol lookup / search engine CLI
Project description
Pluk
Git-commit–aware symbol lookup & impact analysis engine
What is a "symbol"?
In Pluk, a symbol is any named entity in your codebase that can be referenced, defined, or impacted by changes. This includes functions, classes, methods, variables, and other identifiers that appear in your source code. Pluk tracks symbols across commits and repositories to enable powerful queries like "go to definition", "find all references", and "impact analysis".
Pluk gives developers “go-to-definition”, “find-all-references”, and “blast-radius” impact queries across one or more Git repositories. Heavy lifting (indexing, querying, storage) runs in Docker containers; a lightweight host shim (pluk) boots the stack and delegates commands into a thin CLI container (plukd) that talks to an internal API.
Key Features
- Symbol search (
pluk search) and definition lookup (pluk define) - Impact analysis (
pluk impact) to trace downstream dependents - Commit-aware indexing (
pluk diff) across Git history - Containerized backend: PostgreSQL (graph) + Redis (broker/cache)
- Strict lifecycle:
pluk startis required before any commands - Host controls:
pluk statusto check,pluk cleanupto stop services
Quickstart
- Install
pip install pluk
- Start services (required)
pluk start
This creates/updates ~/.pluk/docker-compose.yml, pulls latest images, and brings up: postgres, redis, api (FastAPI), worker (Celery), and cli (idle exec target). The API stays internal to the Docker network.
- Index and query
pluk init /path/to/repo # queue full index (API→Redis→Celery→Postgres)
pluk search MyClass # fuzzy lookup; defs + refs (API→Postgres, cached)
pluk define my_function # show definition (file:line@commit)
pluk impact computeFoo # transitive dependents (blast radius; cached)
pluk diff symbol abc123 def456 # symbol changes between commits abc123 → def456
Note: CLI commands that poll for job status (like pluk init) now display real-time output, thanks to unbuffered Python output in the CLI container.
- Check / stop (host-side)
pluk status # tells you if services are running
pluk cleanup # stops services (containers stay; fast restart)
If you want a full teardown (remove containers/network), use:
docker compose -f ~/.pluk/docker-compose.yml down
Data Flow
How it works
- Host shim (
pluk) writes the Compose file, pulls images, and runsdocker compose up. - CLI container (
plukd) is the exec target; it calls the API athttp://api:8000. - API (FastAPI) serves read endpoints (
/search,/define,/impact,/diff) and enqueues write jobs (/reindex) to Redis. - Worker (Celery) consumes jobs from Redis, clones/pulls repos into a volume (
/var/pluk/repos), parses deltas, and writes to Postgres. - Reads never block on indexing; write progress can be polled via job status endpoints (planned).
Architecture (current)
- Single image, multiple roles: Compose selects per-service
commandapi→uvicorn pluk.api:app --host 0.0.0.0 --port 8000worker→celery -A pluk.worker worker -l infocli→sleep infinity(keeps container up fordocker compose exec)
- Internal networking: API is not exposed to the host; CLI calls it over Docker DNS (
PLUK_API_URL=http://api:8000). - Config:
PLUK_DATABASE_URL,PLUK_REDIS_URLinjected via Compose; worker usesPLUK_REPOS_DIR=/var/pluk/repos. - Images: by default the shim uses
jorstors/pluk:latest,postgres:16-alpine, andredis-alpine
Development
- Project layout (
src/pluk):shim.py— host shim entrypoint (pluk)cli.py— container CLI (plukd)api.py— FastAPI app (internal API)worker.py— Celery app & tasks
- Entry points (
pyproject.toml):
[project.scripts]
pluk = "pluk.shim:main"
plukd = "pluk.cli:main"
Testing
pytest
Docker must be running; services must be started via pluk start for integration tests.
License
MIT License
Project details
Release history Release notifications | RSS feed
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 pluk-0.3.10.tar.gz.
File metadata
- Download URL: pluk-0.3.10.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b538b09b2e2fe82005e3f242cdb07c1812c4f00ada720ad2823357a3d2a8fd4
|
|
| MD5 |
300a0c236b1d2a55db1b8adb094427b6
|
|
| BLAKE2b-256 |
00843a10b5ded4d499bc169de884590238b5555de79cad71791b3ab30d0ccff7
|
File details
Details for the file pluk-0.3.10-py3-none-any.whl.
File metadata
- Download URL: pluk-0.3.10-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6afbe38f7340290cab30429ac34bc31d5b4bf9a26103151301eb9699e5f7fb5a
|
|
| MD5 |
80c43482c90847407b07776ba83278bc
|
|
| BLAKE2b-256 |
2815021bf63bae5958b990da24ff4256f95048e1511e28595a1cefc4ca39d0eb
|