Skip to content

Samples

Jung Hyun, Nam edited this page May 28, 2026 · 1 revision

Samples

Every file in samples/ is runnable as-is — dotnet run samples/<name>.cs. They're written to be small enough to read in one screen and faithful to how Cadenza is meant to be used.

Console — Cadenza

File What it shows
console-hello.cs Tier 1 bare names: Glob, ReadText, WriteLine
console-count-files.cs Walking a directory tree and summarizing
console-http-fetch.cs HTTP request, JSON deserialization
console-deploy-guard.cs A real-world deploy precondition check
console-prompt-setup.cs Interactive setup wizard

Worker — Cadenza.Worker

File What it shows
worker-heartbeat.cs Minimal Run(async ct => …) loop with Log.Info
worker-polling.cs Polling pattern with backoff and cancellation

Web — Cadenza.Web

File What it shows
web-minimal.cs Get, Post, record binding, Run
web-todo-api.cs A small CRUD API in one file

MCP — Cadenza.Mcp

File What it shows
mcp-files.cs Tool registration; filesystem tools over stdio
mcp-extended.cs Multi-tool server with structured inputs

Agent — Cadenza.Agent

File What it shows
agent-basic.cs OpenAI-compatible HTTP server + Ollama backend
agent-console-repl.cs Drive the agent from a console loop
agent-multi-llm.cs Switch among multiple LLM backends
agent-openrouter.cs OpenRouter backend
agent-rag-folder.cs Lightweight RAG over a folder of documents
agent-codex-backend.cs OpenAI Responses API for Codex CLI
agent-codex-openrouter.cs Codex CLI over OpenRouter

Running them

git clone https://github.com/rkttu/cadenza.git
cd cadenza
dotnet run samples/console-hello.cs

See also

Clone this wiki locally