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 --install-completion # Install shell completion

Command format

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

[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.0.0.tar.gz (11.1 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.0.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: command_book-8.0.0.tar.gz
  • Upload date:
  • Size: 11.1 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.0.0.tar.gz
Algorithm Hash digest
SHA256 f23878a4b371861491b434bada06c19b7155b6c4eb72df4174921482061e6415
MD5 eb469213176b15950b01c4899546ab20
BLAKE2b-256 7ca98d2e37c8c89d39d4c56f41dae6157ff9d141d958f5ec290d0aa546c52b18

See more details on using hashes here.

Provenance

The following attestation bundles were made for command_book-8.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: command_book-8.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bd26fb1f727b6317d4172a95edcb9077c4298e0d1696c73166fd5bda9d754d5
MD5 26d24b554297f5f450cee17b8316fa2d
BLAKE2b-256 09f81d4715ba4730f673d1f05fd28ede1490b1db68ff34690a251141cf6071fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for command_book-8.0.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