Skip to main content

runspec

A language-agnostic, TOML-based interface specification for anything runnable: scripts, applications and MCP tools, readable by people and AI agents without conversion.

This is the Python package (the reference implementation). The Node pack is runspec-node. Full documentation is at runspec.app.

Why

Argument definitions are usually buried in code. When an AI agent needs to call a script as a tool, the interface gets described a second time in a separate tool or skills file.

An interface definition already is a tool description. runspec puts it in one runspec.toml next to your code, and that one file drives argument parsing and validation, --help, agent tool schemas, forms, and how much an agent may do without asking (autonomy).

Install

pip install runspec

Python 3.10+. No runtime dependencies on Python 3.11+ (tomli on 3.10).

Quick start

Describe the runnable in mypkg/runspec.toml, inside your package directory:

[greet]
description = "Greet someone from the command line"
autonomy    = "autonomous"

[greet.args]
name  = {type = "str"}
loud  = {default = false}
times = {default = 1}

Read the arguments in your code:

from runspec import parse

def main():
    args = parse()
    message = f"Hello, {args.name.value}!"
    if args.loud.value:
        message = message.upper()
    for _ in range(args.times.value):
        print(message)

Register greet = "mypkg.greet:main" as a console script (the entry point name matches the runnable name), install the package, and it runs as a normal CLI:

greet --name Ada --loud --times 2

List every runspec runnable in the environment, or serve them to an agent over MCP:

runspec local
runspec serve

Features

  • Spec first: write the interface before the implementation.
  • One call: parse() finds the spec, validates the arguments and returns them typed.
  • Self-describing values: each argument carries its value plus its type, default, options and where the value came from (CLI, environment or default).
  • Inference: type, required and choice are inferred from defaults and options.
  • Autonomy control: declare whether an agent may run a tool freely, must ask first, or must leave it to a person.
  • Agent discovery: runspec local and runspec serve expose installed runnables as tools.
  • Run logging and audit on by default.
  • Language agnostic: the same format for Python, Node, shell or anything else.

License

MIT

Metadata

Release files for runspec 0.83.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runspec 0.83.0
File Size Uploaded Provenance Actions
runspec-0.83.0.tar.gz 352.2 kB With provenance Details for runspec-0.83.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for runspec 0.83.0
File Interpreter ABI Platform Actions
runspec-0.83.0-py3-none-any.whl Python 3 none any Details for runspec-0.83.0-py3-none-any.whl

Total release size: 743.2 kB

Release files / runspec-0.83.0.tar.gz

Download URL runspec-0.83.0.tar.gz
Size 352.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9347c2ac6f49cdc6566bf9767e72a48bcae39fcaa5d45bf3ad78bf0a20a0b613
BLAKE2b-256 checksum
How to use checksums
45b422923ae3c4a155bb5be0a70d1257391aa3f0eddbb80452a6db83e2ee50ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / runspec-0.83.0-py3-none-any.whl

Download URL runspec-0.83.0-py3-none-any.whl
Size 391.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c15227f7b8fb18f32a15c4fe5196cc75bd5a24f39b5b6f0d349ef230d36c9e6
BLAKE2b-256 checksum
How to use checksums
f57b7627608fb1a5016a87977da14b2265c6c2b97429242741525491c79d9884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for runspec 0.83.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for runspec-0.83.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.83.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page