DEV Community

Suifeng023
Suifeng023

Posted on

10 CLI Tools Every Python Developer Should Know in 2026

Python developers spend more time in the terminal than they admit. The right CLI tools can remove minutes from every build, test run, dependency update, and debugging session. Over a year, that compounds into real productivity.

Here are ten command-line tools I would install first on a modern Python setup in 2026.

1. uv: the new default for Python packages

uv has become one of the easiest recommendations in the Python ecosystem. It is fast, written in Rust, and can replace a surprising amount of the traditional Python packaging stack.

uv init my-app
cd my-app
uv add fastapi pytest ruff
uv run pytest
Enter fullscreen mode Exit fullscreen mode

Why it matters: dependency installation is no longer the slow part of your workflow. For small projects, scripts, CI jobs, and containers, uv can dramatically reduce setup time.

2. ruff: linting and formatting in milliseconds

ruff replaces a long list of older tools: Flake8, isort, many pyupgrade rules, and even formatting workflows for many teams.

ruff check .
ruff check --fix .
ruff format .
Enter fullscreen mode Exit fullscreen mode

The biggest benefit is not just speed. It is consistency. One tool, one config, fewer arguments about style.

3. pytest: the testing CLI you should actually master

Most Python developers know pytest, but many only use the basics.

pytest -q
pytest tests/test_api.py::test_create_user
pytest --lf
pytest -n auto
Enter fullscreen mode Exit fullscreen mode

Useful flags:

  • --lf runs only tests that failed last time
  • -k "keyword" filters tests by name
  • -x stops on the first failure
  • --maxfail=3 stops after three failures

If your project feels slow, learning pytest flags is often cheaper than rewriting code.

4. rich-cli: inspect JSON, logs, and data beautifully

The rich ecosystem makes terminal output readable. rich-cli is useful when you want to quickly inspect structured files.

python -m rich file.json
python -m rich logs/app.log
Enter fullscreen mode Exit fullscreen mode

It is a small quality-of-life improvement, but it makes debugging less painful.

5. httpie: a friendlier curl

curl is universal, but httpie is often nicer for API work.

http GET :8000/health
http POST :8000/users name=Ada email=ada@example.com
Enter fullscreen mode Exit fullscreen mode

For backend development, this is one of the fastest ways to test endpoints without opening Postman.

6. pipx: install Python CLI apps safely

pipx installs Python command-line apps in isolated environments, so global dependencies do not become a mess.

pipx install poetry
pipx install black
pipx install pre-commit
Enter fullscreen mode Exit fullscreen mode

Even if you use uv for projects, pipx is still useful for standalone tools.

7. pre-commit: automate quality checks before Git commits

pre-commit runs checks before code enters your repository.

pipx install pre-commit
pre-commit install
pre-commit run --all-files
Enter fullscreen mode Exit fullscreen mode

A simple config can run ruff, formatting, YAML checks, secret scanning, and more. This prevents small issues from becoming CI failures later.

8. py-spy: profile Python without changing your code

Performance debugging is easier when you can observe a running process.

py-spy top --pid 12345
py-spy record -o profile.svg -- python app.py
Enter fullscreen mode Exit fullscreen mode

py-spy is great for answering: β€œWhere is this program actually spending time?”

9. typer: build your own CLIs quickly

typer lets you turn Python functions into polished CLIs with type hints.

import typer

app = typer.Typer()

@app.command()
def hello(name: str):
    print(f"Hello {name}")

if __name__ == "__main__":
    app()
Enter fullscreen mode Exit fullscreen mode

Run it:

python app.py hello Ada
Enter fullscreen mode Exit fullscreen mode

For internal automation scripts, this is much better than a pile of undocumented bash files.

10. direnv: automatic environment switching

direnv loads environment variables when you enter a directory and unloads them when you leave.

# .envrc
export DATABASE_URL=postgres://localhost/myapp
export DEBUG=true
Enter fullscreen mode Exit fullscreen mode

Then:

direnv allow
Enter fullscreen mode Exit fullscreen mode

This is especially useful when switching between multiple Python services.

My recommended setup

For a clean Python project in 2026, I would start with:

uv init my-app
uv add pytest ruff typer rich httpx
uv run ruff check .
uv run pytest
Enter fullscreen mode Exit fullscreen mode

Then add:

  • pre-commit for team quality gates
  • httpie for API testing
  • py-spy when performance matters
  • direnv for local environment variables

The main lesson: productivity does not come from installing every shiny tool. It comes from building a terminal workflow that removes repeated decisions.

If you only adopt three tools from this list, start with uv, ruff, and pytest. That trio alone will make most Python projects faster, cleaner, and easier to maintain.


Check out my AI Prompt Packs: https://payhip.com/b/ADsQI | https://payhip.com/b/6lqVh | https://payhip.com/b/XLNPm | https://payhip.com/b/CAN9Z

Top comments (0)