resolveRenderContext
Generated reference page for the resolveRenderContext function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/cli/index.ts - Source link:
src/core/cli/index.ts:566
Signatures
ts
function resolveRenderContext(argv: readonly string[], options?: RenderContextOptions): RenderContext;| Parameter | Type | Description |
|---|---|---|
argv | readonly string[] | Raw argv tokens (NOT including the binary/script path, i.e. equivalent to process.argv.slice(2)). |
options | RenderContextOptions | undefined | Host facts and overrides. |
Members
Members
resolveRenderContext
Resolve the render context for content built before .run().
Content styled ahead of execution — hand-rendered banners, custom help, or anything else emitted outside an action handler — has no out to consult, which pushes consumers into re-deriving the framework's decisions from raw argv (argv.includes('--json') misreads a post--- literal). This probe runs the same composition .execute()/.run() feed into the output channel — ---aware --json detection, the color gate, and the hyperlink override — so pre-run styling matches the channel that will render.
ts
(argv: readonly string[], options?: RenderContextOptions): RenderContext;Examples
ts
const ctx = resolveRenderContext(process.argv.slice(2), {
isTTY: process.stdout.isTTY === true,
env: process.env,
});
const banner = ctx.color.bold('mycli');