Ship once. Evolve forever.
Embeddable scripting runtime for games, tools, AI orchestration, and live-updating applications.
| I want to… | Go to |
|---|---|
Write .ks scripts |
Scripting Guide |
| Extend the engine or write a plugin | Contributing Guide |
A designer types: "spawn an ice storm with golems"
An AI generates KonsolScript. The script is sent over the network. The running game reacts - live.
DemoGame:SetWeather("blizzard");
DemoGame:SpawnWave("ice_golem", 4);
DemoGame:PlaySound("thunder_rumble");
No rebuild. No redeploy. The binary never changed.
#include "kse_curl"
Var:String body;
Curl:Get("https://api.weather.gov", body);
Konsol:Print(body);
→ Hello World demos - fetch + JSON, AI chat, number guessing game, AI log triage
.ks scripts→ Full project ideas - beginner to advanced
Built-in: Console · Math · String · File · Time · List · Map · JSON · Path · OS · Regex · Date · Hash · CSV
Plugins: HTTP · WebSockets · TCP · SQLite · MySQL · PostgreSQL · Redis · Zip · Crypto · JWT
#include "kse.hpp"
Engine engine;
engine.loadScript(source, "./scripts", "main.ks");
engine.run();
// Hot-reload changed logic without restarting:
engine.reloadFile("scripts/ai_behavior.ks");
Turn your application into a programmable platform.
AI systems need a safe surface to act on. KonsolScript provides one.
// Only allow scripts from the trusted AI service - reject everything else.
engine.setEvalGuard([&](const std::string& src) -> bool {
return verifyHmacSignature(src, sharedSecret);
});
#define and #include (file and plugin)try / catchAll 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 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.