Install uv (it handles Python automatically), then:
git clone https://github.com/chainstacklabs/pumpfun-cli.git
cd pumpfun-cli
uv sync --dev
uv run pre-commit install
uv run pytest tests/ -qThis installs dependencies, sets up git hooks (ruff runs automatically on each commit), and verifies tests pass.
commands/ → core/ → protocol/
(thin) (logic) (Solana)
commands/— CLI wiring (Typer). Parses args, calls core, renders output.core/— Business logic. Takes primitives, returnsdict. No framework imports.protocol/— Solana/pump.fun primitives. PDAs, instructions, curve math. No business logic.
Rule: commands/ never imports from protocol/. Always go through core/.
uv run pytest tests/ -q # all unit tests
uv run pytest tests/test_core -v # one module
uv run pytest tests/ -k test_buy # by name
uv run pytest tests/ -v --cov # with coverageSurfpool integration tests (tests/test_surfpool/) are skipped by default. See README for setup.
Ruff handles formatting and linting:
uv run ruff format src/ tests/
uv run ruff check --fix src/ tests/CI rejects PRs that fail these checks.
Conventions:
render(data, json_mode)for output,error(msg)for failures — noprint()- I/O functions are
async def, called viaasyncio.run()in commands - Import order: stdlib → third-party → local (ruff enforces this)
- Type hints on public functions
src/pumpfun_cli/core/my_feature.py— async logic, returnsdictsrc/pumpfun_cli/commands/my_feature.py— Typer wrapper, calls core- Register in
cli.py tests/test_core/test_my_feature.py— tests with mocked RPC
Look at commands/wallet.py + core/wallet.py for a real example.
- Branch from
main - Make changes
uv run pytest tests/ -q && uv run ruff check src/ tests/- Push and open a PR
PR titles must use conventional commits:
feat: add token transfer command
fix: handle graduated token slippage
chore: update ruff to 0.16
docs: add migration guide
test: add curve math edge cases
PRs are squash-merged — the PR title becomes the commit message on main.
Changes to protocol/ (transaction construction, instructions, PDAs) — say so in the PR. Bugs there can lose funds.
Look for good first issue to get started. Issues are tagged by area: protocol, wallet, pumpswap, bonding-curve, cli, devex.