Skip to main content

MCP Server, Typer CLI and vscode tasks in one, provides an easy way to configure your own DevTools and python scripts in a project.

Project description

Toolit

MCP Server and Typer CLI in one, provides an easy way to configure your own DevTools in a project.

Installation

To get started with Toolit, install the package via pip:

pip install toolit

If you want mcp server support, you can install the optional dependency:

pip install toolit[mcp]

Note: MCP support is not available on python 3.9, since it is not supported by the mcp package.

Usage

Add a folder called devtools to your project root. Create python modules, you decide the name, in this folder. Add the tool decorator to functions you want to expose as commands.

from toolit import tool
@tool
def my_command(to_print: str = "Hello, World!") -> None:
    """This is a command that can be run from the CLI."""
    print(to_print)

Toolit will automatically discover these modules and make them available as commands.

Now you can run your command from the command line:

toolit --help  # To see available commands
toolit my-command --to_print "Hello, Toolit!"  # To run your command

Create the VS code tasks.json file

You can automatically create a tasks.json file for Visual Studio Code to run your ToolIt commands directly from the editor. This is useful for integrating your development tools into your workflow.

To create the .vscode/tasks.json file, run the following command in your terminal:

python -m toolit.create_tasks_json

NOTE: THIS WILL OVERWRITE YOUR EXISTING .vscode/tasks.json FILE IF IT EXISTS!

Chaining Commands

You can chain multiple using the @sequential_group_of_tools and @parallel_group_of_tools decorators to create more complex workflows. Functions decorated with these decorators should always return a list of callable functions.

from toolit import tool, sequential_group_of_tools, parallel_group_of_tools
from typing import Callable

@tool
def first_command() -> None:
    print("First command executed.")

@tool
def second_command() -> None:
    print("Second command executed.")

@sequential_group_of_tools
def my_sequential_commands() -> list[Callable]:
    return [first_command, second_command]

@parallel_group_of_tools
def my_parallel_commands() -> list[Callable]:
    return [first_command, second_command]

This will create a group of commands in the tasks.json file that can be executed sequentially or in parallel.

Contributing

We welcome contributions to Toolit! If you have ideas for new features, improvements, or bug fixes, please open an issue or submit a pull request on our GitHub repository. We appreciate your feedback and support in making Toolit even better for the community.

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

toolit-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

toolit-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file toolit-0.2.0.tar.gz.

File metadata

  • Download URL: toolit-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for toolit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 02e4a913bf140220cffa319494182c642eed4e19dfafbf5c244757d7b9d3d47b
MD5 0143db6fc5278d89dd1b4dc076a65452
BLAKE2b-256 efc0356da3019ca19e1951dc02c559f5dd98f325623a983d4773a385eff8ca4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolit-0.2.0.tar.gz:

Publisher: release.yaml on martinmoldrup/toolit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file toolit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: toolit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for toolit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d71fa6c50a42783b1008919bc3b07f1ab476621e42fc2a2bd98c484852730b3d
MD5 566ae966605cee570566e61538a6e553
BLAKE2b-256 905c96f662ad84b07e9f93dee71c4671f8555f380f144d6c2bf6e1bc507c07fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolit-0.2.0-py3-none-any.whl:

Publisher: release.yaml on martinmoldrup/toolit

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