DEV Community

Suifeng023
Suifeng023

Posted on

10 CLI Tools Every Python Developer Should Know in 2025

10 CLI Tools Every Python Developer Should Know in 2025

As a Python developer, your terminal is your best friend. While pip and python get you far, the right CLI tools can supercharge your workflow. Here are 10 command-line tools that will make you significantly more productive.


1. ๐Ÿ uv โ€” The Future of Python Package Management

uv by Astral (the Ruff team) is a blazing-fast Python package installer and resolver, written in Rust. It's a drop-in replacement for pip and pip-tools that's 10-100x faster.

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create a project with virtualenv
uv init my-project
uv add requests pandas

# Run a script with auto-managed deps
uv run script.py
Enter fullscreen mode Exit fullscreen mode

Why it matters: It replaces pip, virtualenv, pip-tools, and poetry with a single, faster tool.


2. ๐Ÿฆ€ ruff โ€” Instant Python Linting & Formatting

Ruff is another Rust-powered tool that replaces Flake8, isort, Black, and more โ€” running in milliseconds instead of seconds.

pip install ruff

# Lint
ruff check .

# Format (replaces Black)
ruff format .

# Fix auto-fixable issues
ruff check --fix .
Enter fullscreen mode Exit fullscreen mode

Why it matters: One tool replaces 6+ linters and formatters. Your CI pipeline will thank you.


3. ๐Ÿ“ฆ pipdeptree โ€” Visualize Your Dependency Tree

Ever wondered why a package pulled in 50 transitive dependencies?

pip install pipdeptree
pipdeptree --packages requests
Enter fullscreen mode Exit fullscreen mode

This shows you exactly which packages depend on what, making it easy to spot conflicts and bloat.


4. ๐Ÿงช pytest โ€” Testing Made Painless

Yes, pytest is the standard, but many devs still don't use it to its full potential:

pip install pytest pytest-cov pytest-xdist

# Run with coverage
pytest --cov=myapp tests/

# Parallel execution (massive speedup!)
pytest -n auto

# Only run failed tests from last run
pytest --lf
Enter fullscreen mode Exit fullscreen mode

Pro tip: Use pytest-watch for automatic re-running during development.


5. ๐Ÿ”„ watchfiles / watchdog โ€” Auto-Run on File Changes

Stop manually restarting your server every time you save:

pip install watchfiles

# Run tests on every change
watchfiles "pytest" .
Enter fullscreen mode Exit fullscreen mode

Or use watchdog for more complex triggers and shell commands.


6. ๐Ÿ˜ pgcli โ€” A Better PostgreSQL Client

If you use PostgreSQL, pgcli gives you auto-completion and syntax highlighting:

pip install pgcli
pgcli my_database
Enter fullscreen mode Exit fullscreen mode

It auto-completes tables, columns, and even SQL keywords. Your psql days are over.

There are similar tools: mycli for MySQL, litecli for SQLite, and mssql-cli for SQL Server.


7. ๐Ÿ“Š rich โ€” Beautiful Terminal Output

Rich makes your CLI scripts look amazing:

from rich.console import Console
from rich.table import Table
from rich.progress import track

console = Console()

# Beautiful tables
table = Table(title="API Response Times")
table.add_column("Endpoint", style="cyan")
table.add_column("Avg (ms)", style="green")
table.add_row("/api/users", "23")
table.add_row("/api/orders", "156")
console.print(table)

# Progress bars
for task in track(tasks, description="Processing..."):
    process(task)
Enter fullscreen mode Exit fullscreen mode

8. ๐Ÿ“ก httpie โ€” cURL, But Human-Friendly

HTTPie makes API testing feel natural:

# POST with JSON body
http POST api.example.com/data name="Alice" role=admin

# Custom headers and auth
http GET api.example.com/me Authorization:"Bearer TOKEN"

# Download and format JSON response
http GET api.example.com/users --print=b | jq .
Enter fullscreen mode Exit fullscreen mode

The newer httpie has a terminal UI mode (http --offline) that's even more powerful.


9. ๐Ÿ” ripgrep (rg) โ€” Search Code at Lightning Speed

Not Python-specific, but essential for any developer:

# Find all TODOs in your project
rg "TODO" --type py

# Search with context lines
rg "class User" -C 3

# Exclude directories
rg "import" -g '!venv/**' -g '!__pycache__/**'
Enter fullscreen mode Exit fullscreen mode

It's so fast you'll never use grep -r again.


10. ๐Ÿš€ nox โ€” Automated Session Management

Nox lets you define multiple Python environments for testing, linting, and building:

import nox

@nox.session(python=["3.10", "3.11", "3.12"])
def tests(session):
    session.install(".[test]")
    session.run("pytest")

@nox.session
def lint(session):
    session.install("ruff")
    session.run("ruff", "check", ".")
Enter fullscreen mode Exit fullscreen mode

Run nox and it'll test your project across all Python versions automatically.


Bonus: ipython + pdb++

pip install ipython pdbpp
Enter fullscreen mode Exit fullscreen mode

Drop import ipdb; ipdb.set_trace() anywhere in your code for a dramatically better debugging experience compared to the built-in pdb.


Summary Table

Tool Replaces Speed Up
uv pip, venv, poetry 10-100x
ruff flake8, black, isort 10-100x
pipdeptree manual digging -
pytest -n unittest, nosetests 4-8x
watchfiles manual restarts -
pgcli psql -
rich print() UX boost
httpie curl -
ripgrep grep -r 5-10x
nox tox, make -

Conclusion

The Python ecosystem's CLI tools have gotten dramatically better in the last few years, largely thanks to Rust-powered tools like uv and ruff. If you're still using pip alone and flake8 with 20 plugins, it's time to upgrade.

Start with uv and ruff โ€” they'll have the biggest immediate impact on your daily workflow.

What CLI tools do you use every day? Share in the comments!

Top comments (0)