dstalk.top is the official website for the dstalk project

dstalk

An AI coding CLI compatible with OpenAI-style APIs and Anthropic APIs. The core is written in C11 / C++20 and ships dstalk_core.dll as a plugin host that exposes a stable C ABI. Ten functional plugins (AI, endpoint management, networking, LSP, sessions, files, tools, and more) compile to standalone DLLs and plug into the CLI, the SDL3 GUI, the Boost.Beast Web frontend, and any third-party host.

v0.1.0 C11 / C++20 Plugin host + C ABI 10 plugins GPL v3.0
Coredstalk_core.dll (plugin host) FrontendsCLI + SDL3 GUI + Web Pluginsopenai · anthropic · endpoint_mgr · network · lsp · session · context · config · file-io · tools
dstalk-cli
$ build/bin/dstalk_cli.exe config.toml

dstalk v0.1.0  |  OpenAI-compatible / Anthropic  |  /help for help

> Explain the role of dstalk-core
thinking...
AI: dstalk-core is the plugin host. It handles plugin
    loading, service registry, the event bus, and
    configuration. AI, networking, sessions, LSP, and
    file I/O are provided by standalone plugin DLLs;
    frontends only deal with input and rendering.

> /file read dstalk-core/include/dstalk/dstalk_host.h
--- dstalk-core/include/dstalk/dstalk_host.h ---

Why rebuild an AI coding assistant in C/C++?

dstalk is positioned alongside tools like Claude Code, OpenCode, and KiloCode, but uses a systems-language implementation and a plugin-host architecture to optimize startup time, runtime footprint, embeddability, and long-running terminal workflows.

C

No Node.js runtime

The core is built with C11 / C++20 for fast startup and lower memory usage in long-lived terminal sessions.

ABI

Stable C ABI

Public host functions such as dstalk_init and dstalk_service_query, plus 9 service vtables (AI, endpoint management, session, HTTP, file I/O, LSP, and more) make it easy to embed from C/C++, Python, Rust, C#, and Go.

AI

Multi-endpoint routing

OpenAI-compatible and Anthropic AI plugins ship in the box, while ai_endpoint_mgr manages multiple named endpoints. Frontends route through the active endpoint first, and /status shows sanitized endpoint state.

CLI

CLI, GUI, and Web frontends

dstalk-cli is an ANSI terminal UI, dstalk-gui is a cross-platform SDL3 window, and dstalk-web is powered by Boost.Beast + SSE. All three share the same core capabilities.

PLG

Plugin host

The core only handles plugin loading, service registry, event bus, and configuration. AI, endpoint management, networking, LSP, and sessions are independent DLLs you can replace or extend.

OSS

Open source and hackable

Released under GNU GPL v3.0, with example plugins, unit tests, and tutorial docs. Suitable for learning, customization, and local workflow extensions.

Quick Start

dstalk provides an automated toolchain script and a one-command build script. Keep API keys in local config.toml or a secure environment, and never commit them to the repository.

1

Install the local toolchain

Run setup.bat inside the tools directory to download CMake, Ninja, LLVM/Clang, and Conan2.

2

Build dstalk

Run build.bat to install Conan dependencies, configure CMake, and build with Ninja.

3

Start the CLI

Run build/bin/dstalk_cli.exe with config.toml, or let it use the default config lookup.

quickstart
# Install toolchain
cd tools
setup.bat

# Return to repo root and build
cd ..
build.bat

# Legacy single-provider mode
ai.provider = "ai_openai"
api.base_url = "https://api.openai.com/v1"
api.api_key = "sk-xxxxxxxx"
api.model = "gpt-4o"

# Multi-endpoint mode
endpoints.names = "openai_main, anthropic_alt"
endpoints.active = "openai_main"
endpoint.openai_main.provider = "ai_openai"
endpoint.openai_main.api_key = "sk-xxxxxxxx"
endpoint.openai_main.model = "gpt-4o"
endpoint.anthropic_alt.provider = "ai_anthropic"
endpoint.anthropic_alt.api_key = "sk-ant-xxxx"
endpoint.anthropic_alt.model = "claude-sonnet"

# Run CLI
build/bin/dstalk_cli.exe config.toml

Plugin host + decoupled multi-frontend architecture

dstalk_core.dll acts as a plugin host responsible for plugin loading, service registry, event bus, and configuration. Ten functional plugins — AI, endpoint management, networking, LSP, sessions, files, tools, and more — compile to standalone DLLs, while frontends reach the core only through the C ABI. The GUI and Web frontends are opt-in via DSTALK_BUILD_GUI / DSTALK_BUILD_WEB.

architecture
┌─────────────────────────────────────────────────────┐
│ Frontends                                            │
│  dstalk-cli (ANSI)   dstalk-gui (SDL3)   dstalk-web (SSE) │
└───────────────────────┬─────────────────────────────┘
                        │ C ABI
┌───────────────────────▼─────────────────────────────┐
│ dstalk_core.dll — Plugin Host                     │
│  Plugin Loader · Service Registry · Event Bus ·     │
│  Config Manager                                      │
├───────────────┬───────────────┬─────────────────────┤
│ openai  (ai) │ anthropic (ai)│ endpoint_mgr       │
│ network(http)│ lsp (client)  │ session            │
│ context       │ config        │ file-io · tools    │
└───────────────┴───────────────┴─────────────────────┘
   Boost.JSON · Boost.Asio / Beast · OpenSSL TLS

Tech stack and project status

The following is based on dstalk's CMake files, Conan configuration, and public API header.

ModuleCurrent technologyStatus
Core libraryC11 / C++20, dstalk_core.dll, plugin host, public C ABIEnabled
CLI frontendANSI terminal UI using dstalk/dstalk_host.hEnabled
GUI frontendSDL3 graphical frontend, enabled via CMake option DSTALK_BUILD_GUIOptional build
Web frontendBoost.Beast HTTP + SSE streaming frontend, enabled via CMake option DSTALK_BUILD_WEBOptional build
Frontend commondstalk_frontend_common reuses config discovery, initialization, and service-query logicEnabled
Plugins10 functional plugins (openai · anthropic · endpoint_mgr · network · lsp · session · context · config · file-io · tools), standalone DLLsEnabled
Tests11 test targets covering plugin host, event bus, service registry, plugin loader, endpoint manager, and AI plugins, integrated with CTestEnabled
Docsdocs/tutorial, docs/reference (commands, config, plugin-abi), docs/explanation (architecture, plugin-lifecycle, security-logging)Published
Examplesexamples/example_plugin shows a plugin templateAvailable
DependenciesConan2, boost/1.86.0, openssl/3.4.1Configured
Build systemCMake 3.21+, Ninja, LLVM/Clang, CMakePresetsConfigured
LicenseGNU GPL v3.0Confirmed

Common CLI commands

In addition to natural-language prompts, dstalk-cli provides commands for files, models, and session management.

CommandsDescriptionExample
/help / /hShow the command list/help
/quit / /qQuit the program/quit
/clearClear the current conversation context/clear
/contextShow the current token count and message count/context
/statusShow sanitized runtime status without printing the full API key/status
/model <name>Switch the current model; in multi-endpoint mode it updates the active endpoint/model gpt-4o
/file list [path]List directory contents; omit path to list the current directory/file list src/
/file show <path>Show file content/file show README.md
/file read <path>Read file content (same as /file show)/file read config.toml
/file write <path> <content>Write content to a file/file write note.txt hello
/save <path> / /load <path>Save or restore a session/save session.json

Public C API

dstalk exposes its capabilities through four public headers: dstalk_host.h manages the host lifecycle and plugins, dstalk_services.h defines 9 service vtables including ai_endpoint_mgr, dstalk_lsp.h provides a standalone LSP client, and dstalk_types.h shares message and event types. Frontends call dstalk_service_query() to obtain a service pointer, then invoke capabilities through function pointers.

dstalk_host.h — host API
// Lifecycle
int  dstalk_init(const char* config_path);
void dstalk_shutdown(void);

// Plugin management
int  dstalk_plugin_load(const char* path);
int  dstalk_plugin_unload(int plugin_id);
int  dstalk_plugin_list(char** output_json);
void*dstalk_service_query(const char* name, int min_version);

// Event system
int  dstalk_event_subscribe(int type, dstalk_event_handler_fn fn, void* ud);
int  dstalk_event_emit(int type, const void* data);
void dstalk_event_unsubscribe(int sub_id);

// Config / memory / diagnostics
const char* dstalk_config_get(const char* key);
int  dstalk_config_set(const char* key, const char* value);
void*dstalk_alloc(size_t size);
void dstalk_free(void* ptr);
char*dstalk_strdup(const char* s);
void dstalk_set_diag_callback(dstalk_diag_cb cb);
dstalk_services.h — service vtable example
// AI service: dstalk_service_query("ai_openai", 1)
typedef struct {
    int  (*configure)(const char* provider, const char* base_url,
                      const char* api_key, const char* model,
                      int max_tokens, double temperature);
    dstalk_chat_result_t (*chat)(const dstalk_message_t* history,
                      int len, const char* input, const char* tools_json);
    dstalk_chat_result_t (*chat_stream)(...);
    void (*free_result)(dstalk_chat_result_t* result);
} dstalk_ai_service_t;

// endpoint manager: dstalk_service_query("ai_endpoint_mgr", 1)
// Same pattern: dstalk_ai_endpoint_mgr_t, dstalk_session_service_t,
//   dstalk_http_service_t, dstalk_file_io_service_t,
//   dstalk_config_service_t, dstalk_tools_service_t, dstalk_lsp_service_t

Roadmap

The plugin host, CLI, SDL3 GUI, Boost.Beast Web frontend, ten core plugins, tests, and documentation are already in place. Future work focuses on deeper capabilities and ecosystem expansion.

PhaseScopeStatus
SkeletonProject skeleton, CMake/Ninja build, Conan dependencies, DLL exports, frontend main loopDone
Plugin hostPlugin loader, service registry, event bus, configuration; 10 core plugins (openai · anthropic · endpoint_mgr · network · lsp · session · context · config · file-io · tools)Done
Chat capabilityHTTPS networking, OpenAI-compatible / Anthropic API adapters, streaming output, multi-turn sessions, tool calling, and file I/OAvailable
Multi-endpointai_endpoint_mgr manages multiple named AI endpoints; frontends route through the active endpoint first and /status returns sanitized stateAvailable
GUI / Web frontendsSDL3 graphical window and Boost.Beast Web + SSE, optional frontends sharing the same plugin host as the CLIOptional build
Next phaseDeeper LSP integration, third-party plugin SDK, cross-platform distribution, ongoing documentationPlanned

Open source contributors welcome

dstalk is an open project. Developers interested in C/C++, terminal UX, AI API adapters, GUI, documentation, and testing are welcome to participate.

PR

Improve the codebase

The core, CLI, SDL3 GUI, Web frontend, and 10 plugins (AI, endpoint management, networking, LSP, sessions, files, tools, and more) all welcome patches; build scripts and cross-platform compatibility have headroom too.

PLG

Build new plugins

Use examples/example_plugin and docs/reference/plugin-abi.md as a starting point — register new services through the C ABI to bring your own models, tools, or data sources into dstalk.

DOC

Improve docs and tests

docs/tutorial and docs/reference are taking shape; help expand tutorials, command references, plugin-ABI notes, and the coverage of host_api_test / smoke_test.

Start in the terminal, embed dstalk everywhere

dstalk is more than a CLI. It is a local AI coding core that can be reused by multiple frontends. dstalk.top will keep tracking project progress, build instructions, and available capabilities.