multitool


Namemultitool JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/mdelotavo/multitool
SummaryGeneral-purpose command-line interface with plugins support
upload_time2023-06-23 10:45:03
maintainer
docs_urlNone
authorMatthew Delotavo
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            multitool
=========

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

--------------------
Why does this exist?
--------------------

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

The plugins manager uses ``git`` to manage plugins installed from remote ``git`` repositories.

-----
Usage
-----

.. code-block:: text

    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.

.. ..
    The plugins features are based off those found in the `apigeecli`_.

----------------
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 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)

.. ..
    ----------------------------
    Create a virtual environment
    ----------------------------

    .. code-block:: text

        pip3 install virtualenv
        virtualenv venv
        source venv/bin/activate

        pip3 install -e .
        python3 -m multitool -V
        python3 -m multitool -h   # or just `multitool -h`

        pip3 install -r requirements.txt
        ./runtests.sh

        deactivate

.. _`click`: https://click.palletsprojects.com/
.. _`apigeecli`: https://pypi.org/project/apigeecli/
.. _`multitool-plugins`: https://github.com/mdelotavo/multitool-plugins
.. _`public plugins repository`: https://github.com/mdelotavo/multitool-plugins

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mdelotavo/multitool",
    "name": "multitool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Matthew Delotavo",
    "author_email": "matthew.t.delotavo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/46/709fd166b9634e91ab3c50e5336ba0d8e5629c09249bf68d64db277a3f44/multitool-0.4.0.tar.gz",
    "platform": null,
    "description": "multitool\n=========\n\nMultitool is a general-purpose command-line interface with plugins support.\n\n--------------------\nWhy does this exist?\n--------------------\n\nI built this tool so that I can quickly create and distribute command-line tools for consulting work and personal use.\n\nThe plugins manager uses ``git`` to manage plugins installed from remote ``git`` repositories.\n\n-----\nUsage\n-----\n\n.. code-block:: text\n\n    Usage: multitool [OPTIONS] COMMAND [ARGS]...\n\n      Welcome to the Multitool command-line interface!\n\n      PyPI:   https://pypi.org/project/multitool/\n      GitHub: https://github.com/mdelotavo/multitool\n\n    Options:\n      -V, --version  Show the version and exit.\n      -h, --help     Show this message and exit.\n\n    Commands:\n      plugins  Simple plugins manager for distributing commands.\n\n.. ..\n    The plugins features are based off those found in the `apigeecli`_.\n\n----------------\nManaging plugins\n----------------\n\nThe 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.\n\nIf ``git`` is unavailable on your machine, then the ``plugins`` commands will be unavailable.\n\nHowever, it is possible to manually install plugins by dragging them under its own directory: ``~/.multitool/plugins/PLUGIN_NAME/``.\n\nThe 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.\n\nCurrently, only the commands shown below are supported. More commands will be added to improve automation and user experience.\n\nThe steps below show how to install commands from a `public plugins repository`_.\n\n^^^^^^^^^^^\nConfiguring\n^^^^^^^^^^^\n\nTo configure remote sources for installing plugins, run::\n\n    multitool plugins configure -a\n\nThis will open a text editor so that you can specify the remote sources.\n\nIf you don't want changes to be automatically applied, then you can drop the ``-a`` option.\n\nWhen the editor opens, copy and paste the following example configuration::\n\n    [sources]\n    public = https://github.com/mdelotavo/multitool-plugins.git\n\nAfter saving the changes, the CLI will attempt to install the plugins from the specified Git URI.\nHere we use the HTTPS URI but you can also use SSH if you have configured it.\n\nYou can also specify multiple sources, as long as the key (``public`` in this case) is unique.\nThe key will be the name of the repository on your local machine under ``~/.multitool/plugins/``.\n\nIf installation is successful, you should now see additional commands when you run ``multitool -h``\n\n^^^^^^^^^^\nQuickstart\n^^^^^^^^^^\n\nYou can run the following commands to install the example plugins::\n\n    echo -e '[sources]\\npublic = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config\n    multitool plugins update\n    multitool plugins show\n    multitool plugins show -n public\n    multitool plugins show -n public --show-commit-only\n    multitool plugins show -n public --show-dependencies-only\n    pip3 install $(multitool plugins show -n public --show-dependencies-only)\n    multitool examples -h\n\n^^^^^^^^\nUpdating\n^^^^^^^^\n\nIf you specified the ``-a`` option when running ``multitool plugins configure`` then install will occur automatically.\nOtherwise you can run::\n\n     multitool plugins update\n\nThis will install and update plugins.\n\n^^^^^^^\nPruning\n^^^^^^^\n\nIf you specified the ``-a`` option when running ``multitool plugins configure`` then the removal of plugins will occur automatically.\nOtherwise you can run::\n\n     multitool plugins prune\n\n^^^^^^^\nShowing\n^^^^^^^\n\nTo show the plugins you have configured, run::\n\n     multitool plugins show\n\nYou can also run the following commands if you specify the plugin name::\n\n    multitool plugins show -n PLUGIN_NAME --show-commit-only\n    multitool plugins show -n PLUGIN_NAME --show-dependencies-only\n\nSome plugins will not load if dependencies are not installed. You can run the following command to install them.\nIn order for this to work, the plugin needs to have the ``Requires`` key in the JSON body of the ``multitool-info.json`` file.\n::\n\n    pip3 install $(multitool plugins show -n PLUGIN_NAME --show-dependencies-only)\n\n.. ..\n    ----------------------------\n    Create a virtual environment\n    ----------------------------\n\n    .. code-block:: text\n\n        pip3 install virtualenv\n        virtualenv venv\n        source venv/bin/activate\n\n        pip3 install -e .\n        python3 -m multitool -V\n        python3 -m multitool -h   # or just `multitool -h`\n\n        pip3 install -r requirements.txt\n        ./runtests.sh\n\n        deactivate\n\n.. _`click`: https://click.palletsprojects.com/\n.. _`apigeecli`: https://pypi.org/project/apigeecli/\n.. _`multitool-plugins`: https://github.com/mdelotavo/multitool-plugins\n.. _`public plugins repository`: https://github.com/mdelotavo/multitool-plugins\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "General-purpose command-line interface with plugins support",
    "version": "0.4.0",
    "project_urls": {
        "Homepage": "https://github.com/mdelotavo/multitool"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "405227a42c58d94dcbf4c497f90246ab70fc5735363c159d6b460fa0cefc8a29",
                "md5": "c22f1c87a34eab80797d9db91d705ae2",
                "sha256": "a88deda558c069da190da66d9924f7cfb9ea2f4062ceaa05c98229840890e633"
            },
            "downloads": -1,
            "filename": "multitool-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c22f1c87a34eab80797d9db91d705ae2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11752,
            "upload_time": "2023-06-23T10:45:01",
            "upload_time_iso_8601": "2023-06-23T10:45:01.807483Z",
            "url": "https://files.pythonhosted.org/packages/40/52/27a42c58d94dcbf4c497f90246ab70fc5735363c159d6b460fa0cefc8a29/multitool-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c746709fd166b9634e91ab3c50e5336ba0d8e5629c09249bf68d64db277a3f44",
                "md5": "658b895ef88e45510b4cbce5dd0ba4a9",
                "sha256": "1d571be400c5be308b7deeb0519ae85a3638f774c2545caaf5758f895ea877f1"
            },
            "downloads": -1,
            "filename": "multitool-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "658b895ef88e45510b4cbce5dd0ba4a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10923,
            "upload_time": "2023-06-23T10:45:03",
            "upload_time_iso_8601": "2023-06-23T10:45:03.529903Z",
            "url": "https://files.pythonhosted.org/packages/c7/46/709fd166b9634e91ab3c50e5336ba0d8e5629c09249bf68d64db277a3f44/multitool-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-23 10:45:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mdelotavo",
    "github_project": "multitool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "multitool"
}
        
Elapsed time: 0.22850s