Skip to main content

mkscript

Compile a one-off task description into a single, self-contained, runnable script — using AI.

Status: early / specification stage. The design is modeled in the growth MCP service (requirements, milestones, work items, verification, architecture); code has not landed yet. This README describes the intended v1.

What it does (one thing)

You give mkscript a natural-language definition of a task. It asks an AI backend to produce exactly one self-contained script and emits it. mkscript does not execute the script — the emitted file is the sole deliverable.

  • The model chooses the language. mkscript does not hard-code bash or Python; the AI picks a platform-appropriate language/runtime. You may nudge it with optional hints.
  • One file, no companions. Dependencies are satisfied from within the single file using the language's idiom (e.g. PEP 723 inline metadata for Python, standard-shell builtins for bash).
  • Validated before emit. Where a syntax check exists for the chosen language (e.g. bash -n, py_compile), a script that fails it is not silently emitted.
  • Swappable backend. Generation sits behind a thin, vendor-neutral interface; the one shipped backend uses Pydantic-AI (pydantic-ai-slim[anthropic,openai]), so you bring your own provider key and pick a model like anthropic:claude-sonnet-4-6 or openai:gpt-4o.

Intended CLI

mkscript "describe the task"            # script printed to stdout
mkscript "..." --out build.sh           # written to a file instead
echo "describe the task" | mkscript     # definition from stdin
mkscript "..." --model openai:gpt-4o    # pick the provider:model
mkscript "..." --lang python            # preferred-language hint
mkscript "..." --platform linux         # target platform (defaults to host OS)
mkscript "..." --context-file sample.csv  # optional context (sample data / format)
mkscript "..." --refine                 # interactive, bounded refine loop

Before emitting, mkscript runs a language-appropriate syntax check where one exists (py_compile for Python, bash -n for shell); a script that fails is surfaced and not emitted. Languages without a shipped checker are emitted best-effort.

With --refine, mkscript shows each candidate script (and its check status) and prompts on stderr, so stdout stays clean for the final file. Type a natural-language change to revise it, :accept to emit the current script, or :quit (or a blank line) to exit without emitting. A script that failed its syntax check is not emitted by :accept; use :accept! to emit it anyway. The loop is bounded by a maximum number of rounds.

Configuration resolves by precedence. The provider/model is taken from the --model flag → MKSCRIPT_MODEL → a model key in the config file → a built-in default. The API credential is taken from MKSCRIPT_API_KEY → an api_key key in the config file → the provider-native variable (ANTHROPIC_API_KEY / OPENAI_API_KEY) that Pydantic-AI reads itself. With no credential resolvable, mkscript exits non-zero and names the variable to set.

The config file is TOML at <OS config dir>/mkscript/config.toml (located via platformdirs):

model = "anthropic:claude-sonnet-4-6"
api_key = "sk-..."

Stack

Python, packaged under src/mkscript/ and run via uv (uv tool install). Note: the single-file constraint applies to the scripts mkscript generates, not to mkscript's own source.

License

MIT — see LICENSE.

Metadata

Release files for mkscript 0.0.1

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

Source distribution (sdist)

Source distribution for mkscript 0.0.1
File Size Uploaded Provenance Actions
mkscript-0.0.1.tar.gz 71.8 kB Without provenance Details for mkscript-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 90.1 kB

Release files / mkscript-0.0.1.tar.gz

Download URL mkscript-0.0.1.tar.gz
Size 71.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1850af56e3f1c9c181245a39be3ee7493230b0871704b62c561b76663f705bff
BLAKE2b-256 checksum
How to use checksums
8ecea1b8f6ad519444458d662b5c90b4506b94f01461b4a8cf514c2e9f181bab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / mkscript-0.0.1-py3-none-any.whl

Download URL mkscript-0.0.1-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36f89514de2b76f142bbad25472d3f97beba37c77ff73a25576952261882e00d
BLAKE2b-256 checksum
How to use checksums
a98d0570415a3f025a688b80eacf6093167eb5061729bbec963b83fe258b0f75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for mkscript 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.0.1 This release

2 release files No 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