KonsolScript

Ship once. Evolve forever.

Embeddable scripting runtime for games, tools, AI orchestration, and live-updating applications.

KonsolScript badge KonsolScript: Automate and Orchestrate

Download KonsolScript: Automate and Orchestrate Download KonsolScript: Automate and Orchestrate


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

The AI never touched the game binary

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.

AI Event Bridge demo


Why KonsolScript?


See it in action

#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


What can you build?

Full project ideas - beginner to advanced


Batteries included

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

All plugins


Embed in minutes

#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.

Full embedding guide


Built for the AI era

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);
});

Eval guard and security


Language reference

  1. Var - types, variables, literals, string interpolation, structs
  2. Preprocessor - #define and #include (file and plugin)
  3. Operators - arithmetic, comparison, logical, bitwise, ternary
  4. Control flow - if/else, while, for, foreach, break, continue, switch/case
  5. Functions - define, return, recursion, typed params, entry point
  6. Array - fixed-size typed arrays
  7. Class - OOP classes with fields and methods
  8. Object - root class for all user-defined classes
  9. Exception - built-in error carrier for try / catch
  10. Error handling - try/catch/finally, throw
  11. Built-in modules - Konsol, Math, String, File, Time, List, Map, Json, Path, OS, Regex, Date, Hash, CSV
  12. Plugin system
  13. Plugins - curl, ws, net, sqlite, mysql, pg, redis, zip, crypto, jwt

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 for the full list - curl, ws, net, sqlite, mysql, pg, redis, zip, crypto, jwt.


Notes