Skip to main content

General-purpose command-line interface with plugins support

Project description

Multitool is a general-purpose command-line interface with plugins support.

Why does this exist?

I built this tool so I can quickly create and distribute command-line tools for consulting work and personal use.

Usage

Usage: multitool [OPTIONS] COMMAND [ARGS]...

  Welcome to the Multitool command-line interface!

  PyPI:   https://pypi.org/project/multitool/
  GitHub: https://github.com/mdelotavo/multitool

Options:
  -V, --version  Show the version and exit.
  -h, --help     Show this message and exit.

Commands:
  plugins  Simple plugins manager for distributing commands.

Managing plugins

The simple plugins manager uses git to install commands from remote sources, thus you will need to have git installed for the installation of plugins to work.

If git is unavailable on your machine, then the plugins commands will be unavailable.

However, it is possible to manually install plugins by dragging them under its own directory: ~/.multitool/plugins/PLUGIN_NAME/.

The tool revolves around the use of the click package to create command plugins which can be dynamically loaded into the multitool command-line at runtime.

Currently, only the commands shown below are supported. More commands will be added to improve automation and user experience.

The steps below show how to install commands from a public plugins repository.

Configuring

To configure remote sources for installing plugins, run:

multitool plugins configure -a

This will open a text editor so that you can specify the remote sources.

If you don’t want changes to be automatically applied, then you can drop the -a option.

When the editor opens, copy and paste the following example configuration:

[sources]
public = https://github.com/mdelotavo/multitool-plugins.git

After saving the changes, the CLI will attempt to install the plugins from the specified Git URI. Here we use the HTTPS URI but you can also use SSH if you have configured it.

You can also specify multiple sources, as long as the key (public in this case) is unique. The key will be the name of the repository on your local machine under ~/.multitool/plugins/.

If installation is successful, you should now see additional commands when you run multitool -h

Quickstart

You can run the following commands to install the example plugins:

echo -e '[sources]\npublic = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
multitool plugins update
multitool plugins show
multitool plugins show -n public
multitool plugins show -n public --show-commit-only
multitool plugins show -n public --show-dependencies-only
pip3 install $(multitool plugins show -n public --show-dependencies-only)
multitool examples -h

Updating

If you specified the -a option when running multitool plugins configure then install will occur automatically. Otherwise you can run:

multitool plugins update

This will install and update plugins.

Pruning

If you remove plugins from the config file or comment them out, and you then specified the -a option when running multitool plugins configure then the removal of plugins will occur automatically. Otherwise you can run:

multitool plugins prune

Showing

To show the plugins you have configured, run:

multitool plugins show

You can also run the following commands if you specify the plugin name:

multitool plugins show -n PLUGIN_NAME --show-commit-only
multitool plugins show -n PLUGIN_NAME --show-dependencies-only

Some plugins will not load if dependencies are not installed. You can run the following command to install them. In order for this to work, the plugin needs to have the Requires key in the JSON body of the multitool-info.json file.

pip3 install $(multitool plugins show -n PLUGIN_NAME --show-dependencies-only)

Troubleshooting

If you encounter issues with plugins or commands, you can find more detailed debug information and error messages in the log file:

~/.multitool/multitool.log

Reviewing this file can help you diagnose installation problems, missing dependencies, or Git-related errors.

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

multitool-0.5.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

multitool-0.5.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file multitool-0.5.0.tar.gz.

File metadata

  • Download URL: multitool-0.5.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for multitool-0.5.0.tar.gz
Algorithm Hash digest
SHA256 811fcad28cdaa631a6569aa20de3c89d3642095cf88ca807a90c1236a32bb495
MD5 aaf63a2e46ce582fdc9b5faeefa1ef8f
BLAKE2b-256 41b3237fe37a671c8b850cab895083001c90c73b7552921a2a7c70573a63b7fd

See more details on using hashes here.

File details

Details for the file multitool-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: multitool-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for multitool-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28a55da210b06fa4c18aa404cd67781abdd62106aa77cdcf382fcb978928e865
MD5 98cc7f1db45eba7556b477a757858cd6
BLAKE2b-256 5cc913ffbe65ae848b12f3eb3b646db52bfb1c999836cc60a206c80a87e2e21e

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