KScript docs
The same guides kscript docs opens on your computer, where every example also has a Run button and the reference covers every package, element and method of the version you have.
kscript docsStart here
Getting startedThis page walks through KScript in ten minutes.InstallKScript is one program, kscript, that runs scripts, serves sites, checks code and builds apps.The .kscript formatKScript has two ways to write the same language.Projects and generatorsA project is a folder with a kscript.json in it.What changedKScript now has one way to write each thing.
Language
The languageThis is the reference for KScript 2 scripts: the core language every script and page has, the packages you import for the rest, and a few tips for…Types and validationKScript has built-in types for text that means something, called native types: email, url, ip, country, duration, color and two dozen more.TextText is a string: anything in quotes.NumbersA number is written as it reads: 42, 3.5, -7.ListsA list holds values in order: ['tea', 'milk', 'juice'], [3, 7, 9], or records such as [{ name: 'Ada', age: 36 }].MapsA map holds values under names, called keys: { name: 'Ada', age: 36 }.Error codesEvery problem kscript check and the editor report has a code, such as KS4001.
Websites
Web pageskscript serve runs a folder as a website.ComponentsA component is a reusable part of a KScript website.Routes and controllersKScript.Http turns kscript serve into a server framework.StylesheetsA stylesheet often repeats the same values: a brand colour and its lighter and darker shades, a spacing scale, the widths where a layout changes.Sign-inKScript.Auth gives a kscript serve app accounts that people sign in to.DatabasesKScript.Data lets you keep records in a database and read them back without writing SQL.CachingSome work is slow: a web request, reading a big file, a long calculation.Queues and jobsSome work shouldn't make a person wait: sending an email, resizing a picture, calling a slow API.MailMost apps send email: a welcome message, a receipt, a link to reset a password.SchedulingSome work runs at set times rather than when someone asks for it: pruning old sessions every hour, emailing a report at 03:00, checking a feed ever…
Apps and documents
Desktop appsKScript.UI lets a script open a native window on macOS, Windows or Linux.ProgramsWhen you share a script with someone, they shouldn't need to install kscript first.DocumentsKScript.Document writes scientific and professional documents: papers, reports, letters and invoices.App foldersMost apps keep a few files of their own: settings, saved data, a cache, recent files and logs.
Tools
TestingTests let you change code without worrying that you broke something.DebuggingWhen a script gives the wrong answer, echo will often tell you why.FormattingCode is easier to read when everyone lays it out the same way, and nobody should spend a review on spaces.StandardsA team usually wants every project to follow the same house style: the same lint rules, the same indent, the same line width.EditorsThe language server gives editors diagnostics, completion, hover, signature help, go to definition, find references,Coding agentsCoding agents such as Claude Code, Codex and Cursor work best when they know a project's own functions, types and rules.AI assistants (MCP)AI coding assistants know a lot of languages, but they may not know KScript, or the version you have.