Pyric
Navigate

API reference

create-pyric

18 published symbols from create-pyric

Generated from the TypeScript declarations shipped at this import path.

Interfaces

CreateArgs

Properties

PropertyType
flagsMap<string, FlagValue>
positionalstring[]

PackageJsonMerge

create-pyric — scaffold engine for npm create pyric and pyric init.

Properties

PropertyType
addedstring[]
conflicts{ existing: unknown; key: string; wanted: unknown; }[]
contentsstring
unchangedboolean

ScaffoldIo

create-pyric — scaffold engine for npm create pyric and pyric init.

Properties

PropertyType
cwd?string
exists?(path: string) => Promise<boolean>
mkdir?{ (path: PathLike, options: MakeDirectoryOptions & { }): Promise<string>; (path: PathLike, options?: | Mode | MakeDirectoryOptions & { }): Promise<void>; (path: PathLike, options?: Mode | MakeDirectoryOptions): Promise<string>; }
readFile?{ (path: PathLike | FileHandle, options?: { } & Abortable): Promise<NonSharedBuffer>; (path: PathLike | FileHandle, options: | BufferEncoding | { } & Abortable): Promise<string>; (path: PathLike | FileHandle, options?: | BufferEncoding | ObjectEncodingOptions & Abortable & { }): Promise<string | NonSharedBuffer>; }
stderr?{ write: void; }
stderr.writevoid
stdout?{ write: void; }
stdout.writevoid
writeFile?(file: PathLike | FileHandle, data: | string | ArrayBufferView<ArrayBufferLike> | Iterable<string | ArrayBufferView<ArrayBufferLike>, any, any> | AsyncIterable<string | ArrayBufferView<ArrayBufferLike>, any, any>, options?: | ObjectEncodingOptions & { } & Abortable | BufferEncoding) => Promise<void>

ScaffoldRequest

create-pyric — scaffold engine for npm create pyric and pyric init.

Properties

PropertyTypeDescription
commandLabel?stringLabel used in human report lines (create-pyric or pyric init).
depsMode?DepsMode-
dir?stringAbsolute or relative project directory (relative resolved against cwd).
effectiveTemplate?ScaffoldTemplateAlready-rewritten template; defaults to TEMPLATES[template] (+ npm pin).
force?boolean-
json?boolean-
name?string-
pinVersion?stringVersion pin for npm-mode @pyric/cli / pyric ranges.
preCreated?string[]Extra paths already created (e.g. vendor tarballs) to list in the report.
template?"web" | "node" | "static" | "chat" | "nextjs"-

ScaffoldResult

Stable --json contract; agents parse this.

Properties

PropertyType
conflicts{ existing: unknown; key: string; wanted: unknown; }[]
createdstring[]
depsModeDepsMode
dirstring
mergedstring[]
nextStepsstring[]
skippedstring[]
template"web" | "node" | "static" | "chat" | "nextjs"

ScaffoldTemplate

create-pyric — scaffold engine for npm create pyric and pyric init.

Properties

PropertyTypeDescription
dependenciesRecord<string, string>-
devDependenciesRecord<string, string>-
dirsstring[]Directories created before writing files (relative to the project dir).
nextStepsstring[]Literal commands for the report / --json consumers.
overrides?Record<string, string>npm/bun overrides (optional). Vendor mode sets { pyric: file:… } so a transitive pyric dep can’t resolve to the published placeholder.
scriptsRecord<string, string>package.json pieces merged into existing files / written into new ones.

Methods

files()
files(name: string): {
  content: string;
  name: string;
}[];

Scaffold-owned files, relative path → content.

Parameters
ParameterType
namestring
Returns

{ content: string; name: string; }[]

Type Aliases

DepsMode

type DepsMode = "vendor" | "npm";

Where the scaffold’s pyric / @pyric/cli deps come from.


FlagValue

type FlagValue = string | boolean | (string | boolean)[];

Minimal argv parser for create-pyric (no subcommand — first bare arg is the target directory).


TemplateName

type TemplateName = typeof TEMPLATE_NAMES[number];

create-pyric — scaffold engine for npm create pyric and pyric init.

Variables

TEMPLATE_NAMES

const TEMPLATE_NAMES: readonly ["web", "node", "static", "chat", "nextjs"];

Scaffold templates for pyric init (engine in ./init.js).

web (the default) scaffolds a Vite app wired to the @pyric/cli/vite plugin: vite dev runs the app’s CANONICAL firebase/* imports against the in-process sandbox; vite build ships the real firebase package. One toolchain, no graduation cliff — the sandbox↔Firebase swap is environmental (dev vs build), never a code edit (the design rationale section 9).

static is the serve-era scaffold (no bundler): a static app pyric dev runs against the in-page sandbox via a runtime import map. For pre-built / retrofit apps, or anyone who wants zero build step.

node is the script-style scaffold (backend fixtures, agent loops). Its canonical imports are swapped by the dev command and remain Firebase under the production command.


TEMPLATES

const TEMPLATES: Record<TemplateName, ScaffoldTemplate>;

create-pyric — scaffold engine for npm create pyric and pyric init.

Functions

applyDepsMode()

function applyDepsMode(
   t: ScaffoldTemplate,
   mode: DepsMode,
   opts: {
  vendorSpecs?: Record<string, string>;
  version?: string;
}): ScaffoldTemplate;

Return a copy of t with pyric / @pyric/cli deps rewritten for mode.

Parameters

ParameterType
tScaffoldTemplate
modeDepsMode
opts{ vendorSpecs?: Record<string, string>; version?: string; }
opts.vendorSpecs?Record<string, string>
opts.version?string

Returns

ScaffoldTemplate


isTemplateName()

function isTemplateName(value: string): value is "web" | "node" | "static" | "chat" | "nextjs";

create-pyric — scaffold engine for npm create pyric and pyric init.

Parameters

ParameterType
valuestring

Returns

value is “web” | “node” | “static” | “chat” | “nextjs”


mergeIntoExistingPackageJson()

function mergeIntoExistingPackageJson(
   raw: string,
   projectName: string,
   template: ScaffoldTemplate): PackageJsonMerge;

Merge template fields into an existing package.json. Never overwrites.

Parameters

ParameterType
rawstring
projectNamestring
templateScaffoldTemplate

Returns

PackageJsonMerge


normalizeBoolFlags()

function normalizeBoolFlags(flags: Map<string, FlagValue>, positional: string[]): void;

Reclaim --force dir / --json dir when a parser bound the value as the flag.

Parameters

ParameterType
flagsMap<string, FlagValue>
positionalstring[]

Returns

void


packageJsonFor()

function packageJsonFor(name: string, t: ScaffoldTemplate): string;

create-pyric — scaffold engine for npm create pyric and pyric init.

Parameters

ParameterType
namestring
tScaffoldTemplate

Returns

string


parseCreateArgs()

function parseCreateArgs(argv: string[]): CreateArgs;

Parameters

ParameterType
argvstring[]

Returns

CreateArgs


runScaffold()

function runScaffold(request: ScaffoldRequest, deps?: ScaffoldIo): Promise<number>;

Write the scaffold into dir. Caller prepares vendor tarballs / pin when needed and may pass effectiveTemplate.

Parameters

ParameterType
requestScaffoldRequest
deps?ScaffoldIo

Returns

Promise<number>