Contents
Every guide and every topic in it. Each topic has its own page; the names under it link to the place in the guide. For every built-in name, see the A to Z.
Start here
Getting started
- Your first script
- Variables
- Lists and maps
- Decisions and loops
- Functions
- Errors
- Packages
- Asking for input
- The .kscript format and XML
- Where next
Install and editors
- Introduction
- Installing
- Updating
- Switching versions
- Checking downloads
- Installing by hand
- Running scripts
- Reading the docs
- Editor support
Language
The language
- Introduction
- Variables and output
- Expressions
- Control flow
- Functions
- Typed data
- Values and methods
- Errors
- Settings: $config
- Logging: $log
- Translations: @t()
- Packages
- Language models: KScript.AI
- How scripts run
- Writing portable scripts
The .kscript format
- Introduction
- Assignment
- Statements
- Long strings and blocks of text
- Rules
- Doc comments
- Converting
- Editors
- Formatting
Types and validation
- Introduction
- Text with a meaning of its own
- More native types
- Operators on native types
- Values without quotes
- Slash paths
- File paths
- CSV
- Date formats
- Passwords
- Arguments where a type is used
- Refinement types
- Joined types
- Constructors
- Private fields and methods
- Types read from text
- Regular expressions
- Built-in functions that take these types
- In XML
- Ideas for later
Build
Web pages
- Introduction
- Templates
- Routing
- The request
- KScript in pages
- Template props and component scripts
- Reactive pages with <live> (no JavaScript)
- Model forms
- Docs while you work
Components
- Introduction
- Build your first component
- Component styles
- Component inputs, rendering and slots
- How a live update works
- State and binding
- Components in windows and the terminal
- Components in documents
- Actions and browser events
- Forms, uploads and loading feedback
- Focus, growing text and pending classes
- Nesting, identity and lazy rendering
- In-page navigation
- Stream an action's output
- Portals
- Client-side extensions
- Test a component
- Troubleshoot
- Coming from Livewire 4
Routes and APIs
- Introduction
- Basic routing
- Route parameters
- Named routes
- Route groups
- Controllers
- Views
- Middleware
- Signed URLs
- Rate limiting
- Caching and ETags
- Resources
- The request
- Responses
- Calling your own API
- Settings: kscript.json
- API docs: OpenAPI
- In the editor
- How it runs
Desktop apps
Programs: kscript compile
- Introduction
- What a program holds
- Targets
- Names, icons and versions
- On each platform
- Sites
- Other languages
Stylesheets
App folders: KScript.Storage
Caching: KScript.Cache
Databases: KScript.Data
- Introduction
- Models
- Built-in models and mixins
- Creating and updating records
- Queries
- Relations
- Transactions
- Raw SQL
- Connections
- Errors
- Migrations
- Testing with a database
- Making a model
- With the rest of KScript
- In the editor
Sign-in: KScript.Auth
- Introduction
- What kscript make auth writes
- Pages made of components
- Signing up and in
- Passkeys
- Signing in to other apps (OpenID Connect)
- Signing in with another site's account
- Protecting routes
- Policies
- Forms and CSRF
- The session
- Users
- Guests and owners
- Password resets
- Email verification
- API tokens
- Settings: kscript.json
Queues and jobs: KScript.Queue
- Introduction
- Creating jobs
- Job options
- Dispatching jobs
- Job middleware
- Events and listeners
- Controlling a running job
- Connections and drivers
- Running workers
- Managing queues
- Testing jobs
- Errors
Mail: KScript.Mail
Scheduling tasks
Documents: KScript.Document
- Introduction
- Saving documents
- Documents from source
- Templates
- Writing text
- Structure
- Maths
- Tables
- Figures
- Citations and references
- Footnotes and cross-references
- Markdown
- LaTeX
- Parts as components
- Letters and invoices
- Page and style
- Fonts and characters
- Commands
Testing
- Introduction
- Writing tests
- Checks
- Running tests
- Running only what changed
- Settings in kscript.json
- Testing an API
- Faking a language model
- Testing who may do what
- Learning from the language tests
- In the editor
Debugging
- Introduction
- Starting the debugger
- Breakpoints
- Stepping through a script
- The Variables view
- Pausing on errors
- launch.json
- Debugging in the terminal
- Other editors
- What the debugger doesn't do yet
Tools
Projects and kscript.json
- Introduction
- Starting a project: kscript make project
- Installing source libraries
- Project settings: kscript.json
- Generating files: kscript make
- Exit codes
Formatting
- Introduction
- What it changes
- What it keeps
- Settings
- Turning rules off
- Leaving part of a file alone
- In the editor
- Project rules
Lint standards
- Introduction
- Built-in standards
- Writing a standard
- Which setting wins
- Fixing what can be fixed
- Checking only what changed
- Seeing the result
Error codes
- The shape of the file
- KS1001
- KS1002
- KS1003
- KS1004
- KS1005
- Values
- KS1006
- KS2001
- KS2002
- KS2003
- KS2004
- KS2005
- KS2006
- Statements
- KS3001
- KS3002
- KS3003
- KS3004
- KS3005
- KS3006
- KS3007
- KS3008
- KS3009
- KS3010
- KS3011
- KS3012
- Names
- KS4001
- KS4002
- KS4003
- KS4004
- KS4005
- KS4006
- KS4007
- KS4008
- Calls
- KS5001
- KS5002
- KS5003
- KS5004
- KS5005
- KS5006
- KS5007
- KS5008
- KS5009
- KS5010
- KS5011
- KS5012
- KS5013
- KS5014
- KS5015
- KS5016
- KS5017
- KS5018
- KS5019
- Style
- KS6001
- KS6002
- KS6003
- KS6004
- KS6005
- KS6006
- KS6007
- KS6008
- KS6009
- KS6010
- KS6011
- KS6012
- KS6013
- KS6014
- KS6018
- KS6019
- KS6020
- KS6021
- KS6022
- KS6023
- KS6024
- KS6025
- KS6026
AI assistants (MCP)
Coding agents
- Introduction
- Implementing a feature in an existing project
- Watching
- What gets written
- Adding project guidance
- Made from the code
- Agent tags
- Notes on built-in commands
- JSON diagnostics
- CI
More
What changed
- Text, names and values
- Statements and operators
- Types, models and errors
- Ownable rows and file users
- Statements that were renamed
- Statements that became commands
- Arguments
- Commands
- Methods and fields
- The command line
- kscript.json
- Names
- Files