toolit


Nametoolit JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryMCP Server, Typer CLI and vscode tasks in one, provides an easy way to configure your own DevTools and python scripts in a project.
upload_time2025-09-14 10:04:51
maintainerNone
docs_urlNone
authorMartin Møldrup
requires_python>=3.9
licenseNone
keywords mcp cli devtools typer vscode scripts python toolkit tools development development tools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Toolit
Model Context Protocol (MCP) Server, Typer CLI and Visual Studio Code tasks 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:

```bash
pip install toolit
```

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

```bash
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.

```python
# devtools/my_commands.py
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:

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

### Customizing the DevTools Folder
By default, Toolit looks for a folder named `devtools` in the project root. You can customize this by creating a `toolit.ini` or use your `pyproject.toml` file in your project root with the following content:

```toml
[toolit]
tools_folder = "tools"
```

## 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:
```bash
toolit create-vscode-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.

```python
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.

## Creating Plugins
Toolit supports a plugin system that allows you to create and share your own tools as separate packages. This makes it easy to reuse tools across different projects, without needing to copy and update tools across multiple codebases.

To create a plugin, follow these steps:
1. Create a new Python package for your plugin. You can use tools like `setuptools`, `poetry` or `uv` to set up your package structure.
2. In your package, create one or several modules where you define your tools using the `@tool` decorator.
3. You can include your own user-configurations, and load them using the `get_config_value` function from the `toolit.config` module.
4. Make sure to include `toolit` as a dependency in your package's `setup.py` or `pyproject.toml`.
5. Register your plugin with Toolit by adding an entry point in your `setup.py` or `pyproject.toml`, so Toolit can discover your tools when the package is installed. The entry point is called `toolit_plugins`.
6. Publish your package to PyPI or install it from a git repository where you need it.

See an example plugin here: [toolit-azure-devops-trunk-based-branching](https://github.com/martinmoldrup/toolit-azure-devops-trunk-based-branching)

## 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "toolit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "mcp, cli, devtools, typer, vscode, scripts, python, toolkit, tools, development, development tools",
    "author": "Martin M\u00f8ldrup",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/10/07/d465b72baea1458d9419c5592d9b3082e826c2fd3838e8ae4563bc931a6c/toolit-0.4.0.tar.gz",
    "platform": null,
    "description": "# Toolit\nModel Context Protocol (MCP) Server, Typer CLI and Visual Studio Code tasks in one, provides an easy way to configure your own DevTools in a project.\n\n## Installation\nTo get started with Toolit, install the package via pip:\n\n```bash\npip install toolit\n```\n\nIf you want mcp server support, you can install the optional dependency:\n\n```bash\npip install toolit[mcp]\n```\nNote: MCP support is not available on python 3.9, since it is not supported by the `mcp` package.\n\n## Usage\nAdd 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.\n\n```python\n# devtools/my_commands.py\nfrom toolit import tool\n@tool\ndef my_command(to_print: str = \"Hello, World!\") -> None:\n    \"\"\"This is a command that can be run from the CLI.\"\"\"\n    print(to_print)\n```\n\nToolit will automatically discover these modules and make them available as commands.\n\nNow you can run your command from the command line:\n\n```bash\ntoolit --help  # To see available commands\ntoolit my-command --to_print \"Hello, Toolit!\"  # To run your command\n```\n\n### Customizing the DevTools Folder\nBy default, Toolit looks for a folder named `devtools` in the project root. You can customize this by creating a `toolit.ini` or use your `pyproject.toml` file in your project root with the following content:\n\n```toml\n[toolit]\ntools_folder = \"tools\"\n```\n\n## Create the VS code tasks.json file\nYou 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.\n\nTo create the `.vscode/tasks.json` file, run the following command in your terminal:\n```bash\ntoolit create-vscode-tasks-json\n```\nNOTE: THIS WILL OVERWRITE YOUR EXISTING `.vscode/tasks.json` FILE IF IT EXISTS!\n\n## Chaining Commands\nYou 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.\n\n```python\nfrom toolit import tool, sequential_group_of_tools, parallel_group_of_tools\nfrom typing import Callable\n\n@tool\ndef first_command() -> None:\n    print(\"First command executed.\")\n\n@tool\ndef second_command() -> None:\n    print(\"Second command executed.\")\n\n@sequential_group_of_tools\ndef my_sequential_commands() -> list[Callable]:\n    return [first_command, second_command]\n\n@parallel_group_of_tools\ndef my_parallel_commands() -> list[Callable]:\n    return [first_command, second_command]\n```\n\nThis will create a group of commands in the `tasks.json` file that can be executed sequentially or in parallel.\n\n## Creating Plugins\nToolit supports a plugin system that allows you to create and share your own tools as separate packages. This makes it easy to reuse tools across different projects, without needing to copy and update tools across multiple codebases.\n\nTo create a plugin, follow these steps:\n1. Create a new Python package for your plugin. You can use tools like `setuptools`, `poetry` or `uv` to set up your package structure.\n2. In your package, create one or several modules where you define your tools using the `@tool` decorator.\n3. You can include your own user-configurations, and load them using the `get_config_value` function from the `toolit.config` module.\n4. Make sure to include `toolit` as a dependency in your package's `setup.py` or `pyproject.toml`.\n5. Register your plugin with Toolit by adding an entry point in your `setup.py` or `pyproject.toml`, so Toolit can discover your tools when the package is installed. The entry point is called `toolit_plugins`.\n6. Publish your package to PyPI or install it from a git repository where you need it.\n\nSee an example plugin here: [toolit-azure-devops-trunk-based-branching](https://github.com/martinmoldrup/toolit-azure-devops-trunk-based-branching)\n\n## Contributing\nWe 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.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "MCP Server, Typer CLI and vscode tasks in one, provides an easy way to configure your own DevTools and python scripts in a project.",
    "version": "0.4.0",
    "project_urls": {
        "Changelog": "https://github.com/martinmoldrup/toolit/blob/master/CHANGELOG.md",
        "Homepage": "https://github.com/martinmoldrup/toolit",
        "Issues": "https://github.com/martinmoldrup/toolit/issues",
        "Repository": "https://github.com/martinmoldrup/toolit"
    },
    "split_keywords": [
        "mcp",
        " cli",
        " devtools",
        " typer",
        " vscode",
        " scripts",
        " python",
        " toolkit",
        " tools",
        " development",
        " development tools"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a984a645ae0eb245522cebdea0bf9534639a7491689479aa62b383ae4e0cafa3",
                "md5": "8900719f5bfd6ecf3ab63dfcc52e7fe6",
                "sha256": "0450154c8ccee6a3b1849167a75b46906b9736a911708a4e7187e36ac1ad47df"
            },
            "downloads": -1,
            "filename": "toolit-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8900719f5bfd6ecf3ab63dfcc52e7fe6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11978,
            "upload_time": "2025-09-14T10:04:50",
            "upload_time_iso_8601": "2025-09-14T10:04:50.470043Z",
            "url": "https://files.pythonhosted.org/packages/a9/84/a645ae0eb245522cebdea0bf9534639a7491689479aa62b383ae4e0cafa3/toolit-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1007d465b72baea1458d9419c5592d9b3082e826c2fd3838e8ae4563bc931a6c",
                "md5": "9f8452b1cefbc846b05c1befbd4f18c3",
                "sha256": "d4fa7452e16bd1b880b48b901de6853012a005476986e2e72a613ada6a41b2d4"
            },
            "downloads": -1,
            "filename": "toolit-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9f8452b1cefbc846b05c1befbd4f18c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11563,
            "upload_time": "2025-09-14T10:04:51",
            "upload_time_iso_8601": "2025-09-14T10:04:51.888820Z",
            "url": "https://files.pythonhosted.org/packages/10/07/d465b72baea1458d9419c5592d9b3082e826c2fd3838e8ae4563bc931a6c/toolit-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-14 10:04:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "martinmoldrup",
    "github_project": "toolit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "toolit"
}
        
Elapsed time: 1.66648s