KonsolScript

KonsolScript is a modern, lightweight embeddable scripting language built for tooling, automation, AI orchestration, and game scripting. Wire LLM APIs into automated pipelines, build AI-powered CLI tools, orchestrate multi-model workflows, or script interactive games — all with a clean, readable syntax that values clarity, portability, and extensibility.


I want to… Go to
Write .ks scripts Scripting Guide
Extend the engine or write a plugin Contributing Guide

What can you build?

From beginner CLI tools to AI-powered pipelines — KonsolScript's modules and plugins cover a wide range of real-world apps:

Full project ideas — beginner to advanced


Table of Contents

  1. What can you build? — app ideas you can ship with the built-in modules and plugins
  2. Kookbook — full project ideas, beginner to advanced
  3. Var — types, variables, literals, string interpolation, structs
  4. Preprocessor#define and #include (file and plugin)
  5. Operators
  6. Control flow — if/else, while, for, foreach, break, continue, switch/case
  7. Functions
  8. Array — fixed-size typed arrays
  9. Class — OOP classes with fields and methods
  10. Object — root class, Exception
  11. Error handling — try/catch/finally, throw
  12. Built-in modules — Konsol, Math, String, File, Time, List, Map, Json, Path, OS, Regex, Date, Hash, CSV
  13. Plugin system
  14. Plugins — curl, ws, net, sqlite, mysql, pg, redis, zip, crypto, jwt

Var

Variables, types, literals, string interpolation, multi-line strings, comments, and struct (UDT) definitions.

Full Var reference


Operators

Arithmetic, comparison, logical, bitwise, assignment, ternary, and precedence.

Full Operators reference


Control flow

See Control flow for if / else if / else, while, for, break, continue, switch / case, and foreach.


Functions

Define reusable blocks, return typed values, and call recursively. An optional main entry point is called automatically.

Full Functions reference


Array

Fixed-size typed arrays. Size is set at declaration and does not change.

Full Array reference


Class

Full OOP with fields and methods. Every user-defined class implicitly extends Object.

Full Class reference


Object

Object is the implicit root of every user-defined class, providing getType(), toString(), and isInstanceOf(). Exception extends Object and is used in try / catch.

Full Object reference


Error handling

try / catch / finally, throw, typed exceptions (MathException, ArrayException), and error output format.

Full Error handling reference


Built-in modules

All stdlib calls use the Module:Method(args) syntax. Methods that return a value follow the ByRef convention: pre-declare a receiver variable and pass it as the last argument.

Var:Number h;
Time:GetHour(h);
Konsol:Print(h);    // current hour
Module Description
Konsol Terminal I/O, process control, ASCII utilities
Math Numeric operations, trigonometry, random
String String manipulation — trim, split, replace, compare
File File open/read/write/close
Time Wall-clock time, process timer
List Dynamic resizable typed array
Map String-keyed dictionary
Json Parse, build, and serialize JSON
Path Path manipulation and filesystem queries
OS Working directory, env vars, process control, dir listing
Regex Pattern matching and capture groups
Date Unix-timestamp date arithmetic and formatting
Hash MD5, SHA-256, Base64
CSV Parse, build, and serialize CSV

Plugin system

Plugins are shared libraries that extend KonsolScript with new modules — no recompile of minks needed.

Plugin system guide


Available plugins

See plugins.md for the full list — curl, ws, net, sqlite, mysql, pg, redis, zip, crypto, jwt.


Notes