Clone, run, and explore this sample
Use interactive tools alongside your application without installing them on the host, copying connection strings, or leaving the Aspire dashboard.
The entry point that composes every resource and dependency in this sample's distributed application.
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
// No persistent volume: use disposable data. The authenticated Redis REPL is for trusted dashboard users only.const redis = await builder.addRedis('redis').withRepl();
// Local demo: anyone who can reach this unauthenticated HTTP API can read, replace, or delete demo notes.const api = await builder.addNodeApp('api', './api', 'src/index.ts') .withEnvironment('NODE_OPTIONS', '--import tsx --import ./src/instrumentation.ts') .withHttpEndpoint({ env: 'PORT' }) .withHttpHealthCheck({ path: '/health' }) .withReference(redis) .withOtlpExporter() .waitFor(redis);
await builder.addDockerfile('slumber', './slumber') .withEnvironment('BASE_URL', api.getEndpoint('http')) .waitFor(api) .withTerminal();
await builder.build().run();| Sample | AppHost | API | Terminal features |
|---|---|---|---|
| C# basics | File-based C# | ASP.NET Core | WithTerminal() and Redis WithRepl() |
| TypeScript basics | TypeScript | Express/TypeScript | withTerminal() and Redis withRepl() |
| Terminal automation | File-based C# | ASP.NET Core | Drive Slumber with SendKeyAsync / WaitForTextAsync, verify CRUD, handle repeat runs |
| Custom docked SQL REPL | File-based C# | rqlite HTTP API | Custom container resource and TerminalService / TerminalPlacement.Dock |
Each basic sample is standalone: its own API, Redis database, Dockerfile, and saved request collection. Both demonstrate the same round trip: create a note in a REST terminal UI, edit its underlying Redis value in a REPL, then read the changed value through the API.
The automation sample reuses the C# basic sample's API and Slumber image source, but launches its own resources and supplies a separate request collection. The custom REPL sample is independent and uses rqlite's official image and SQL shell. Each sample has its own AppHost and can run separately.
Two different terminal experiences
Section titled Two different terminal experiencesSlumber runs as the main process of a container. WithTerminal() / withTerminal() makes that process interactive in the dashboard's console view, including keyboard input and terminal resizing.
Redis continues running as a normal server. WithRepl() / withRepl() adds an on-demand REPL resource action that launches an authenticated redis-cli terminal. It does not attach interactive input to the Redis server process.
The REST client is Slumber, an MIT-licensed Rust application with YAML request collections and environment substitution. The basic samples package checksum-verified Slumber 5.3.0 binaries for Linux ARM64/AMD64 in a non-root container, with Vim as the default editor. No host Slumber or Vim installation is required.
Aspire version
Section titled Aspire versionThese samples use the released Aspire 13.6.0 CLI and packages, matching the repository.
Install the matching CLI using the root installation instructions. Packages restore from NuGet.org without staging feeds or sample-specific NuGet configuration.
The terminal APIs remain experimental in Aspire 13.6.0, but terminal CLI commands no longer require a feature flag. When updating, align the CLI and package versions across the repository and repeat the interactive walkthroughs.
These are local-development examples, not deployment samples. Only give trusted users dashboard access: the Redis and SQL REPLs grant database access. Data is disposable, and the HTTP APIs deliberately have no application authentication.