KScript docs
EN

Command line

Everything the kscript command does. kscript --help prints the same list.

CommandWhat it does
kscript <script>Run a script ($args holds the arguments; --env picks kscript.staging.json, .env.staging...). The word run can be left out. With no script, or a folder, it runs the main script: app.main in kscript.json, then main.kscript, then index.kscript.
kscript checkCheck scripts and pages without running them (no path: the current project).
kscript agentsWrite AGENTS.md and .kscript/agents from project code, packages and Markdown listed in agents.merge.
kscript watchRebuild everything the project makes from its code (the agent docs, the OpenAPI file http.openapi.file names, and more as packages add to it) each time a file changes, until Ctrl+C. kscript serve and the editor (on save) do the same.
kscript fmtTidy scripts and pages.
kscript testRun *.test.kscript and *.test.ks.xml tests.
kscript serveServe pages, and routes.kscript / api.kscript routes.
kscript workerRun queued jobs until stopped. Ctrl+C lets the running jobs finish first.
kscript queueLook after the queues: what is waiting, what failed and why, and run failed jobs again.
kscript scheduleRun the tasks of the schedule file (schedule.kscript) at their times: once for this minute, every minute until stopped, or list them.
kscript dbMigrations and seeders: write a migration from the models, run it on the database, undo it, and fill the tables.
kscript routesList the routes of a site.
kscript openapiWrite the OpenAPI 3.1 document for a site's routes, made from the code. kscript serve also answers /_openapi.json, /_openapi.yaml and /_api.
kscript docsOpen these docs: a local website with every package, element, command and method, and examples you can run.
kscript mcpServe these docs to AI coding assistants (Claude Code, Cursor, VS Code...) over MCP, offline.
kscript cssCompile .ks.css, .ks.scss and .ks.sass stylesheets.
kscript convertWrite the .kscript version of an XML script, or the reverse.
kscript repoRegister a GitHub repository that provides named libraries.
kscript libInstall a KScript source library or restore the project's pinned libraries.
kscript compileBuild programs that run without kscript.
kscript makeStart a new project, or generate a file: a route (added to the routes file), controller, request, middleware, view, mail, page, component, stylesheet, model, type, enum, window, config, test and more. kscript make --list shows them all, with their options.
kscript publishCopy a model a package ships, such as User, Guest or Ownable, into your models folder to change it, or write the migration for the database queue's tables or the database sessions table.
kscript ideSet up VS Code, Cursor, VSCodium or another editor.
kscript debugStart the step debugger (Debug Adapter Protocol over stdio).
kscript lspStart the language server (LSP over stdio).
kscript updateUpdate to the latest release.
kscript --versionShow the version of KScript that runs here, and switch between versions.

Every command takes these too. Colours, labels and tables are used only when the output is a terminal; piped output, files and CI logs get plain text.

OptionDescription
-h, --helpShow help: kscript help <command> (or kscript <command> --help) shows one command.
--versionShow the version of kscript.
--env nameThe environment for $config: lays kscript.<name>.json over kscript.json, reads .env.<name> and sets KSCRIPT_ENV.
--ansi | --no-ansiForce colours on, or turn them off. NO_COLOR and FORCE_COLOR do the same.
--stack-traceShow the .NET exception and stack trace behind an error (also KSCRIPT_STACK_TRACE=1).
--timings [file.json]Time the command and show where the time went: each phase, the calls that took longest and how often each ran. A file also saves them: timings.json for the numbers, timings.trace.json for Perfetto or chrome://tracing, timings.speedscope.json for speedscope.

#Running a script

Shell
kscript [run] [--env name] [--jit | --no-jit] [--debug [--break line]...] [script-or-folder] [script arguments]

Run a script ($args holds the arguments; --env picks kscript.staging.json, .env.staging...). The word run can be left out. With no script, or a folder, it runs the main script: app.main in kscript.json, then main.kscript, then index.kscript.

OptionDescription
--env nameThe environment for $config: lays kscript.<name>.json over kscript.json, reads .env.<name> and sets KSCRIPT_ENV.
--debugRun the script in the terminal debugger: it pauses before the first statement (or at each --break line), then steps a line at a time and prints variables.
--break lineRun the script in the debugger and pause at this line of it, or at file:line in another script. Give it once for each breakpoint.
--jit | --no-jitRun the script on the JIT runtime, which makes long loops and number work several times faster but starts about a third of a second slower. The release kscript downloads it the first time. "jit": true in kscript.json or KSCRIPT_JIT=1 does the same for every script; --no-jit turns it off.
Examples
CommandWhat it does
kscript hello.kscript JoanRuns hello.kscript with Joan as its first argument ($args[0]).
kscript run hello.kscript JoanThe same, with the command written out.
kscript runRuns the project's main script: app.main in kscript.json, or main.kscript, or index.kscript.
kscript . JoanRuns this folder's main script with Joan as $args[0].
kscript --env staging deploy.kscriptRuns deploy.kscript with the staging settings (kscript.staging.json and .env.staging).
kscript --debug --break 12 basket.kscriptRuns basket.kscript in the debugger, pausing at line 12.
kscript --jit solve.kscriptRuns solve.kscript on the JIT runtime, for a script that spends seconds in loops.
kscript --timings timings.trace.json basket.kscriptRuns basket.kscript, shows where the time went, and saves a trace to open in Perfetto.

More in The language.

#kscript check

Shell
kscript check [file-or-folder]... [--fix] [--all] [--warnings-as-errors] [--output text|json]

Check scripts and pages without running them (no path: the current project).

OptionDescription
--fixApply the fixes that are always safe (text in quotes, true and false, lists as arrays), then check what is left.
--allAnalyse every file. Without it, a project's files that nothing has changed for since the last check give the problems they gave then.
--warnings-as-errorsFail on warnings too, for CI (lint.warnings_as_errors in kscript.json does the same).
--output text|jsonHow to print the problems: text (the default), or json with each one's range and its fixes as exact text edits (for coding agents and tools).
--print-config [path]Show the lint and format settings that apply, and which standard set each.
Examples
CommandWhat it does
kscript checkChecks every script in the project for errors and warnings.
kscript check scripts/ --warnings-as-errorsChecks one folder, and fails on warnings too (for CI).
kscript check --fixFixes what can be fixed for you, such as old spellings, and reports the rest.

More in Lint standards.

#kscript agents

Shell
kscript agents [folder] [--check] [--print]

Write AGENTS.md and .kscript/agents from project code, packages and Markdown listed in agents.merge.

OptionDescription
--checkWrite nothing; fail if the agent docs are out of date (for CI).
--printPrint AGENTS.md's generated section instead of writing files.
Examples
CommandWhat it does
kscript agentsWrites AGENTS.md for coding agents from the project's code.
kscript agents --checkFails when AGENTS.md is out of date (for CI).

More in Coding agents.

#kscript watch

Shell
kscript watch [folder] [--once] [--check]

Rebuild everything the project makes from its code (the agent docs, the OpenAPI file http.openapi.file names, and more as packages add to it) each time a file changes, until Ctrl+C. kscript serve and the editor (on save) do the same.

OptionDescription
--onceBuild once and stop.
--checkWrite nothing; fail if anything is out of date (for CI).
Examples
CommandWhat it does
kscript watchKeeps the project's generated files up to date as you save.
kscript watch --checkAlso checks each file you save and prints its problems.

More in Coding agents.

#kscript fmt

Shell
kscript fmt [file-or-folder]... [--check]

Tidy scripts and pages.

OptionDescription
--checkOnly report files that would change, and fail if any would (for CI).
Examples
CommandWhat it does
kscript fmtFormats every script and page in the project.
kscript fmt --checkChanges nothing, and fails when a file isn't formatted (for CI).

More in Formatting.

#kscript test

Shell
kscript test [file-or-folder]... [--all | --failed | --changed [base]] [--watch] [--filter text] [--timeout s] [--junit file]

Run *.test.kscript and *.test.ks.xml tests.

OptionDescription
--allRun every test. Without it, a project run runs only the tests a change since the last run can affect.
--failedRun only the tests that failed in the last run.
--changed [base]Run only the tests git's changes can affect: the changes not committed yet, or everything since base (a branch, tag or commit).
--watch, -wKeep running: each time a file is saved, run the tests the change can affect.
--filter textOnly run tests whose name contains the text.
--timeout sStop a test that runs longer than this many seconds (default 10).
--junit fileAlso write a JUnit XML report, for CI.
Examples
CommandWhat it does
kscript testRuns the project's tests that a change since the last run can affect (all of them the first time).
kscript test --allRuns every test in the project.
kscript test --failedRuns the tests that failed last time.
kscript test --changed masterRuns the tests this branch's changes since master can affect.
kscript test --watchRuns the affected tests again each time you save.
kscript test tests/cart.test.kscript --filter totalRuns only the tests in one file whose names contain total.

More in Testing.

#kscript serve

Shell
kscript serve [site folder] [--docker | --no-docker] [--port 8080] [--host localhost] [--env name] [--no-reload] [--migrate] [--with-docs [--docs-port 4180]] [--with-worker] [--with-scheduler] [--no-jit]

Serve pages, and routes.kscript / api.kscript routes.

OptionDescription
--docker | --no-dockerLaunch the project's Compose service or serve locally. serve.docker sets the default.
--migrateApply pending database migrations before the server starts.
--no-reloadDisable automatic browser reload when site source or assets change. Production and compiled sites never inject the reload script.
--port, -p NThe port to listen on (default 8080, or serve.port in kscript.json).
--host HThe address to listen on: localhost (default), 0.0.0.0 or * for every address.
--env nameThe environment for $config.
--with-docsAlso serve the docs on localhost, with a page about this project: its conventions, routes, and the functions, types and constants its scripts declare. serve.docs in kscript.json turns it on by default; --no-docs turns it off. Never for compiled programs or the production environment.
--docs-port NThe port for the docs (default 4180, or a free one if that is in use).
--with-workerAlso run a queue worker in the server's process, for working on a site: it runs the jobs routes dispatch, including on the memory connection.
--with-schedulerAlso run the schedule file's tasks at their times, as kscript schedule work does, while the server runs.
--no-jit | --jitServe from the installed kscript instead of the JIT runtime. The release kscript hands the server to the JIT runtime (downloaded the first time), whose compiler makes busy routes several times faster; "jit": false in kscript.json or KSCRIPT_JIT=0 does the same as --no-jit.
Examples
CommandWhat it does
kscript serveServes the project on http://localhost:8080, reloading as you save.
kscript serve site --port 3000Serves the site folder on port 3000.
kscript serve --with-docsAlso serves these docs, with a page about your project, on a second port.
kscript serve --with-workerAlso runs a queue worker, so queued jobs run while you work.
kscript serve --with-worker --with-schedulerAlso runs the scheduled tasks, and a worker for the jobs they dispatch.

More in Web pages.

#kscript worker

Shell
kscript worker [--connection name] [--queue a,b] [--concurrency n] [--once] [--stop-when-empty] [--max-jobs n] [--max-time 1h] [--sleep 1s]

Run queued jobs until stopped. Ctrl+C lets the running jobs finish first.

OptionDescription
--connection, -c nameThe connection in queue.connections to work (default queue.default).
--queue, -q a,bThe queues to check, first to last (default queue.queues, else default and then every other queue).
--concurrency nHow many jobs to run at once (default queue.worker.concurrency, else 1).
--onceRun one job, if there is one, then stop: handy from cron.
--stop-when-emptyStop once every queue is empty instead of waiting for more jobs.
--max-jobs nStop after this many jobs.
--max-time tStop after this long, such as 1h.
--sleep tHow long to wait when the queues are empty (default 1s).
--project folderThe project to work on (default: the current folder's).
Examples
CommandWhat it does
kscript workerRuns queued jobs until you stop it.
kscript worker --queue high,default --concurrency 4Takes jobs from high before default, four at a time.
kscript worker --stop-when-emptyRuns the jobs waiting now, then stops (for CI or a scheduled task).

More in Queues and jobs: KScript.Queue.

#kscript queue

Shell
kscript queue status|list [queue]|failed|retry <id>|delete <id>|clear [queue] [--all] [--connection name] [--output text|json]

Look after the queues: what is waiting, what failed and why, and run failed jobs again.

OptionDescription
statusWaiting, delayed, running and failed jobs per queue.
list [queue]The waiting jobs with their fields.
failedThe failed jobs with their errors.
retry <id> | --allPut failed jobs back on their queues, with their tries reset.
delete <id> | --allDelete failed jobs.
clear [queue]Remove the waiting jobs of a queue (or of every queue).
--connection, -c nameThe connection to look at (default queue.default).
--project folderThe project to look at (default: the current folder's).
--output text|jsonHow to print: text (a table, the default) or json.
Examples
CommandWhat it does
kscript queue statusShows how many jobs are waiting, running and failed in each queue.
kscript queue failedLists the failed jobs with their errors.
kscript queue retry --allPuts every failed job back on its queue.

More in Queues and jobs: KScript.Queue.

#kscript schedule

Shell
kscript schedule run [--task name]|work|list [--file path] [--project folder]

Run the tasks of the schedule file (schedule.kscript) at their times: once for this minute, every minute until stopped, or list them.

OptionDescription
runRun the tasks due this minute, then stop: for a system cron line that runs it every minute.
run --task nameRun one task now, whether or not it is due.
workRun the due tasks at the start of every minute until Ctrl+C, which lets running tasks finish.
listEach task with when it runs, what it does and its next run.
--file pathThe schedule file (default schedule.kscript, or routes/schedule.kscript).
--project folderThe project whose schedule to run (default: the current folder's).
Examples
CommandWhat it does
kscript schedule workRuns the scheduled tasks at their times until you stop it.
kscript schedule listShows each task and when it next runs.
kscript schedule run --task prune-sessionsRuns one task now, to try it.

More in Scheduling tasks.

#kscript db

Shell
kscript db diff [name] [--syntax kscript|xml]|migrate|rollback [--steps n]|status [--output text|json]|fresh [--seed]|seed [name] [--pretend] [--force]

Migrations and seeders: write a migration from the models, run it on the database, undo it, and fill the tables.

OptionDescription
diff [name]Write a migration to database/migrations with the changes the models want that the migrations don't make yet.
migrateRun the migrations that haven't run, as one batch. --seed runs the seeders after.
rollbackUndo the last batch. --steps n undoes the last n migrations, --all every one.
statusWhich migrations have run, and the changes the models want that no migration makes.
freshDrop every table and run every migration again. --seed runs the seeders after.
seed [name]Run the seeders in database/seeders (or the one named).
--seedWith migrate or fresh: run the seeders after.
--steps nWith rollback: undo the last n migrations.
--allWith rollback: undo every migration.
--pretendPrint the SQL instead of running it (migrate, rollback, fresh: nothing is dropped), or the migration instead of writing it (diff).
--forceGo ahead in the production environment without asking.
--output text|jsonHow status prints: text (a table, the default) or json.
--syntax kscript|xmlThe syntax diff writes the migration in: .kscript (the default, or make.syntax in kscript.json) or .ks.xml.
--project folderThe project to work on (default: the current folder's).
Examples
CommandWhat it does
kscript db diffWrites a migration for what changed in the models since the last one.
kscript db migrateRuns the migrations that haven't run yet.
kscript db rollbackUndoes the last batch of migrations.
kscript db fresh --seedDrops every table, runs all the migrations again and fills the tables from the seeders.

More in Databases: KScript.Data.

#kscript routes

Shell
kscript routes [site folder] [-v] [--output text|json]

List the routes of a site.

OptionDescription
-v, --verboseAlso show each route's middleware, and the file and line it is declared on.
--output text|jsonPrint the route table as text, or return structured HTTP routes and file-based pages as JSON.
Examples
CommandWhat it does
kscript routesLists the project's routes: method, path, name and what answers it.
kscript routes samples/http-app -vLists a site's routes with their middleware and where each is declared.
kscript routes --output jsonPrints the routes and file pages as JSON, for scripts and tools.

More in Routes and APIs.

#kscript openapi

Shell
kscript openapi [site folder] [--output json|yaml] [--out file]

Write the OpenAPI 3.1 document for a site's routes, made from the code. kscript serve also answers /_openapi.json, /_openapi.yaml and /_api.

OptionDescription
--output json|yamlHow to print the document: json (the default) or yaml (also chosen by an --out file ending in .yaml or .yml).
--out fileWrite to a file instead of the terminal.
Examples
CommandWhat it does
kscript openapiPrints the OpenAPI document for the project's routes, as JSON.
kscript openapi --output yaml --out openapi.yamlWrites it to openapi.yaml as YAML.

More in Routes and APIs.

#kscript docs

Shell
kscript docs [search words] [--port 4180] [--syntax kscript|xml] [--no-open] [--project] [--export-to folder [--published] [--hide list] [--config file] [--versions url] [--stylesheet url]] [--translate folder --locales folder [--langs list] [--missing file | --import file [--prune] | --check]]

Open these docs: a local website with every package, element, command and method, and examples you can run.

OptionDescription
--port, -p NThe port to serve the docs on (default 4180, or a free port if that one is taken).
--syntax kscript|xmlShow examples as .kscript or XML (default: the project's make.syntax, else .kscript).
--no-openDon't open a browser; just print the address.
--projectWrite .kscript/docs/project.md, the docs of this project's own code (its conventions, routes, functions and types). From then on kscript watch, kscript serve and saving in the editor keep it up to date.
--export-to folderWrite the whole docs site into a folder as plain files that work offline: open its index.html in a browser, no server or network needed. Search works; examples can't run, so each one carries a hidden placeholder for a runner of your own.
--publishedWith --export-to: a copy for a website, read as the product's documentation: no playground, no "Edit this page on GitHub" links, and no notes about how it was made.
--hide listWith --export-to: pages and reference entries to leave out, with every link to them, separated by commas: playground, /guide/editor, /reference/methods/* (every page under a path), /reference/ai#ask (one entry), or edit-links.
--config fileWith --export-to: a JSON file that shapes the copy, with published, hide, pages (replace a page with your Markdown), before and after (add Markdown under a page's title or at its end), files (a folder of pictures and other files to copy in), versions, stylesheet and syntax.
--versions urlWith --export-to: a JSON list of published versions, {"latest": "0.55.0", "versions": [...]}, that turns the version in the header into a picker. Each version's copy is a folder named after it, side by side.
--stylesheet urlWith --export-to: a stylesheet to load after the docs' own, so they match the site they're put on.
--translate folderWrite a copy of exported docs in each language of --locales, in <folder>/<lang>/, with a language menu on every page. Words are translated; code, links and ids stay as they are.
--locales folderWith --translate: the translations, a folder per language with JSON files in it, as a site's locales are.
--langs listWith --translate: the languages, separated by commas (default: every folder in --locales).
--missing fileWith --translate: write the text that has no translation yet to a file, to be filled in, instead of the copies.
--import fileWith --translate: check the translations filled in to a --missing file and add them to --locales.
--pruneWith --import: drop translations the docs no longer use.
--checkWith --translate: fail if any text has no translation, instead of writing the copies.
Examples
CommandWhat it does
kscript docsOpens these docs in your browser.
kscript docs replaceOpens them at the search results for replace.
kscript docs --syntax xmlShows the examples in XML.
kscript docs --projectWrites .kscript/docs/project.md about this project's own code, and keeps it up to date.
kscript docs --export-to kscript-docsWrites the docs into the kscript-docs folder, to read offline or put on any web server.
kscript docs --export-to public/docs --config docs.jsonWrites a copy shaped by docs.json: pages hidden, added to or replaced, for your website.

#kscript mcp

Shell
kscript mcp [--syntax kscript|xml] [--dir folder] [--http [--port 4181]]

Serve these docs to AI coding assistants (Claude Code, Cursor, VS Code...) over MCP, offline.

OptionDescription
--syntax kscript|xmlShow examples as .kscript or XML (default: the project's make.syntax, else .kscript).
--dir folderThe project whose kscript.json sets the syntax and the check and fmt rules (default: the current folder).
--httpServe on http://localhost:4181/mcp instead of stdin and stdout.
--port, -p NThe port for --http (default 4181).
Examples
CommandWhat it does
claude mcp add kscript -- kscript mcpAdds the KScript docs to Claude Code.
kscript mcp --httpServes them on http://localhost:4181/mcp for clients that connect over HTTP.

More in AI assistants (MCP).

#kscript css

Shell
kscript css [file-or-folder]... [--out folder] [--var name=value]

Compile .ks.css, .ks.scss and .ks.sass stylesheets.

OptionDescription
--out folderWhere to write the .css files (default: next to each stylesheet).
--var name=valueSet a stylesheet variable; repeat for more.
Examples
CommandWhat it does
kscript css styles/ --out publicCompiles every stylesheet in styles/ into public/.
kscript css styles/ --var brand=#3355ffCompiles them with $vars.brand set to #3355ff.

More in Stylesheets.

#kscript convert

Shell
kscript convert <file-or-folder>... [--syntax kscript|xml] [--out file] [--stdout] [--force]

Write the .kscript version of an XML script, or the reverse.

OptionDescription
--syntax kscript|xmlThe syntax to write (default: the other one).
--out, -o fileWhere to write the result, for one file (default: next to it, with the new extension).
--stdoutPrint the result instead of writing a file.
--force, -fReplace a file that is already there.
Examples
CommandWhat it does
kscript convert hello.ks.xmlWrites hello.kscript beside the XML script.
kscript convert hello.kscript --syntax xml --stdoutPrints the XML version instead of writing a file.

More in The .kscript format.

#kscript repo

Shell
kscript repo add <owner/repo|github-url>

Register a GitHub repository that provides named libraries.

Examples
CommandWhat it does
kscript repo add acme/kscript-librariesAdds a GitHub repository that publishes libraries to this project.
kscript lib add acme/kscript-libraries@slugsInstalls the slugs library from it.

More in Projects and kscript.json.

#kscript lib

Shell
kscript lib add <library|owner/repo@library|owner/repo|github-url>
kscript lib restore

Install a KScript source library or restore the project's pinned libraries.

Examples
CommandWhat it does
kscript lib add isolink-connectFinds a library by name and installs it.
kscript lib add waggr-gb/isolink-connect@isolink-connectInstalls a library from one repository, without searching.
kscript lib restoreInstalls the libraries kscript.json lists, at their recorded commits.

More in Projects and kscript.json.

#kscript compile

Shell
kscript compile [script or folder] [--target mac-arm64,win-x64,linux-x64|all] [--out dist] [--to exe]

Build programs that run without kscript.

OptionDescription
--target name[,name]mac-arm64, mac-x64, linux-x64, linux-arm64, win-x64, or all (default: this computer).
--out folderWhere programs go (default: dist/ next to the script or kscript.json), one folder per target.
--name "My App"The program's name (default: the app section of kscript.json, or the script's name).
--runtime fileA kscript release binary or archive for the target, instead of downloading one.
--to exeWhat to make: exe, a program, is the default and the only choice so far.
Examples
CommandWhat it does
kscript compile hello.kscriptBuilds hello.kscript into a program for this computer.
kscript compile --target allBuilds the project for macOS, Windows and Linux.

More in Programs: kscript compile.

#kscript make

Shell
kscript make project [folder] [--template web|api|fullstack|bare] [--db sqlite] [--auth] [--docker] [--examples]
kscript make <type> <name> [--key value]
kscript make auth [--passkeys] [--origin URL] [--rp-id DOMAIN] [--api]
kscript make --list

Start a new project, or generate a file: a route (added to the routes file), controller, request, middleware, view, mail, page, component, stylesheet, model, type, enum, window, config, test and more. kscript make --list shows them all, with their options.

OptionDescription
--listEvery type of file kscript make can make, with its options and examples. kscript make <type> --help shows one.
--template namekscript make project: web (the default), api (a JSON API), fullstack (pages and their API) or bare. With no options at a terminal, a setup wizard asks.
--examplesAdd the optional Notes example to a fullstack project.
-n, --no-interactionkscript make project: ask nothing, and take the defaults.
--syntax kscript|xmlWrite .kscript (the default) or .ks.xml files.
--dry-runShow what would be made, and make nothing.
--forceReplace a file that is already there.
--key valueValues for the template, such as --resource or --fields "name: string".
--model Namekscript make controller: fill the resource actions in with the model's records (Post->paginate, ->find_or_fail, ->create, ->update, ->delete).
--policy, --migration, --controller, --seeder, --allkscript make model: also make its policy, the migration for its table (with kscript db diff), a resource controller for it, a seeder, or all of them with --component.
Examples
CommandWhat it does
kscript make project my-siteMakes a new project in my-site, asking what it needs.
kscript make project shop --template api --db postgres --dockerMakes an API project on Postgres, with Docker files.
kscript make route users --apiAdds an API route for users and its controller.
kscript make controller people --resourceMakes a controller with the index, show, store, update and destroy actions.
kscript make model Post --fields "title: string" --allMakes the Post model with its policy, migration, controller, seeder and component.
kscript make mail welcome --vars nameMakes views/mail/welcome.html, an email's view for @send_mail.

Every type it makes, with its options: kscript make commands.

More in Projects and kscript.json.

#kscript publish

Shell
kscript publish [model...|queue|sessions] [--syntax kscript|xml] [--force] [--dry-run] [--dir <folder>] [--connection <name>]

Copy a model a package ships, such as User, Guest or Ownable, into your models folder to change it, or write the migration for the database queue's tables or the database sessions table.

OptionDescription
--syntax kscript|xmlWrite a .kscript (the default) or .ks.xml file.
--forceReplace the project's copy with the package's again.
--dry-runShow where the copy would go, and write nothing.
--dir <folder>Use the project in this folder instead of the current one.
--connection <name>With queue: the database queue connection whose tables to write (default: database).
Examples
CommandWhat it does
kscript publishLists the models and mixins the packages ship, and which ones the project has its own copy of.
kscript publish UserCopies KScript.Auth's User model to models/user.kscript.
kscript publish queueWrites the migration that makes the database queue's tables, so kscript db migrate makes them.
kscript publish sessionsWrites the migration for the table database sessions are kept in, and sets http.auth.sessions to database.

More in Projects and kscript.json.

#kscript ide

Shell
kscript ide [install|uninstall|config] [editor] [--version <tag>] [--vsix file]

Set up VS Code, Cursor, VSCodium or another editor.

OptionDescription
--version tagWith install: the extension of a specific release, such as v0.3.0 (default: the one for this kscript).
--vsix fileWith install: an extension file you already have, instead of downloading one.
Examples
CommandWhat it does
kscript ide installInstalls the KScript extension in every editor it finds.
kscript ide config neovimPrints the settings to use the language server in Neovim.

More in Install and editors.

#kscript debug

Shell
kscript debug

Start the step debugger (Debug Adapter Protocol over stdio).

Examples
CommandWhat it does
kscript debugStarts the debugger. VS Code runs it for you when you press F5 in a script.

More in Debugging.

#kscript lsp

Shell
kscript lsp

Start the language server (LSP over stdio).

Examples
CommandWhat it does
kscript lspStarts the language server. Editors run it for you; kscript ide config shows how.

More in Install and editors.

#kscript update

Shell
kscript update [--check] [--force] [--no-ide]

Update to the latest release.

OptionDescription
--checkOnly report whether there is a newer release.
--forceInstall even if this version is already the latest.
--no-ideLeave the KScript extension in your editors as it is.
Examples
CommandWhat it does
kscript updateUpdates kscript and its editor extension to the latest release.
kscript update --checkSays whether there is a newer release, without installing it.

More in Install and editors.

#--version and --help

Shell
kscript version [list [--available]]
kscript version install|use|pin|remove <version>
kscript version unpin
kscript version jit

Show the version of KScript that runs here, and switch between versions.

OptionDescription
--availableWith list: every release on GitHub, newest first, not only the ones on this computer.
jitDownload this version's JIT runtime now, the one kscript serve and --jit run on, so they don't download it the first time they run (for Docker images and CI).
Examples
CommandWhat it does
kscript versionShows the version that runs here, and what chose it: the project's kscript.json, KSCRIPT_USE or this computer's default.
kscript version use 0.50.0Runs KScript 0.50.0 everywhere on this computer, downloading it if it isn't here yet.
kscript version pin 0.50Writes "kscript": "0.50" into the project's kscript.json, so the project runs the newest 0.50.x for everyone.
kscript version list --availableLists every release, marking the ones on this computer.
kscript version jitDownloads the JIT runtime that kscript serve runs on, ahead of time.
kscript --versionPrints just the version number that runs here.

More in Install and editors.