Skip to main content
Klyx exposes its extension APIs through the klyx-api module. All APIs live in the com.klyx.api package tree, with supporting core APIs in com.klyx.core.

Package structure

Service access patterns

Klyx provides two service delegate patterns:
Within suspend functions and coroutines, use context-aware functions instead of delegates:

Registration with context receivers

Methods that register resources use Kotlin context receivers. The KlyxPlugin instance is provided as a context parameter, eliminating the need to pass this explicitly:

Dependency

Add the API as a compileOnly dependency:

Services & DI

How to access Klyx services via delegates and context functions

Screens & Navigation

Register composable screens and navigate between destinations

Toolbar

Add custom toolbar actions to the app UI

File System

Read, write, and manage files across SAF and local storage

Editor & Tabs

File openers, workspace tabs, and editor actions

Terminal

Create and manage terminal sessions

File Runners

Run files from the editor toolbar

Process Execution

Run shell commands, spawn processes, and stream output

Events

Subscribe to app events and publish custom events

Settings

Read and update application settings

Plugin Settings

Typed per-plugin settings and optional settings screens

Language Server

Register LSP providers for custom languages

Language Grammars

Register tree-sitter syntax highlighting grammars

Utilities

Helper functions for context, formatting, and more