Skip to content

Tier 1 API

Jung Hyun, Nam edited this page May 28, 2026 · 3 revisions

Tier 1 API

Cadenza's Tier 1 names are exposed via global using static in each SDK, so they're callable without imports or type prefixes. The promise: ≤ 10 bare names per SDK, kept small, stable, and a single screen wide in the README.

This page lists the names. For deeper signatures, see the spec (§4 onward).

Shared across all SDKs

Name Purpose
WriteLine, Write Console output
ReadText(path) Read a UTF-8 text file
WriteText(path, content) Write a UTF-8 text file
Glob(pattern) Enumerate paths matching a glob (**/*.cs, etc.)
Log.Info / .Warn / .Error / .Debug Structured logging via ILogger
Env Process environment (incl. Env.ScriptPath)
Run() Start the host appropriate to the SDK

TODO: trim to the actual exported surface as of 1.0.15.

Cadenza (Console)

Bare names focus on filesystem, process, and standard I/O. No host — the script runs top-to-bottom and exits.

Cadenza.Worker

Adds the worker variant of Run:

await Run(async (CancellationToken ct) => { /* loop */ });

ct cancels on graceful shutdown.

Cadenza.Web

Name Purpose
Get(path, handler) Register a GET route
Post(path, handler) Register a POST route
Put, Delete, Patch The other HTTP verbs
Map(path, handler) All methods
HostUrls(...), HostName(...) Configure the bind address
Run() Start Kestrel

Cadenza.Mcp

Name Purpose
Tool(name, description, handler) Register a callable tool
Prompt(name, description, handler) TODO
Resource(...) TODO
Run() Start the MCP server on stdio

Cadenza.Agent

Name Purpose
SystemPrompt(text) Set the system prompt
Tool(name, description, handler) Register a callable tool (same shape as Mcp)
UseOllama(model) Choose an Ollama backend
UseOpenAI(model) Choose OpenAI proper
UseOpenRouter(model) Choose OpenRouter
HostName(...), HostUrls(...) Configure the bind address
Run() Start the OpenAI-compatible HTTP server

Why bare names?

PascalCase, no prefixes — see the spec, §2.1. The SDK absorbs the prefix tax so your single-file script stays single-screen.

See also

Clone this wiki locally