Skip to content

pantoken / ai/pantoken-ai/src / scaffoldAndInit

Function: scaffoldAndInit()

scaffoldAndInit(platform, dir?, tool?): Promise<string[]>

Alpha

Scaffold a starter project for a platform (via @pantoken/scaffold), and install pantoken's agent assets (via installAgentAssets) into the same directory.

Parameters

platform

string

A ScaffoldPlatform.

dir?

string = "."

The target directory (default "."). Its basename (or "pantoken-app" for ".") is substituted for in the scaffold's template files.

tool?

AgentTool | "all"

Which agent tool's assets to install alongside the scaffold (default "all").

Returns

Promise<string[]>

The paths written, scaffold files first.

Example

Scaffold a React starter with every agent asset installed

ts
import { scaffoldAndInit } from "@pantoken/ai";

scaffoldAndInit("react", "./my-app");