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 apiKey;
OS:GetEnv("ANTHROPIC_API_KEY", apiKey);
Var:String prompt = "Explain KonsolScript in one sentence.";
Var:String body = """{"model": "claude-haiku-4-5-20251001", "max_tokens": 256,
"messages": [{"role": "user", "content": "${prompt}"}]}""";
Curl:SetHeader("x-api-key", apiKey);
Var:String reply;
Curl:Post("https://api.anthropic.com/v1/messages", body, reply);
Konsol:Print(reply);
→ Full Claude chat script - with error handling, JSON parsing, and response extraction
→ Hello World demos - fetch + JSON, AI chat, number guessing game, AI log triage
.ks scripts→ Full project ideas - beginner to advanced
Built-in: Konsol · Math · String · File · Time · List · Map · JSON · Path · OS · Regex · Date · Hash · CSV
Plugins: HTTP · WebSockets · TCP · SQLite · MySQL · PostgreSQL · Redis · Zip · Crypto · JWT
Plugins are drop-in shared libraries loaded with #include "kse_name" - no recompile needed.
#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.
Full syntax, types, and module reference:
#define and #include (file and plugin)try / catchMathException - 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.