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 |
From beginner CLI tools to AI-powered pipelines — KonsolScript's modules and plugins cover a wide range of real-world apps:
File, Path, OS)CSV, Json, List)curl, Json, File)Regex, curl, Json)→ Full project ideas — beginner to advanced
#define and #include (file and plugin)Variables, types, literals, string interpolation, multi-line strings, comments, and struct (UDT) definitions.
Arithmetic, comparison, logical, bitwise, assignment, ternary, and precedence.
See Control flow for if / else if / else, while, for, break, continue, switch / case, and foreach.
Define reusable blocks, return typed values, and call recursively. An optional main entry point is called automatically.
Fixed-size typed arrays. Size is set at declaration and does not change.
Full OOP with fields and methods. Every user-defined class implicitly extends 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.
try / catch / finally, throw, typed exceptions (MathException, ArrayException), and error output format.
→ Full Error handling reference
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 |
Plugins are shared libraries that extend KonsolScript with new modules — no recompile of minks needed.
See plugins.md for the full list — curl, ws, net, sqlite, mysql, pg, redis, zip, crypto, jwt.
MathException — catch with catch (MathException e).ArrayException — catch with catch (ArrayException e). e.code holds the attempted index.#include "file.ks" is fully supported with transitive includes and include-guard deduplication. See Preprocessor.main() are properly scoped and cleaned up after main returns.Math:Random uses srand/rand; not cryptographically secure. Use Math:Seed(n) for reproducible sequences.String:Mid uses 1-based start index (like BASIC), not 0-based.