Skip to content

CLI reference

The cephalon CLI is the canonical entry point for everything that’s not “build the app” — environment validation, scaffolding, package staging, and reference-doc generation.

This page is the authoritative flag reference. For installation, see Guide → Installation.

Before drilling into specific commands, a few patterns apply across the whole CLI:

  • --prerelease is not a CLI flag. It only affects dotnet tool install when fetching the CLI itself. Once installed, the CLI works the same way for preview and stable engine versions.
  • --json is supported by every read-style command (doctor, future list, info). Pipe to jq for scripting and CI gating.
  • Exit code 0 = success. Any non-zero exit is a hard failure — useful for CI.
  • No cephalon command writes to your engine source repo. All writes go to the working directory or a generated app path.

Verifies the first-run baseline: active SDK, installed runtimes, optional tooling, deployment-mode posture.

cephalon doctor [--json] [--profile <profile>] [--verbose] [--quiet]
FlagTypeDefaultDescription
--jsonswitchoffEmit a structured JSON status payload instead of human-readable text. Pipe to jq for CI gating.
--profile <name>stringdefaultRun a named diagnostics profile (e.g. container-build, air-gapped, ci). Profiles select different check sets.
--verbose / -vswitchoffPrint per-check details: detected paths, version strings, “why this matters” hints.
--quiet / -qswitchoffSuppress all output. Use only the exit code. Useful in CI smoke checks.
CodeMeaning
0All required checks [ok]. Optional [warn] lines may still appear; they don’t affect exit.
1At least one required check failed. Stderr lists the failing check.
2Command-line parse error (unknown flag, malformed value).

Standard run — the most common usage:

Terminal window
cephalon doctor

Verbose — when one of the checks fails and you need details:

Terminal window
cephalon doctor --verbose

You’ll see each check’s resolved input, e.g.:

Terminal window
[ok] dotnet --version is 10.0.100
SDK install root: C:\Program Files\dotnet
global.json applied: 10.0.100 (rollForward=latestFeature)

CI gate — fail the build if doctor isn’t clean:

Terminal window
cephalon doctor --json | jq -e '.result == "ok"'

The jq -e flag returns non-zero exit when the predicate is false.

JSON shape — for custom scripting:

{
"result": "ok", // "ok" | "warn" | "fail"
"profile": "default",
"engineVersion": "0.1.0-preview",
"checks": [
{ "name": "dotnet-sdk", "result": "ok", "detail": "10.0.100" },
{ "name": "netcoreapp-runtime","result": "ok", "detail": "10.0.0" },
{ "name": "template-pack", "result": "warn", "detail": "not registered" }
],
"deploymentMode": {
"baseline": "net10.0",
"readinessLanes": {
"dotnet11": "assessment-only",
"trim": "warn",
"aot": "warn",
"singleFile": "warn"
}
}
}

Profile-specific — different checks for different environments:

Terminal window
cephalon doctor --profile container-build
cephalon doctor --profile air-gapped

(Profiles available in 0.1.0-preview: default, container-build, air-gapped, ci. Adding new profiles is tracked in the roadmap.)

SituationRecommended
New developer setupRun once after installing .NET 10 + the CLI
Every CI buildAdd as the first step before dotnet restore
Before scaffolding a new appAlways — fixing problems here is cheaper than debugging in a generated app
After upgrading the SDKVerifies the new SDK is picked up and all runtimes align
ErrorCauseFix
[fail] dotnet --version is 9.0.xActive SDK is below 10Install .NET 10 SDK. If you have it, check global.json isn’t pinning to an older version.
[fail] Microsoft.AspNetCore.App 10.x not installedRuntime missing despite SDK presentReinstall the SDK bundle (includes both runtimes) or install the runtime separately.
[warn] Cephalon.TemplatePack not registeredOptional check — doesn’t affect anythingIgnore unless you want dotnet new cephalon-app -n … to work.

Scaffolds a CephalonEngine application. Produces a complete, runnable project tree with the host, a starter module, test project, deploy folders, and supporting files.

cephalon new <Name> [--output <path>]
[--template <id>]
[--composition <model>]
[--topology <topology>]
[--feature-organization <org>]
[--transport <transport>]
[--id-strategy <strategy>]
[--force]
[--dry-run]
ArgumentTypeDescription
<Name>stringThe application name. Used as the namespace, csproj prefix, default output folder, and default Engine:Id. Convention: <Org>.<Product> (e.g. Acme.Store). Must be a valid C# namespace; the CLI rejects names starting with digits or containing whitespace.
TypeDefault
string (path)./<Name>

The directory to write the generated project into. Created if it doesn’t exist. Fails if the directory is non-empty unless --force is set.

Terminal window
cephalon new Acme.Store # writes to ./Acme.Store
cephalon new Acme.Store --output ./src/acme-store # writes to ./src/acme-store
cephalon new Acme.Store --output . # writes to current dir (must be empty)
TypeDefaultAllowed values
stringcephalon-appcephalon-app, cephalon-worker, cephalon-minimal

Which scaffolding template to use:

TemplateWhat you get
cephalon-appDefault. Full modular monolith with REST host, starter module, test project, all 7 deploy folders, Dockerfile, OTLP collector config.
cephalon-workerWorker host (no HTTP), starter background module, test project.
cephalon-minimalJust the host + composition smoke test. No starter module, no deploy folders. For users who want to start from a bare shell.
Terminal window
cephalon new Acme.Worker --template cephalon-worker
cephalon new Acme.Lab --template cephalon-minimal
TypeDefaultAllowed values
enumModularModular

How the app is assembled. Currently only Modular is supported; Plugin-ready Modular is planned for 0.2.0-preview.

Terminal window
cephalon new Acme.Store --composition Modular
TypeDefaultAllowed values
enumSingleHostSingleHost, Microservice, MicroserviceSuite, Worker

The deployment topology the scaffold targets.

ValueGenerates
SingleHostOne ASP.NET Core host loading modules from assemblies. Default modular monolith.
MicroserviceOne service (likely part of a suite) with eventing pre-wired. Same module shape, fewer transports.
MicroserviceSuiteA solution containing multiple services. Not yet implemented in 0.1.0-preview — falls back to Microservice.
WorkerGeneric-host worker (no HTTP). Useful for background processors.
Terminal window
cephalon new Acme.Store --topology SingleHost # default
cephalon new Acme.Orders.Service --topology Microservice
cephalon new Acme.Indexer --topology Worker
TypeDefaultAllowed values
enumModuleFirstModuleFirst, VerticalSlice

How code is laid out inside modules.

ValueLayout
ModuleFirstFolders by concern: Modules/Products/Behaviors/, Modules/Products/Data/, Modules/Products/Domain/. The default — scales well as the codebase grows.
VerticalSliceFolders by feature: Features/CreateProduct/Behavior.cs, Features/CreateProduct/Handler.cs. Smaller cognitive overhead per feature, harder once features start sharing types.
Terminal window
cephalon new Acme.Store --feature-organization ModuleFirst # default
cephalon new Acme.Store --feature-organization VerticalSlice
TypeDefaultAllowed valuesRepeatable
enumRestApiRestApi, JsonRpc, Grpc, GraphQL, ServerSentEvents, WebSocketyes

Transports to enable on the host. Pass --transport multiple times for combined transports.

Terminal window
cephalon new Acme.Api --transport RestApi # default
cephalon new Acme.Api --transport RestApi --transport Grpc
cephalon new Acme.Api --transport RestApi --transport GraphQL --transport ServerSentEvents

What each transport adds:

TransportPackage referencedGenerated wiring
RestApiCephalon.AspNetCore (always present)OpenAPI + Scalar UI, behavior pipeline
JsonRpcCephalon.AspNetCore.JsonRpcJSON-RPC method router
GrpcCephalon.AspNetCore.GrpcgRPC service mapper
GraphQLCephalon.AspNetCore.GraphQLFederated schema host
ServerSentEventsbuilt-inSSE channel adapter
WebSocketbuilt-inWebSocket channel adapter
TypeDefaultAllowed values
enumSfidSfid, Guid, Long

Default identifier strategy for entities. Sets Engine:Data:IdStrategy in appsettings.json and the DbContext base class.

ValueWhen to choose
SfidDefault. K-sortable, URL-safe, 26 chars. Best for most apps.
GuidCompatibility with non-.NET systems already using GUIDs. Less index-friendly than Sfid.
LongLegacy schemas that require numeric ids. Forces single-writer DB topology.
Terminal window
cephalon new Acme.Store --id-strategy Sfid # default
cephalon new Acme.Store --id-strategy Guid
cephalon new Acme.Legacy --id-strategy Long
TypeDefault
switchoff

Overwrite the output directory even if non-empty. Dangerous — files in the target are deleted. Always commit before using --force.

Terminal window
cephalon new Acme.Store --output ./existing --force
TypeDefault
switchoff

Print the file tree that would be generated without writing anything. Useful for previewing the scaffold or generating documentation.

Terminal window
cephalon new Acme.Store --dry-run

Output:

dry-run
Would generate the following files under ./Acme.Store:
./Acme.Store/Acme.Store.slnx
./Acme.Store/Directory.Build.props
./Acme.Store/Directory.Packages.props
./Acme.Store/global.json
./Acme.Store/NuGet.config
./Acme.Store/Dockerfile
./Acme.Store/compose.yaml
./Acme.Store/otel-collector-config.yaml
./Acme.Store/deploy/...
./Acme.Store/src/Acme.Store.Host/Program.cs
./Acme.Store/src/Acme.Store.Host/appsettings.json
./Acme.Store/src/Acme.Store.Modules.Health/HealthModule.cs
./Acme.Store/tests/Acme.Store.Host.Tests/...
...64 files total

Modular monolith with REST + gRPC + EF Core data:

Terminal window
cephalon new Acme.Store `
--topology SingleHost `
--transport RestApi `
--transport Grpc `
--id-strategy Sfid

Worker service for background processing:

Terminal window
cephalon new Acme.OrderProcessor `
--topology Worker `
--template cephalon-worker

Microservice (REST-only, expected to receive events from a separate broker):

Terminal window
cephalon new Acme.Catalog.Service `
--topology Microservice `
--transport RestApi

GraphQL aggregator + SSE for realtime updates:

Terminal window
cephalon new Acme.Gateway `
--transport GraphQL `
--transport ServerSentEvents

Bare-bones starting point (no starter module, no deploy folders):

Terminal window
cephalon new Acme.Lab --template cephalon-minimal
CodeMeaning
0App generated successfully.
1Generation failed — bad inputs, target directory non-empty without --force, write error. Stderr explains.
2Command-line parse error.

Copies locally-built Cephalon.* packages into a generated app’s .cephalon/packages/ folder so the app’s NuGet restore picks them up before falling back to public feeds.

Use this when: You’re developing against an in-progress engine build and want the generated app to consume your local artifacts instead of the published versions.

cephalon stage-packages <generated-app-path>
[--source <feed-path>]
[--include <pattern>]
[--clean]
ArgumentDescription
<generated-app-path>Path to the app generated by cephalon new (the folder containing .cephalon/).
TypeDefault
path./artifacts/packages-release (relative to the engine repo)

Source folder containing the .nupkg files to copy.

Terminal window
cephalon stage-packages ./Acme.Store
cephalon stage-packages ./Acme.Store --source ./out/packages
TypeDefaultRepeatable
globCephalon.*yes

Glob pattern for packages to copy. Use to stage a subset (e.g. only the eventing packages while you iterate).

Terminal window
cephalon stage-packages ./Acme.Store --include "Cephalon.Eventing.*"
cephalon stage-packages ./Acme.Store `
--include "Cephalon.Abstractions" `
--include "Cephalon.Engine" `
--include "Cephalon.AspNetCore"
TypeDefault
switchoff

Remove existing .cephalon/packages/* before copying. Without this, old versions accumulate.

Terminal window
cephalon stage-packages ./Acme.Store --clean

Standard repo-local development loop:

Terminal window
# In the engine repo:
pwsh ./scripts/publish-package-artifacts.ps1 -Configuration Release -SkipBuild
# In the generated app:
cephalon stage-packages ./Acme.Store --clean
dotnet restore ./Acme.Store/Acme.Store.slnx
dotnet run --project ./Acme.Store/src/Acme.Store.Host

Stage only the packages you changed (faster iteration):

Terminal window
cephalon stage-packages ./Acme.Store --include "Cephalon.Eventing.*"
CodeMeaning
0Packages copied successfully.
1Source path not found, target app path invalid, or copy failed.

Generates XML-comment-driven reference Markdown for a project. Used by the engine’s own docs pipeline; adopters can use it to generate API reference for module packages they publish.

cephalon reference-docs <project-path>
[--out <path>]
[--include-internal]
[--namespace-layout <flat|nested>]
ArgumentDescription
<project-path>Path to a .csproj or .sln to extract XML comments from. The project must be buildable (XML doc generation enabled).
TypeDefault
path./docs/reference/

Output directory for the generated Markdown files.

Terminal window
cephalon reference-docs ./src/Acme.Catalog/Acme.Catalog.csproj `
--out ./docs/api
TypeDefault
switchoff

Include internal types in the output. By default only public types are documented.

TypeDefault
enumnested

How to organize the output:

  • flat — every type in one folder, filename = <Namespace>.<Type>.md.
  • nested — folders mirror the namespace tree.

Generate API docs for a published module:

Terminal window
cephalon reference-docs ./src/Acme.Catalog/Acme.Catalog.csproj `
--out ./docs/reference/api `
--namespace-layout nested
  • Requires <GenerateDocumentationFile>true</GenerateDocumentationFile> in the target .csproj. The CLI will error otherwise.
  • Internal types from referenced packages are never included regardless of --include-internal.
  • Output format is Markdown only (the engine’s docs site is Markdown; HTML output isn’t generated).

These apply to every cephalon command:

FlagDescription
--versionPrint the CLI version and exit. Useful in CI logs.
--help / -hPrint help for the current command. cephalon --help lists all commands; cephalon new --help lists new’s flags.
--no-colorDisable ANSI color output. Useful for log capture / CI systems that don’t render colors.
--telemetry offDisable CLI telemetry (anonymous usage data).
--log-level <level>One of trace, debug, info, warn, error. Default info.
CodeMeaningUsed by
0SuccessAll commands
1Operation failed (required check, generation, copy, etc.)All commands
2Command-line parse errorAll commands
64Bad usage (e.g. missing required argument)new, stage-packages, reference-docs
73Cannot create output file (target locked or read-only)new, reference-docs