Skip to main content

CLI to save and run commands with interactive parameters

Project description

Command Book (bb)

CLI to save, search and run custom commands with interactive parameters.

Installation

pip install command-book
bb --install-completion
# reload console

Usage

bb                      # Open the interactive fuzzy menu
bb add                  # Register a new command
bb list                 # List all saved commands
bb run <name>           # Run a command (prompts for parameters if needed)
bb remove <name>        # Delete a command
bb edit <name>          # Open the command in $EDITOR
bb search <term>        # Search by name, description or tag
bb tags                 # List all available tags
bb config               # Show or edit the config file
bb examples             # Show examples
bb --install-completion # Install shell completion

Demo

Command format

Commands use placeholders {{name}}, {{name::default}}, {{name_required}!},{{name_required::default}!} and more.

[commands.ssh-server]
cmd = "ssh {{user::root}}@{{host}} -p {{port::22}}"
description = "Connect to a server via SSH"
tags = ["ssh", "infra"]

Storage

Commands are saved to ~/.config/command_book/commands.toml.

Language

By default the language is detected from the LANG environment variable. Override it with CB_LANG:

CB_LANG=en bb   # English
CB_LANG=es bb   # Spanish

Development

Install

git clone https://github.com/tiyujopite/command_book
cd command-book
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Run tests

pytest --cov=command_book --cov-report=term-missing

Linting

flake8 command_book/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

command_book-8.1.0.tar.gz (289.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

command_book-8.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file command_book-8.1.0.tar.gz.

File metadata

  • Download URL: command_book-8.1.0.tar.gz
  • Upload date:
  • Size: 289.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for command_book-8.1.0.tar.gz
Algorithm Hash digest
SHA256 7cc1163233fc642f01536425c0e54321cdd50742c7b687e8517e87653edf5788
MD5 f3cd2e4e87c5e4626bf30b79363a39cb
BLAKE2b-256 a6056e32224b7e20c911d5801732987297d08366e0099a3cc80b3dc6b808767d

See more details on using hashes here.

Provenance

The following attestation bundles were made for command_book-8.1.0.tar.gz:

Publisher: python-publish.yml on tiyujopite/command_book

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file command_book-8.1.0-py3-none-any.whl.

File metadata

  • Download URL: command_book-8.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for command_book-8.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abf7bea9598964ac8ba5739fd932c3db411221eabce3739368b31f23cf03100b
MD5 d7426c50ee063d32610c13eff6b5203f
BLAKE2b-256 cb0c555395a01fcff92882692c04be14547c1b2d6b960e3b824b4aebd1e51470

See more details on using hashes here.

Provenance

The following attestation bundles were made for command_book-8.1.0-py3-none-any.whl:

Publisher: python-publish.yml on tiyujopite/command_book

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page