Skip to main content

A helper for remembering useful shell commands.

Project description

xxcmd

Python Build

xx is a Linux shell command. xx remembers other shell commands, so you don't have to.

Installation

Requires Python 3. Installation is simple using pip.

On Ubuntu:

sudo pip3 install xxcmd

On Arch:

sudo pip install xxcmd

Or remove sudo if you want to install just for the current user and you have pip's local bin on your PATH.

Basic Usage Examples

Using xx is pretty simple. You build up a database of useful commands, and search and execute them whenever you like.

Adding Commands

Commands are added to the database with:

xx -a [label] <command>

Add a very simple command top. Not very useful as the command is already short and easy to remember.

xx -a top

Add the du command to display size of all files and directories in the current directory.

xx -a du --max-depth=1 -h .

Add the same command but with a friendly (searchable) label:

xx -a [File Size] du --max-depth=1 -h .

Adding our favourite ssh command:

xx -a [SSH Best Host] ssh -i ~/.ssh/mykey.pem me@myhost.com

Browse and Search Commands Interactively

Run xx with no options to enter the interactive UI.

xx

Fast search and execute

xx can search for matching commands and if only one match is found it will be immediately executed. To run the command we just added we could search for "du":

xx du

Or to run it by searching for a partial match of the label we added:

xx size

We could immediately ssh connect with:

xx best

Interactive UI

Invoking xx without options will open the interactive UI. Presenting a list of all commands with an interactive search.

Keys:

  • UP/DOWN arrow keys - navigate the list of commands.
  • DELETE - remove the currently selected command
  • RETURN - execute the currently selected command
  • ESCAPE - exit
  • F1 or CTRL+E - Edit the label of the currently selected item
  • Any other key press is added to the interactive search to filter the command list.

Further Usage

usage: xx [-h] [-a ...] [-i URL] [-l] [-t] [-v] [cmd]

positional arguments:
  cmd                   Search for a matching command
                        and run it immediately.

optional arguments:
  -h, --help            show this help message and exit
  -a ..., --add ...     Add the given command to the
                        database. Command may begin
                        with a label enclosed in square
                        brackets [label] <cmd>
  -i URL, --import-url URL
                        Import a command database from
                        the given URL. Merge into existing
                        database.
  -l, --list            Print all commands in the database
  -n, --no-echo         Don't echo the command to the terminal
                        prior to execution.
  -t, --no-labels       Don't display command labels.
  -v, --version         Display program version.

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

xxcmd-0.4.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

xxcmd-0.4.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file xxcmd-0.4.0.tar.gz.

File metadata

  • Download URL: xxcmd-0.4.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for xxcmd-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a75b250d83e64779e9118bc7fa426576264a0bec08712fa0512ae5e680e444a1
MD5 3dc2cf33c74f214eb75324d8f452cb2a
BLAKE2b-256 7595c6906f39f0cbfa4df9e822b677dd3bac61894e169081b2aed95b66823732

See more details on using hashes here.

File details

Details for the file xxcmd-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: xxcmd-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for xxcmd-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53af24cfee2e2c56b78e6ed0fb80bf573919245149271e79e59f57a4ad57454e
MD5 920212f3766302ea3f0424192d5bbf9e
BLAKE2b-256 39b2337e70061e7ab2e211b890e46c326377b57e6d4638f0304ed673ec7f41fb

See more details on using hashes here.

Supported by

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