Extending & automating
Reach past a single request. Run durable background jobs, publish and subscribe to events, cache what's hot, script the platform in Kotlin, and drive all of it from one native CLI.
Jobs & events
A background job is a definition; an event ties jobs to a name. Calling dispatch() does both — it enqueues the work on a durable, at-least-once queue and publishes the event to whoever's subscribed. And because enqueueing waits for your transaction to commit, a job never runs for a change that rolled back.
@JobEvent(jobs = [ReindexTask::class])
class TaskPublished(val id: UUID)
// one call: enqueue the job + publish
TaskPublished(id).dispatch()Caching
Reach the distributed cache through a single interface and let configuration choose the backend — Redis or a NATS key-value store. The same call works either way, so caching is a decision you make in config, not a dependency baked into your code.
val cache = provide<ServiceCache>()
val feed = cache.get("feed:home")
?: build().also { cache.put("feed:home", it) }Scripting
For logic that shouldn't ship inside the server, write a Bosca Script — real Kotlin, with typed access to the same services, running inside the platform. Trigger it by hand, on an event, or behind an HTTP endpoint, and version it in Git.
val content = provide<MetadataService>()
val id = context.input.jsonObject["id"]
log.info("handling publish for $id")The CLI
The bosca CLI is a single native binary. It talks to the server over a typed GraphQL client generated from the same schema your code uses, and it embeds an MCP server — so the platform is scriptable from your shell and operable by your AI agents through the very same commands.
bosca.Keep exploring