Skip to main content

A command line tool to store CLI commands for quick access and usage.

Project description

command-storage [WIP]

About

cmds is a command-line tool designed to store CLI commands for quick access and usage. Think of it as a simple notes app specifically tailored for storing commands using customizable keys.

Oftentimes, we find ourselves needing to store certain commands for later use. These may be commands that are not easily remembered or ones that we find useful but don't want to keep looking up. Traditionally, we might store these commands in a file and then copy and paste them into the terminal when needed. Recognizing the need for a more efficient solution, I decided to create a CLI application to streamline this process.

Features

  • Store CLI commands with custom keys for easy retrieval.
  • Quickly access stored commands with fuzzy search without the need to search through files.
  • Organize commands based on your workflow or preferences.
  • Export all commands into a JSON file.

Installation

  • Using pip: pip install command-storage

Examples

Seeking help.

cmds --help

alt text

Storing some commands into the cmds.

cmds store --key "count no of files" --command "ls | wc -l" --description "count no of files in a directory"
cmds store --key "run python test with cov" --command "pytest --cov --cov-report term --cov-report xml:coverage.xml" --description "pytest with cov"

Viewing all commands stored in cmds.

cmds list

alt text

Usage

cmds [OPTIONS] COMMAND [ARGS]...

Options:

  • -v, --version: Show cmds version.
  • --help: Show this message and exit.

Commands:

  • delete: Allows deletion of stored command by key
  • export: Exports all stored commands into a JSON file.
  • init: Initialize the application.
  • list: Show list of all stored commands.
  • store: Store a new command into cmds.
  • update: Allows updating a stored command by its key.

cmds delete

Allows deletion of stored command by key

Usage:

cmds delete [OPTIONS] [KEY]

Arguments:

  • [KEY]

Options:

  • -a, --all: Delete all commands
  • --help: Show this message and exit.

cmds export

Exports all stored commands into a JSON file.

Usage:

cmds export [OPTIONS]

Options:

  • -f, --file TEXT: Export file address with extension [default: command_storage_export_2024-02-28 19:37:47.575256.json]
  • --help: Show this message and exit.

cmds init

Initialize the application. One time process and overwrites existing config and data files.

Args: db_path (str, optional): --db-path argument. Defaults to_INITIAL_DB_PATH.

Raises: typer.Exit: If error in app initialization typer.Exit: if error in database file initialization

Usage:

cmds init [OPTIONS]

Options:

  • -db, --db-path TEXT: [default: /Users/ashutosh/.ashutosh_cmds.json]
  • --help: Show this message and exit.

cmds list

Show list of all stored commands. Also supports fuzzy matching on key. Run 'cmds list --help' to see how.

Usage:

cmds list [OPTIONS]

Options:

  • -k, --key TEXT: Key for the command.
  • --help: Show this message and exit.

cmds store

Store a new command into cmds by giving a helpful key name to refer to.

Usage:

cmds store [OPTIONS]

Options:

  • -k, --key TEXT: Key for the command. [required]
  • -c, --command TEXT: Command to be stored. [required]
  • -des, --description TEXT: Description of command to be stored.
  • --help: Show this message and exit.

cmds update

Allows updating a stored command by its key. Also supports changing the key.

Usage:

cmds update [OPTIONS] ORIG_KEY

Arguments:

  • ORIG_KEY: [required]

Options:

  • -k, --key TEXT: Key for the command.
  • -c, --command TEXT: Command to be stored.
  • -des, --description TEXT: Description of command to be stored.
  • --help: Show this message and exit.

Credits

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_storage-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

command_storage-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file command_storage-0.1.0.tar.gz.

File metadata

  • Download URL: command_storage-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.11.3 Darwin/23.3.0

File hashes

Hashes for command_storage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 34bf37f2b4149e01cb699c0466ce18e6ae9537c9358896d9f4d330426f5a102c
MD5 c3d736c869e64a87f25c97615f8b3bcc
BLAKE2b-256 4ad3b873221bbaf8056a72b7bed72ce8d3f5adbfff2f6a853f142df223ad70a4

See more details on using hashes here.

File details

Details for the file command_storage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: command_storage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.11.3 Darwin/23.3.0

File hashes

Hashes for command_storage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1b436d09e5129d61d2fc38093ac82b99d303a456ae7d9406516d08d6737d459
MD5 c58324a10f6135b7103b7435c601afe8
BLAKE2b-256 26bb0df3c562f02eeaf6b0c85aae37a97931f75756aec9c7e89ce650e1b2381b

See more details on using hashes here.

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