{
  "version": 1,
  "runthat": "0.1.8",
  "areas": [
    "Run & debug",
    "Lock & deploy",
    "Packages & feeds",
    "Databases",
    "Connections",
    "AI agents",
    "Reference"
  ],
  "commands": [
    {
      "id": "run",
      "name": "run",
      "area": "Run & debug",
      "usage": [
        "runthat <script.cs> [args...]",
        "runthat run [--frozen] <script.cs> [--] [args...]"
      ],
      "help": "Run a script using the packages in its lock file. Creates the lock file if it's missing, unless --frozen is given (use that in production and CI).",
      "description": "Restores exactly the packages in <script>.lock.json, builds the script in Release and runs it. `runthat <script.cs>` is the same as `runthat run`. Without a lock file, a plain run resolves the pinned packages and writes one first; `--frozen` refuses instead, so nothing can change the packages. Everything after the script goes to the script; put `--` first to pass arguments that start with a dash. The exit code is the script's own. An unhandled exception is reported at the script's own file and line.",
      "options": [
        {
          "name": "--frozen",
          "value": null,
          "description": "Use the lock file exactly and fail if there's none, instead of creating it. Use this in CI and production.",
          "repeatable": false
        },
        {
          "name": "--",
          "value": null,
          "description": "Everything after it goes to the script, even arguments that start with a dash.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat report.cs",
          "note": "Run a script; the first run creates report.lock.json",
          "bash": null
        },
        {
          "command": "runthat run --frozen report.cs",
          "note": "Run exactly as locked, as in CI or production",
          "bash": null
        },
        {
          "command": "runthat run report.cs -- --month 11",
          "note": "Pass arguments that start with a dash to the script",
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "debug",
      "name": "debug",
      "area": "Run & debug",
      "usage": [
        "runthat debug <script.cs> [--frozen] [--break <line>]... [--max-hits <n>] [--json] [--debugger <path>] [-- args...]"
      ],
      "help": "Build in Debug and run under netcoredbg. At each breakpoint (a line in the script), print the line, the call stack and the locals (secrets hidden), then go on (at most --max-hits stops, default 50). An unhandled exception is reported with its file and line. --json writes one object at the end.",
      "description": "Builds the script in Debug, with symbols that point at the script itself, and runs it under netcoredbg, the MIT-licensed .NET debugger. At each breakpoint it prints the line, the call stack and the local variables, then carries on; the script's own output is printed as it comes. Values are cut to 1,000 characters and passwords, keys, tokens and connection strings show as [redacted]. A breakpoint on a line with no code binds to the next line that has some. An unhandled exception is reported with its type, message, file, line, stack and locals. The exit code is the script's own.",
      "options": [
        {
          "name": "--break",
          "value": "<line>",
          "description": "Stop at this line of the script.",
          "repeatable": true
        },
        {
          "name": "--max-hits",
          "value": "<n>",
          "description": "Stop recording after this many breakpoint hits (default 50); the script then runs on without breakpoints.",
          "repeatable": false
        },
        {
          "name": "--frozen",
          "value": null,
          "description": "Use the lock file exactly and fail if there's none, instead of creating it. Use this in CI and production.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one object when the script ends: { version, exitCode, output, outputTruncated, breakpoints, hits, hitLimitReached, error }.",
          "repeatable": false
        },
        {
          "name": "--debugger",
          "value": "<path>",
          "description": "The netcoredbg executable or its folder. Without it runthat uses RUNTHAT_DEBUGGER, a netcoredbg next to runthat, or its tools folder, and downloads netcoredbg (pinned, SHA-256 checked) the first time.",
          "repeatable": false
        },
        {
          "name": "--",
          "value": null,
          "description": "Everything after it goes to the script.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat debug report.cs --break 12 --break 30",
          "note": "Print the stack and locals at lines 12 and 30",
          "bash": null
        },
        {
          "command": "runthat debug report.cs --break 12 --json",
          "note": "One JSON object for tools and agents",
          "bash": null
        },
        {
          "command": "runthat debug report.cs --break 12 -- --month 11",
          "note": "Pass arguments to the script after --",
          "bash": null
        }
      ],
      "json": "debug"
    },
    {
      "id": "debug-dap",
      "name": "debug --dap",
      "area": "Run & debug",
      "usage": [
        "runthat debug <script.cs> --dap [--frozen] [--debugger <path>] [-- args...]"
      ],
      "help": "Build in Debug, then speak the Debug Adapter Protocol on stdin/stdout (for editors); runthat fills in the launch request.",
      "description": "Restores and builds first; if that fails it exits 1 with a runthat: message on stderr and writes nothing to stdout. Then it starts netcoredbg and passes Debug Adapter Protocol messages between stdin/stdout and netcoredbg. Only DAP goes to stdout. runthat fills in the launch request (program, args, cwd and the script's connections) and maps setBreakpoints paths that name the script to its symbols, so breakpoints bind. It can't be combined with --break, --max-hits or --json: the client sets breakpoints itself.",
      "options": [
        {
          "name": "--dap",
          "value": null,
          "description": "Speak the Debug Adapter Protocol on stdin/stdout.",
          "repeatable": false
        },
        {
          "name": "--frozen",
          "value": null,
          "description": "Use the lock file exactly and fail if there's none, instead of creating it. Use this in CI and production.",
          "repeatable": false
        },
        {
          "name": "--debugger",
          "value": "<path>",
          "description": "The netcoredbg executable or its folder. Without it runthat uses RUNTHAT_DEBUGGER, a netcoredbg next to runthat, or its tools folder, and downloads netcoredbg (pinned, SHA-256 checked) the first time.",
          "repeatable": false
        },
        {
          "name": "--",
          "value": null,
          "description": "Everything after it goes to the script.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat debug report.cs --dap",
          "note": "Start a debug adapter for an editor",
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "lock",
      "name": "lock",
      "area": "Lock & deploy",
      "usage": [
        "runthat lock <script.cs>"
      ],
      "help": "Resolve packages and write <script>.lock.json.",
      "description": "Resolves the script's pinned #:package lines and every indirect package, and writes <script>.lock.json next to it with each package's content hash, the target framework and platform. Run it after you edit #:package lines, then commit the script and its lock together. For an EF Core connection without a model yet, it also writes <script>.schema.json from the cached schema. It warns when several feeds are enabled without packageSourceMapping.",
      "options": [],
      "examples": [
        {
          "command": "runthat lock report.cs",
          "note": "Write report.lock.json",
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "check",
      "name": "check",
      "area": "Lock & deploy",
      "usage": [
        "runthat check <script.cs> [--source <script.cs>]"
      ],
      "help": "Check this machine can run the script as locked. With --source, also check an exported copy still matches the script it came from.",
      "description": "Checks the .NET SDK and runtime for the script's target, the feeds, the locked restore and the compile, with one ok/FAIL line per step, and reports any connection the script declares that this machine is missing. It never runs the script's code, so it's the safe way to try a script. Exits 1 when a check fails.",
      "options": [
        {
          "name": "--source",
          "value": "<script.cs>",
          "description": "For an exported copy: also check that it still matches the script it was exported from.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat check report.cs",
          "note": "Check this machine can run report.cs as locked",
          "bash": null
        },
        {
          "command": "runthat check dist\\report.cs --source report.cs",
          "note": "Check an exported copy is up to date",
          "bash": "runthat check dist/report.cs --source report.cs"
        }
      ],
      "json": null
    },
    {
      "id": "export",
      "name": "export",
      "area": "Lock & deploy",
      "usage": [
        "runthat export <script.cs> [-o <folder|file.cs>]"
      ],
      "help": "Write one file with the lock inside, for sharing or deploying (default: dist\\<script>.cs).",
      "description": "Writes a single .cs file with the lock embedded at the end as comments, for sharing or deploying. The script and its lock file stay as they are. The copy runs anywhere with `runthat run --frozen`. Don't edit the embedded lock: a changed line or hash stops the run.",
      "options": [
        {
          "name": "-o",
          "value": "<folder|file.cs>",
          "description": "Where to write the copy (also --output). Default: dist\\<script>.cs next to the script.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat export report.cs",
          "note": "Write dist\\report.cs with the lock inside",
          "bash": "runthat export report.cs   # writes dist/report.cs"
        },
        {
          "command": "runthat export report.cs -o \\\\server\\scripts",
          "note": "Write the copy to a share",
          "bash": "runthat export report.cs -o /srv/scripts"
        }
      ],
      "json": null
    },
    {
      "id": "unpack",
      "name": "unpack",
      "area": "Lock & deploy",
      "usage": [
        "runthat unpack [--force] <exported.cs>"
      ],
      "help": "Turn an exported copy back into a script and its lock file.",
      "description": "Splits an exported copy into the script and its <script>.lock.json again, so you can edit it. It won't replace existing files unless you pass --force.",
      "options": [
        {
          "name": "--force",
          "value": null,
          "description": "Replace a script or lock file that's already there.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat unpack report.cs",
          "note": "Turn an exported copy back into report.cs and report.lock.json",
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "publish",
      "name": "publish",
      "area": "Lock & deploy",
      "usage": [
        "runthat publish <script.cs> [-o <folder>] [-r <runtime>] [--framework-dependent] [--single-file]"
      ],
      "help": "Compile a locked script into a folder that runs with no package feeds, and with no .NET installed unless --framework-dependent is given (default: dist\\<script>-<runtime>, this machine's runtime, for example win-x64 or linux-x64).",
      "description": "Restores for the target platform, compares every package with the lock by version and content hash, and only then compiles the script into a folder you copy to the server. If anything differs, nothing is published. It's self-contained by default, so the server needs neither feeds nor .NET. runthat writes runthat-publish.json into the folder and only ever replaces a folder it published before, or an empty one. To lock platform-only packages, list the platforms with #:property RuntimeIdentifiers=win-x64;linux-x64 and relock.",
      "options": [
        {
          "name": "-o",
          "value": "<folder>",
          "description": "The output folder (also --output). Default: dist\\<script>-<runtime>.",
          "repeatable": false
        },
        {
          "name": "-r",
          "value": "<runtime>",
          "description": "The runtime identifier, for example win-x64, linux-x64 or osx-arm64 (also --runtime). Default: this machine's.",
          "repeatable": false
        },
        {
          "name": "--framework-dependent",
          "value": null,
          "description": "Leave out the .NET runtime: a smaller folder for machines that have it.",
          "repeatable": false
        },
        {
          "name": "--single-file",
          "value": null,
          "description": "Bundle everything into one executable.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat publish report.cs -r linux-x64",
          "note": "Build dist\\report-linux-x64 for a Linux server",
          "bash": "runthat publish report.cs -r linux-x64   # builds dist/report-linux-x64"
        },
        {
          "command": "runthat publish report.cs -r win-x64 --single-file",
          "note": "One self-contained .exe",
          "bash": null
        },
        {
          "command": "runthat publish report.cs --framework-dependent -o out",
          "note": "A smaller folder for machines with .NET",
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "import",
      "name": "import",
      "area": "Lock & deploy",
      "usage": [
        "runthat import <file.linq> [-o <script.cs>] [--pin <id@version>]... [--force] [--no-lock]"
      ],
      "help": "Import an existing query into a script and lock it. Packages without a version get the one this machine already uses; --pin sets one yourself.",
      "description": "Turns an existing query file into a runthat script next to it and locks it. Expression, Statements and Program queries are supported. Pinned packages keep their version; for the others runthat uses the newest version already on this machine, and says to use --pin when it finds none. A query's connection becomes a #:connection line. What can't be carried over, such as DLL references, is listed in note: lines.",
      "options": [
        {
          "name": "-o",
          "value": "<script.cs>",
          "description": "Where to write the script (also --output). Default: next to the query, with a .cs extension.",
          "repeatable": false
        },
        {
          "name": "--pin",
          "value": "<id@version>",
          "description": "Use this version for a package, for example --pin Dapper@2.1.35.",
          "repeatable": true
        },
        {
          "name": "--force",
          "value": null,
          "description": "Replace a script that's already there.",
          "repeatable": false
        },
        {
          "name": "--no-lock",
          "value": null,
          "description": "Write the script without locking it.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat import report.linq",
          "note": "Import a .linq query and lock it",
          "bash": null
        },
        {
          "command": "runthat import report.linq --pin Dapper@2.1.35 -o scripts\\report.cs",
          "note": "Choose a version and where the script goes",
          "bash": "runthat import report.linq --pin Dapper@2.1.35 -o scripts/report.cs"
        }
      ],
      "json": null
    },
    {
      "id": "sources",
      "name": "sources",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources <script.cs> [--json]"
      ],
      "help": "Show the package feeds the script uses, its packageSourceMapping rules, and which feed each locked package may come from.",
      "description": "Lists the feeds the script restores from (its nearest nuget.config, or the user and machine NuGet config without one), whether each is enabled and has saved credentials, the packageSourceMapping rules, and which feed each locked package may come from. Exits 1 when a package has no allowed feed.",
      "options": [
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources report.cs",
          "note": "See the feeds and mapping report.cs restores with",
          "bash": null
        },
        {
          "command": "runthat sources report.cs --json",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources"
    },
    {
      "id": "sources-add",
      "name": "sources add",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources add <name> <url-or-folder> --script <script.cs> [--user] [--json]"
      ],
      "help": "Add a feed to the script's nearest nuget.config (created next to the script if there's none), or to your user NuGet.Config with --user.",
      "description": "Adds a feed (an https:// URL or a folder; a relative folder stays relative) to the nuget.config restore reads for the script. A new nuget.config starts with the feeds, disabled feeds and mapping the script already used, after a <clear />. Refuses a duplicate name, a bad URL or a missing folder. Credentials are never written.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--user",
          "value": null,
          "description": "Edit your user NuGet.Config instead.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources add acme https://pkgs.example.com/acme/v3/index.json --script report.cs",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat sources add local ..\\packages --script report.cs",
          "note": "A folder feed",
          "bash": "runthat sources add local ../packages --script report.cs"
        }
      ],
      "json": "sources-change"
    },
    {
      "id": "sources-remove",
      "name": "sources remove",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources remove <name> --script <script.cs> [--user] [--json]"
      ],
      "help": "Remove a feed, with its mapping patterns, disabled entry and saved credentials in that file.",
      "description": "Removes a feed from the file that defines it, with its packageSourceMapping patterns, disabled entry and credentials. A feed in your user config needs --user; machine-wide feeds are never changed (disable the feed for the script instead).",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--user",
          "value": null,
          "description": "Edit your user NuGet.Config instead.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources remove local --script report.cs",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources-change"
    },
    {
      "id": "sources-enable",
      "name": "sources enable | disable",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources enable <name> --script <script.cs> [--json]",
        "runthat sources disable <name> --script <script.cs> [--json]"
      ],
      "help": "Turn a feed on or off for the script.",
      "description": "Turns a feed on or off for the script with disabledPackageSources in its nuget.config, without removing it.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources disable local --script report.cs",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat sources enable local --script report.cs",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources-change"
    },
    {
      "id": "sources-map",
      "name": "sources map",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources map <pattern> <feed> --script <script.cs> [--json]"
      ],
      "help": "Add a packageSourceMapping pattern (an exact id, Prefix.* or *) for a feed.",
      "description": "Writes NuGet's packageSourceMapping into the script's nuget.config, so a package can only come from the feeds it's mapped to. NuGet uses the most specific pattern. Patterns NuGet wouldn't match, such as A*b, are refused.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources map \"Acme.*\" acme --script report.cs",
          "note": "Acme packages only from the acme feed",
          "bash": null
        },
        {
          "command": "runthat sources map \"*\" nuget.org --script report.cs",
          "note": "Everything else from nuget.org",
          "bash": null
        }
      ],
      "json": "sources-change"
    },
    {
      "id": "sources-unmap",
      "name": "sources unmap",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources unmap <pattern> [<feed>] --script <script.cs> [--json]"
      ],
      "help": "Remove a packageSourceMapping pattern from one feed, or from every feed.",
      "description": "Removes a packageSourceMapping pattern from the named feed, or from every feed when none is named.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources unmap \"Acme.*\" --script report.cs",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat sources unmap \"Acme.*\" acme --script report.cs",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources-change"
    },
    {
      "id": "sources-clear-above",
      "name": "sources clear-above",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources clear-above on|off --script <script.cs> [--json]"
      ],
      "help": "Add or remove <clear /> at the top of packageSources.",
      "description": "With on, the script's nuget.config starts its packageSources with <clear />, so feeds from other config files don't apply in that folder (for dotnet and IDEs too). off takes it out.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources clear-above on --script report.cs",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources-change"
    },
    {
      "id": "sources-which",
      "name": "sources which",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources which <package-id> --script <script.cs> [--json]"
      ],
      "help": "Which feeds a package may come from, the pattern that decided it, and why.",
      "description": "Shows the enabled feeds a package may come from under packageSourceMapping, the pattern that decided it, and why. No feed means restore will fail.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources which Acme.Billing --script report.cs",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources-which"
    },
    {
      "id": "sources-test",
      "name": "sources test",
      "area": "Packages & feeds",
      "usage": [
        "runthat sources test <name-or-url> --script <script.cs> [--json]"
      ],
      "help": "Try a feed, signing in like restore does.",
      "description": "Reads a feed's service index (or checks a folder) with restore's own credential handling, and says whether it answered or needs signing in. Exits 0 whenever the test ran, whether or not the feed answered.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to read or edit. Required.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat sources test acme --script report.cs",
          "note": null,
          "bash": null
        }
      ],
      "json": "sources-test"
    },
    {
      "id": "search",
      "name": "search",
      "area": "Packages & feeds",
      "usage": [
        "runthat search <words> [--script <script.cs>] [--prerelease] [--take <n>] [--json]"
      ],
      "help": "Search the feeds the script restores from (its nearest nuget.config; without --script, the current folder's) for packages, one line per package id.",
      "description": "Searches the same feeds restore uses, with packageSourceMapping applied, so a package only shows up from a feed it may come from. Each result has the id, the latest version, the feed, downloads, owners and description. A feed that can't be searched gets a problem of its own and the rest still come back. Exits 0 when the search ran, even with no results.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to use. Without it, the current folder's.",
          "repeatable": false
        },
        {
          "name": "--prerelease",
          "value": null,
          "description": "Include prerelease versions.",
          "repeatable": false
        },
        {
          "name": "--take",
          "value": "<n>",
          "description": "How many results to ask each feed for (default 20).",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat search json --script report.cs",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat search dapper --take 5 --json",
          "note": null,
          "bash": null
        }
      ],
      "json": "search"
    },
    {
      "id": "info",
      "name": "info",
      "area": "Packages & feeds",
      "usage": [
        "runthat info <id> [--script <script.cs>] [--version <v>] [--json]"
      ],
      "help": "List every version of a package on those feeds, newest first, marking deprecated and vulnerable ones, with the dependencies and license of one version (default: the newest stable).",
      "description": "Lists every version of a package on the script's feeds, newest first, marking prerelease, deprecated and vulnerable ones, with one version's dependency groups by framework, its license and its advisories. Use it to choose a version before pinning it.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script whose nearest nuget.config to use. Without it, the current folder's.",
          "repeatable": false
        },
        {
          "name": "--version",
          "value": "<v>",
          "description": "The version to show details for. Default: the newest stable.",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat info Newtonsoft.Json --script report.cs",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat info Newtonsoft.Json --version 12.0.3 --json",
          "note": null,
          "bash": null
        }
      ],
      "json": "info"
    },
    {
      "id": "db-test",
      "name": "db test",
      "area": "Databases",
      "usage": [
        "runthat db test <connection> [--provider <kind>] [--json]"
      ],
      "help": "Open a connection and show the server version.",
      "description": "Opens one of this machine's named connections and shows the server version, how long it took and where the connection came from (the saved list or a RUNTHAT_CONNECTION_ variable). Exits 1 when it can't connect.",
      "options": [
        {
          "name": "--provider",
          "value": "<kind>",
          "description": "Read the connection as this kind of database instead of the one it was saved with (also -p).",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat db test Sales",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "db-schema",
      "name": "db schema",
      "area": "Databases",
      "usage": [
        "runthat db schema <connection> [--schema <name>] [--refresh] [--provider <kind>] [--json]"
      ],
      "help": "List its tables, views, routines and columns, with keys. Cached after the first read; --refresh reloads.",
      "description": "Lists the schemas, tables, views, procedures and functions, with each column's type, whether it allows nulls, and the primary and foreign keys. It reads the catalog with three queries rather than one per table and caches the result (names only) until you pass --refresh or change the connection. It never reads data. SQL Server, PostgreSQL, MySQL and MariaDB, SQLite and Oracle are supported.",
      "options": [
        {
          "name": "--schema",
          "value": "<name>",
          "description": "Only this schema (SQL Server or PostgreSQL schema, MySQL database, Oracle user).",
          "repeatable": false
        },
        {
          "name": "--refresh",
          "value": null,
          "description": "Read the catalog from the database again instead of the cache.",
          "repeatable": false
        },
        {
          "name": "--provider",
          "value": "<kind>",
          "description": "Read the connection as this kind of database instead of the one it was saved with (also -p).",
          "repeatable": false
        },
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat db schema Sales",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat db schema Sales --schema dbo --refresh",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "db-record",
      "name": "db record",
      "area": "Databases",
      "usage": [
        "runthat db record <connection> <table> [--schema <name>] [--refresh] [--provider <kind>]"
      ],
      "help": "Write a C# record for a table's rows, for Dapper.",
      "description": "Writes a C# record for a table's rows, with the .NET types the driver returns, to paste into a script for Dapper. The table can be name or schema.name.",
      "options": [
        {
          "name": "--schema",
          "value": "<name>",
          "description": "Only this schema (SQL Server or PostgreSQL schema, MySQL database, Oracle user).",
          "repeatable": false
        },
        {
          "name": "--refresh",
          "value": null,
          "description": "Read the catalog from the database again instead of the cache.",
          "repeatable": false
        },
        {
          "name": "--provider",
          "value": "<kind>",
          "description": "Read the connection as this kind of database instead of the one it was saved with (also -p).",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat db record Sales dbo.Orders",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "db-model",
      "name": "db model",
      "area": "Databases",
      "usage": [
        "runthat db model <connection> --script <script.cs> [--table <t>]... [--schema <s>] [--refresh] [--provider <kind>] [--remove]"
      ],
      "help": "Save the tables an EF Core connection uses (#:connection Sales efcore) in <script>.schema.json, which builds Db.Sales.CreateContext(). Commit it. lock and runs that aren't --frozen take every table and view (up to 100) when the file has no model yet.",
      "description": "Saves a snapshot of the tables an EF Core connection uses next to the script, as <script>.schema.json, which builds Db.Sales.CreateContext(). Builds read that file, never the database, so run --frozen, export and publish work offline. Pick the tables the script needs: EF builds its model from all of them at the start of every run. Commit the file with the script.",
      "options": [
        {
          "name": "--script",
          "value": "<script.cs>",
          "description": "The script the model is for; it's saved next to it. Required.",
          "repeatable": false
        },
        {
          "name": "--table",
          "value": "<t>",
          "description": "A table or view to include, as name or schema.name. Default: every one, up to 100.",
          "repeatable": true
        },
        {
          "name": "--schema",
          "value": "<name>",
          "description": "Only this schema (SQL Server or PostgreSQL schema, MySQL database, Oracle user).",
          "repeatable": false
        },
        {
          "name": "--refresh",
          "value": null,
          "description": "Read the catalog from the database again instead of the cache.",
          "repeatable": false
        },
        {
          "name": "--provider",
          "value": "<kind>",
          "description": "Read the connection as this kind of database instead of the one it was saved with (also -p).",
          "repeatable": false
        },
        {
          "name": "--remove",
          "value": null,
          "description": "Take the connection's model out of the file.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat db model Sales --script report.cs --table dbo.Orders --table dbo.Customers",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat db model Sales --script report.cs --remove",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "db-drivers",
      "name": "db drivers",
      "area": "Databases",
      "usage": [
        "runthat db drivers [--json]"
      ],
      "help": "The databases with typed Db.<Name> connections, and the #:package line for each one's driver.",
      "description": "Lists the supported databases, the driver package to pin for each (with its #:package line), the connection type Db.<Name> returns, and, with --json, the EF Core provider package.",
      "options": [
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat db drivers",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat db drivers --json",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "connection-list",
      "name": "connection list",
      "area": "Connections",
      "usage": [
        "runthat connection list [--json]"
      ],
      "help": "List this machine's named database connections: names and kinds, never the connection strings.",
      "description": "Lists the named connections on this machine with their kind. --json adds the environment variable each reaches scripts as and where it comes from. Connection strings are never shown.",
      "options": [
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat connection list",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat connection list --json",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "connection-add",
      "name": "connection add",
      "area": "Connections",
      "usage": [
        "runthat connection add <name> --provider <kind> [--connection-string <value>] [--replace]"
      ],
      "help": "Save a named connection on this machine. It asks for the connection string, or reads it from stdin. Scripts declare #:connection Sales, pin its driver and use await Db.Sales.OpenAsync() (with efcore: Db.Sales.CreateContext()).",
      "description": "Saves a connection string under a name on this machine; on Windows it's encrypted for your user account. It asks for the string with a hidden prompt, or reads it from stdin, so it doesn't end up in shell history. Kinds: sqlserver, postgresql, mysql, sqlite, oracle, other.",
      "options": [
        {
          "name": "--provider",
          "value": "<kind>",
          "description": "The kind of database: sqlserver, postgresql, mysql, sqlite, oracle, other (also -p). Required.",
          "repeatable": false
        },
        {
          "name": "--connection-string",
          "value": "<value>",
          "description": "The connection string. Avoid it: it lands in shell history. Leave it out to be asked.",
          "repeatable": false
        },
        {
          "name": "--replace",
          "value": null,
          "description": "Replace a connection that already has this name.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat connection add Sales --provider sqlserver",
          "note": "Asks for the connection string",
          "bash": null
        },
        {
          "command": "Get-Content sales.txt | runthat connection add Sales --provider sqlserver --replace",
          "note": "Read it from a file instead",
          "bash": "runthat connection add Sales --provider sqlserver --replace < sales.txt"
        }
      ],
      "json": null
    },
    {
      "id": "connection-remove",
      "name": "connection remove",
      "area": "Connections",
      "usage": [
        "runthat connection remove <name>"
      ],
      "help": "Remove a named connection from this machine.",
      "description": "Removes a saved connection. Scripts that declare it then need a RUNTHAT_CONNECTION_<NAME> variable instead.",
      "options": [],
      "examples": [
        {
          "command": "runthat connection remove Sales",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "mcp",
      "name": "mcp",
      "area": "AI agents",
      "usage": [
        "runthat mcp [--folder <dir>]... [--read-only] [--timeout <seconds>]"
      ],
      "help": "Start an MCP server on stdin/stdout so AI agents can list, edit, import, lock, run and publish scripts in the given folders (default: the current folder). Connect with: claude mcp add runthat -- runthat mcp --folder <dir>",
      "description": "Serves the scripts in the given folders to AI agents over the Model Context Protocol (stdio). Every path must be inside a --folder; runs are always frozen; a run stops after the time limit and output is cut at 100,000 characters; secrets in scripts and output show as [redacted]; connection strings never pass through. Every call is logged to mcp.log in the runthat folder (%LOCALAPPDATA%\\runthat, or RUNTHAT_HOME).",
      "options": [
        {
          "name": "--folder",
          "value": "<dir>",
          "description": "A folder the agent may use. Default: the current folder.",
          "repeatable": true
        },
        {
          "name": "--read-only",
          "value": null,
          "description": "Offer only the read tools, so nothing runs and no file changes.",
          "repeatable": false
        },
        {
          "name": "--timeout",
          "value": "<seconds>",
          "description": "How long a run may take (default 120).",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "claude mcp add runthat -- runthat mcp --folder D:\\scripts",
          "note": "Add it to Claude Code",
          "bash": "claude mcp add runthat -- runthat mcp --folder ~/scripts"
        },
        {
          "command": "runthat mcp --folder . --read-only",
          "note": "Let an agent look but not change anything",
          "bash": null
        }
      ],
      "json": null
    },
    {
      "id": "help",
      "name": "help",
      "area": "Reference",
      "usage": [
        "runthat help [<command>] [--json]",
        "runthat --help"
      ],
      "help": "Show this help, or one command's options and samples. --json writes every command, option, directive and MCP tool as JSON.",
      "description": "Without a command, prints the usage of every command. With one, for example `runthat help lock` or `runthat help sources add`, prints its options and samples. --json writes the whole reference (commands, options, samples, directives, environment variables, exit codes and MCP tools) as one JSON object, which the runthat.dev command reference is built from.",
      "options": [
        {
          "name": "--json",
          "value": null,
          "description": "Write one JSON object to stdout instead of text.",
          "repeatable": false
        }
      ],
      "examples": [
        {
          "command": "runthat help lock",
          "note": null,
          "bash": null
        },
        {
          "command": "runthat help --json",
          "note": null,
          "bash": null
        }
      ],
      "json": null
    }
  ],
  "directives": [
    {
      "syntax": "#:package <Id>@<Version>",
      "description": "Pin a NuGet package to an exact version. runthat locks it and every indirect package with content hashes.",
      "examples": [
        "#:package Dapper@2.1.35",
        "#:package Microsoft.Data.SqlClient@7.1.2"
      ]
    },
    {
      "syntax": "#:property <Name>=<Value>",
      "description": "Set an MSBuild property. Without TargetFramework, new scripts target net10.0 (they need the .NET 10 SDK), and a locked script keeps the target its lock was made for. RuntimeIdentifiers locks platform-only packages for each platform listed.",
      "examples": [
        "#:property TargetFramework=net8.0",
        "#:property RuntimeIdentifiers=win-x64;linux-x64"
      ]
    },
    {
      "syntax": "#:connection <Name> [<kind>] [efcore]",
      "description": "Use one of this machine's named connections. It reaches the script as RUNTHAT_CONNECTION_<NAME>, and Db.<Name> is typed for the driver the script pins: await Db.Sales.OpenAsync() returns, for example, a SqlConnection. The kind (sqlserver, postgresql, mysql, sqlite, oracle) is needed only when the script has drivers for several databases. With efcore, Db.Sales.CreateContext() returns a typed DbContext built from <script>.schema.json. Connections.Get(\"Sales\") returns the plain string for any library.",
      "examples": [
        "#:connection Sales",
        "#:connection Sales sqlserver",
        "#:connection Sales efcore"
      ]
    }
  ],
  "environmentVariables": [
    {
      "name": "RUNTHAT_HOME",
      "description": "The folder runthat keeps its state in: hidden projects, saved connections, the schema cache, tools and mcp.log. Default: %LOCALAPPDATA%\\runthat on Windows. Set it to a temp folder in tests."
    },
    {
      "name": "RUNTHAT_CONNECTION_<NAME>",
      "description": "A connection string for a script that declares #:connection <Name> (letters and digits upper-cased, anything else _). runthat sets it from the saved connection; one that's already set wins, so set it on a CI server or for a published app."
    },
    {
      "name": "RUNTHAT_CLI",
      "description": "For the desktop app: the full path of the runthat executable to use instead of the copy installed with it or the one on the PATH."
    },
    {
      "name": "RUNTHAT_DEBUGGER",
      "description": "The netcoredbg executable or its folder for runthat debug, after --debugger and before the copy next to runthat or in its tools folder."
    }
  ],
  "exitCodes": [
    {
      "code": "script's own",
      "meaning": "run and debug return the script's exit code (an unhandled exception gives .NET's usual code)."
    },
    {
      "code": "0",
      "meaning": "The command did what it was asked. search, info and sources test also return 0 whenever they ran, even with no results or a feed that failed."
    },
    {
      "code": "1",
      "meaning": "runthat couldn't do it, with a message on stderr that starts with runthat: (for example a missing lock with --frozen, a failed check, a connection that won't open, or a package with no allowed feed in runthat sources)."
    },
    {
      "code": "2",
      "meaning": "A usage error: an unknown command or option, or a missing argument."
    }
  ],
  "jsonContracts": [
    {
      "command": "search",
      "shape": "{ version, query, prerelease, configFile, hasMapping, feeds: [{ name, url, results, hidden, problems }], packages: [{ id, latestVersion, description, authors, owners, totalDownloads, projectUrl, source, foundOn }], problems }",
      "notes": "One entry per package id, best matches first."
    },
    {
      "command": "info",
      "shape": "{ version, id, configFile, hasMapping, latestStable, latestPrerelease, feeds: [{ name, url, allowed, versions, problems }], versions: [{ version, prerelease, sources, published, downloads, deprecation, vulnerable, vulnerabilities }], selected, problems }",
      "notes": "selected has the chosen version's description, license, tags and dependencyGroups; null when there are no versions."
    },
    {
      "command": "sources",
      "shape": "{ version, script, configFile, configDescription, feeds: [{ name, url, enabled, definedIn, credentials }], mapping, locked, packages: [{ id, sources }], warning, configChain, editTarget, clearsAbove }",
      "notes": "Exits 1 when a package has no allowed feed."
    },
    {
      "command": "sources-change",
      "shape": "{ version, changed, message, notes, sources }",
      "notes": "Every sources edit (add, remove, enable, disable, map, unmap, clear-above). sources is what `runthat sources <script> --json` returns afterwards."
    },
    {
      "command": "sources-which",
      "shape": "{ version, id, feeds, rule, reason }",
      "notes": "feeds [] means restore will fail."
    },
    {
      "command": "sources-test",
      "shape": "{ version, name, url, ok, needsSignIn, message }",
      "notes": "Exits 0 whenever the test ran."
    },
    {
      "command": "debug",
      "shape": "{ version, exitCode, output, outputTruncated, breakpoints: [{ line, verified, boundLine, message }], hits: [{ line, file, stack, locals }], hitLimitReached, error }",
      "notes": "error is null, or { type, message, file, line, stack, locals } for an unhandled exception. The MCP tool debug_script returns the same object."
    }
  ],
  "mcpTools": [
    {
      "name": "list_scripts",
      "title": "List scripts",
      "readOnly": true,
      "destructive": false,
      "description": "Lists the C# scripts in the folders this server can use, with each script's pinned packages and whether it's locked. Paths are relative and can be passed to the other tools.",
      "parameters": []
    },
    {
      "name": "read_script",
      "title": "Read a script",
      "readOnly": true,
      "destructive": false,
      "description": "Returns a script's code, its lock file and the hash of its current content (pass it as expected_hash to save_script). Passwords, tokens and keys are shown as [redacted].",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script, relative to the first folder or absolute."
        }
      ]
    },
    {
      "name": "check_script",
      "title": "Check a script",
      "readOnly": true,
      "destructive": false,
      "description": "Checks this machine can run a script exactly as locked: directives, lock, .NET runtime, package restore from the feeds, and compiling. Returns one ok or FAIL line per step. Doesn't run the script.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "source",
          "type": "string",
          "required": false,
          "description": "For an exported copy: the source script, to check the copy is still up to date."
        }
      ]
    },
    {
      "name": "search_packages",
      "title": "Search NuGet packages",
      "readOnly": true,
      "destructive": false,
      "description": "Searches the package feeds a script restores from (its nearest nuget.config, with packageSourceMapping applied) and returns each package's id, latest version, feed, downloads and description. Use package_info to see every version, then add_package with an exact version.",
      "parameters": [
        {
          "name": "query",
          "type": "string",
          "required": true,
          "description": "Search words, for example 'json' or 'Polly'."
        },
        {
          "name": "take",
          "type": "integer",
          "required": false,
          "description": "How many results to return (1 to 20)."
        },
        {
          "name": "prerelease",
          "type": "boolean",
          "required": false,
          "description": "Include prerelease versions."
        },
        {
          "name": "script",
          "type": "string",
          "required": false,
          "description": "A script whose feeds to search. By default, the first folder's nuget.config applies."
        }
      ]
    },
    {
      "name": "package_info",
      "title": "Show a NuGet package's versions",
      "readOnly": true,
      "destructive": false,
      "description": "Lists every version of a package on a script's feeds, newest first, marking prerelease, deprecated and vulnerable ones, and shows one version's dependencies by target framework, license and advisories. Pick an exact version from it for add_package.",
      "parameters": [
        {
          "name": "id",
          "type": "string",
          "required": true,
          "description": "The package id, for example 'Newtonsoft.Json'."
        },
        {
          "name": "version",
          "type": "string",
          "required": false,
          "description": "The version to describe. By default, the newest stable one."
        },
        {
          "name": "script",
          "type": "string",
          "required": false,
          "description": "A script whose feeds to read. By default, the first folder's nuget.config applies."
        }
      ]
    },
    {
      "name": "which_feed",
      "title": "Which feed a package comes from",
      "readOnly": true,
      "destructive": false,
      "description": "Says which of a script's feeds a package may be restored from under its packageSourceMapping, the pattern that decided it, and why. An empty list means restore will fail for that package; fix it with map_package.",
      "parameters": [
        {
          "name": "script",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "id",
          "type": "string",
          "required": true,
          "description": "The package id, for example 'Newtonsoft.Json'."
        }
      ]
    },
    {
      "name": "list_connections",
      "title": "List database connections",
      "readOnly": true,
      "destructive": false,
      "description": "Lists the named database connections saved on this machine: each one's name and kind of database, never its connection string. A script uses one by declaring '#:connection Name' at the top, pinning the database's driver package, and opening it with 'await Db.Name.OpenAsync()' (or, with '#:connection Name efcore' and the EF Core provider, 'Db.Name.CreateContext()'). describe_database shows its tables and columns.",
      "parameters": []
    },
    {
      "name": "describe_database",
      "title": "Describe a database",
      "readOnly": true,
      "destructive": false,
      "description": "Lists the tables, views, procedures and functions of one of this machine's named connections (see list_connections), or, with 'table', that table's columns, keys and a C# record for its rows. Reads only the database's catalog, never its data, and never shows the connection string. The schema is cached; pass refresh=true after the database changes.",
      "parameters": [
        {
          "name": "connection",
          "type": "string",
          "required": true,
          "description": "The connection's name, as in '#:connection Sales'."
        },
        {
          "name": "table",
          "type": "string",
          "required": false,
          "description": "A table or view, as name or schema.name, to show its columns and a C# record for it."
        },
        {
          "name": "schema",
          "type": "string",
          "required": false,
          "description": "Only this schema (SQL Server or PostgreSQL schema, MySQL database, Oracle user)."
        },
        {
          "name": "refresh",
          "type": "boolean",
          "required": false,
          "description": "Read the schema from the database again instead of the cache."
        },
        {
          "name": "script",
          "type": "string",
          "required": false,
          "description": "A script that uses this connection with '#:connection Name efcore': also lists its EF Core model's DbSets, entity classes, properties and navigations, as the script must name them."
        }
      ]
    },
    {
      "name": "run_script",
      "title": "Run a script",
      "readOnly": false,
      "destructive": true,
      "description": "Runs a locked script and returns its exit code and output, including Dump() tables. Always runs frozen: exactly the versions in the lock, and an unlocked script is refused (use lock_script first). Runs have a time limit and an output cap. This runs real code on the user's machine.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "args",
          "type": "string[]",
          "required": false,
          "description": "Arguments passed to the script."
        }
      ]
    },
    {
      "name": "debug_script",
      "title": "Debug a script",
      "readOnly": false,
      "destructive": true,
      "description": "Runs a locked script under the debugger (netcoredbg, downloaded on first use), stopping at each breakpoint line to record the line, the call stack and the local variables, then going on. Returns JSON: {version, exitCode, output, outputTruncated, breakpoints: [{line, verified, boundLine, message}], hits: [{line, file, stack: [{name, file, line}], locals: [{name, type, value}]}], hitLimitReached, error: null or {type, message, file, line, stack, locals} for an unhandled exception}. Always runs frozen, like run_script, with the same time limit and output cap; values are cut to 1000 characters and secrets are redacted. A line with no code binds to the next line that has some (see boundLine). This runs real code on the user's machine.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "breakpoints",
          "type": "integer[]",
          "required": true,
          "description": "Line numbers in the script to stop at, for example [12, 30]."
        },
        {
          "name": "args",
          "type": "string[]",
          "required": false,
          "description": "Arguments passed to the script."
        },
        {
          "name": "max_hits",
          "type": "integer",
          "required": false,
          "description": "Stop recording after this many hits (default 50); the breakpoints are then removed and the script runs on."
        }
      ]
    },
    {
      "name": "lock_script",
      "title": "Lock a script",
      "readOnly": false,
      "destructive": false,
      "description": "Resolves a script's pinned packages and writes its lock file (<script>.lock.json next to it), recording every package with its content hash. Run this after changing #:package lines.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        }
      ]
    },
    {
      "name": "save_model",
      "title": "Save an EF Core model",
      "readOnly": false,
      "destructive": false,
      "description": "Saves the tables a script's EF Core connection ('#:connection Sales efcore') uses into <script>.schema.json next to it, from this machine's cached schema (refresh=true reads the catalog again). The script's Db.Sales.CreateContext() is built from that file, never from the database. Pick the tables the script needs: EF builds its model from all of them at the start of every run. Without tables it takes every table and view, up to 100. Commit the file with the script. Reads only the catalog, never data.",
      "parameters": [
        {
          "name": "script",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "connection",
          "type": "string",
          "required": true,
          "description": "The connection's name, as in '#:connection Sales efcore'."
        },
        {
          "name": "tables",
          "type": "string[]",
          "required": false,
          "description": "Tables and views to include, as name or schema.name. Leave out for all of them (up to 100)."
        },
        {
          "name": "schema",
          "type": "string",
          "required": false,
          "description": "Only this schema (SQL Server or PostgreSQL schema, MySQL database, Oracle user). A MySQL model needs one when the server has several."
        },
        {
          "name": "refresh",
          "type": "boolean",
          "required": false,
          "description": "Read the schema from the database again instead of the cache."
        }
      ]
    },
    {
      "name": "add_package",
      "title": "Add a NuGet package",
      "readOnly": false,
      "destructive": false,
      "description": "Adds a pinned '#:package Id@Version' line to a script and relocks it. The version must be exact (find one with search_packages). If the package can't be restored, the script is left unchanged.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "id",
          "type": "string",
          "required": true,
          "description": "NuGet package id, for example Dapper."
        },
        {
          "name": "version",
          "type": "string",
          "required": true,
          "description": "Exact version, for example 2.1.35."
        }
      ]
    },
    {
      "name": "export_script",
      "title": "Export a single-file copy",
      "readOnly": false,
      "destructive": false,
      "description": "Writes a single-file copy of a locked script with its lock embedded at the end, for sharing or deploying. The script and its lock file aren't changed. The copy runs anywhere with 'runthat run --frozen'.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "output",
          "type": "string",
          "required": false,
          "description": "Where to write the copy: a folder or a .cs file inside the allowed folders. Defaults to dist/<script>.cs next to the script."
        }
      ]
    },
    {
      "name": "save_script",
      "title": "Save a script",
      "readOnly": false,
      "destructive": true,
      "description": "Creates a .cs script, or replaces one with new text. To replace an existing script, pass the hash read_script returned as expected_hash: if the file changed since then, nothing is written. Packages must be pinned to exact versions. If the #:package lines (or the target framework) changed, the script is relocked, and if the restore fails the old script and lock are put back.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script, for example reports/sales.cs. Folders that don't exist yet are created."
        },
        {
          "name": "content",
          "type": "string",
          "required": true,
          "description": "The whole text of the script."
        },
        {
          "name": "expected_hash",
          "type": "string",
          "required": false,
          "description": "The hash read_script returned for the current file. Required to replace an existing script; leave it out to create a new one."
        }
      ]
    },
    {
      "name": "publish_script",
      "title": "Publish a script",
      "readOnly": false,
      "destructive": true,
      "description": "Compiles a locked script into a folder that runs on a machine with no package feeds (and, when self-contained, no .NET installed). Refused if any package would differ from the lock. Only replaces a folder runthat published before, or an empty one. Returns the folder.",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the script."
        },
        {
          "name": "runtime",
          "type": "string",
          "required": false,
          "description": "Runtime identifier, for example win-x64, linux-x64 or osx-arm64. Defaults to this machine's."
        },
        {
          "name": "self_contained",
          "type": "boolean",
          "required": false,
          "description": "Include the .NET runtime, so the target machine needs nothing installed."
        },
        {
          "name": "single_file",
          "type": "boolean",
          "required": false,
          "description": "Bundle the app into one executable."
        },
        {
          "name": "output",
          "type": "string",
          "required": false,
          "description": "The folder to publish into, inside the allowed folders. Defaults to dist/<script>-<runtime> next to the script."
        }
      ]
    },
    {
      "name": "import_linq",
      "title": "Import a .linq query",
      "readOnly": false,
      "destructive": false,
      "description": "Turns an existing .linq query file into a runthat script and locks it. Packages the query didn't pin get the version this machine already uses; if it has none, pass pins. Returns the new script's path and hash, and notes on anything that couldn't be carried over (for example a database connection to add with #:connection).",
      "parameters": [
        {
          "name": "path",
          "type": "string",
          "required": true,
          "description": "Path of the .linq file, inside the allowed folders."
        },
        {
          "name": "output",
          "type": "string",
          "required": false,
          "description": "The script to write: a .cs file or a folder inside the allowed folders. Defaults to the .linq file's name with .cs, next to it."
        },
        {
          "name": "pins",
          "type": "string[]",
          "required": false,
          "description": "Exact versions for packages the .linq file doesn't pin, for example [\"Dapper@2.1.35\"]."
        },
        {
          "name": "expected_hash",
          "type": "string",
          "required": false,
          "description": "To replace a script that already exists: the hash read_script returned for it."
        }
      ]
    },
    {
      "name": "add_feed",
      "title": "Add a package feed",
      "readOnly": false,
      "destructive": false,
      "description": "Adds a package feed to the nuget.config a script restores with (its nearest one, or a new nuget.config next to it, which starts with the feeds the script already used). The source is an https:// URL or a folder; a relative folder stays relative to the config file. Refuses a name that's already used. Never writes credentials. With packageSourceMapping on, map packages to the new feed with map_package.",
      "parameters": [
        {
          "name": "script",
          "type": "string",
          "required": true,
          "description": "Path of the script whose feeds to change."
        },
        {
          "name": "name",
          "type": "string",
          "required": true,
          "description": "The feed's name, for example 'acme'."
        },
        {
          "name": "source",
          "type": "string",
          "required": true,
          "description": "An https:// feed URL (usually ending in index.json) or a folder of .nupkg files."
        }
      ]
    },
    {
      "name": "remove_feed",
      "title": "Remove a package feed",
      "readOnly": false,
      "destructive": true,
      "description": "Removes a feed from the script's nuget.config, with its packageSourceMapping patterns, disabled entry and saved credentials in that file. Feeds from the user's or the machine's NuGet config aren't changed; the error says how to turn them off instead.",
      "parameters": [
        {
          "name": "script",
          "type": "string",
          "required": true,
          "description": "Path of the script whose feeds to change."
        },
        {
          "name": "name",
          "type": "string",
          "required": true,
          "description": "The feed's name."
        }
      ]
    },
    {
      "name": "map_package",
      "title": "Map packages to a feed",
      "readOnly": false,
      "destructive": false,
      "description": "Adds a packageSourceMapping pattern to the script's nuget.config, so matching packages come only from that feed. A pattern is an exact package id, a prefix ending in * (Contoso.*), or * for everything else. Once any pattern exists, packages that match none can't be restored: check with which_feed.",
      "parameters": [
        {
          "name": "script",
          "type": "string",
          "required": true,
          "description": "Path of the script whose feeds to change."
        },
        {
          "name": "pattern",
          "type": "string",
          "required": true,
          "description": "The pattern: an exact id, Prefix.*, or *."
        },
        {
          "name": "feed",
          "type": "string",
          "required": true,
          "description": "The feed's name."
        }
      ]
    },
    {
      "name": "unmap_package",
      "title": "Unmap packages from a feed",
      "readOnly": false,
      "destructive": true,
      "description": "Removes a packageSourceMapping pattern from the script's nuget.config: from one feed, or from every feed when feed is left out. When no pattern is left, packageSourceMapping is off and NuGet tries every enabled feed.",
      "parameters": [
        {
          "name": "script",
          "type": "string",
          "required": true,
          "description": "Path of the script whose feeds to change."
        },
        {
          "name": "pattern",
          "type": "string",
          "required": true,
          "description": "The pattern, exactly as mapped."
        },
        {
          "name": "feed",
          "type": "string",
          "required": false,
          "description": "The feed to remove it from. By default, every feed."
        }
      ]
    }
  ]
}
