Skip to main content

Compile one-off task descriptions into single, self-contained, runnable scripts using AI

Project description

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.

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

mkscript-0.0.1.tar.gz (71.8 kB view details)

Uploaded Source

Built Distribution

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

mkscript-0.0.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file mkscript-0.0.1.tar.gz.

File metadata

  • Download URL: mkscript-0.0.1.tar.gz
  • Upload date:
  • Size: 71.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for mkscript-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1850af56e3f1c9c181245a39be3ee7493230b0871704b62c561b76663f705bff
MD5 bb6286b415cc20b95f08c75eda49d620
BLAKE2b-256 8ecea1b8f6ad519444458d662b5c90b4506b94f01461b4a8cf514c2e9f181bab

See more details on using hashes here.

File details

Details for the file mkscript-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: mkscript-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for mkscript-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36f89514de2b76f142bbad25472d3f97beba37c77ff73a25576952261882e00d
MD5 c46f8e3557cff8c53a5950b00cffb9f7
BLAKE2b-256 a98d0570415a3f025a688b80eacf6093167eb5061729bbec963b83fe258b0f75

See more details on using hashes here.

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