The CLI Tools category page had no intro, showing only the table with a generic meta description. Co-Authored-By: Claude <noreply@anthropic.com>
3.6 KiB
Swap cURL for HTTPie, and your database's own client for a Python CLI tool with autocompletion: pgcli, mycli, litecli, or IRedis.
How to choose:
- Calling HTTP APIs from the terminal: HTTPie
- A database shell with autocompletion: pgcli for PostgreSQL, mycli for MySQL, litecli for SQLite, IRedis for Redis
- Downloading video or audio from YouTube and other sites: yt-dlp
- A new project from a template: Cookiecutter, or Copier to pull in later template changes
- A shell you script in Python: xonsh
- A tmux session with its windows and panes, from one YAML file: tmuxp
HTTPie is a command-line HTTP client for testing, debugging, and generally interacting with APIs and HTTP servers. It formats and colors the output. A request reads like http PUT pie.dev/put X-API-Token:123 name=John: Header:Value items set headers, and field=value items fill the body, which HTTPie sends as JSON by default.
pgcli, mycli, litecli, and IRedis are terminal clients with autocompletion and syntax highlighting, one per database. Give pgcli a database name or a postgresql:// URI, and litecli the path to a SQLite file. mycli also works with MariaDB, Percona, TiDB, and Apache Doris. IRedis behaves like Redis's own client in most cases, but it's safer on production servers: it stops you from accidentally running dangerous commands like KEYS *.
yt-dlp downloads audio and video from thousands of sites. Install ffmpeg too: yt-dlp needs it to merge separate video and audio files.
Cookiecutter creates projects from templates, and its templates work for any language, not only Python. Run cookiecutter gh:audreyfeldroy/cookiecutter-pypackage, answer its prompts, and you get a new project from that GitHub template.
Copier also generates projects from templates, but it calls itself a code lifecycle management tool. When the template changes, copier update brings the changes into projects you already generated. It works best when both are in Git: the template tagged, your project clean, with the .copier-answers.yml file that records your answers. Templates can run code: Cookiecutter's pre- and post-generate scripts, Copier's tasks. Generate projects only from templates you trust.
xonsh is a shell whose language is a superset of Python, with shell commands built in. It isn't POSIX-compatible, so don't make it your login shell with chsh. Its docs recommend a xonsh profile in your terminal emulator instead.
tmuxp launches a whole tmux session from one YAML or JSON file: its windows, its panes, and the commands in them. Save the file as .tmuxp.yaml in a project, and tmuxp load path/to/project/ builds the session.
Several of these tools' docs have you install them as CLI tools, and add them to a project only to use them from Python. Looking for a library to build your own Python CLI tool? That's CLI Development.