create-gluon / packages/create-gluon/src / helpText
Variable: helpText
consthelpText: "Usage:\n create-gluon [directory] [options]\n create-gluon add-component [name] [options]\n\nOptions:\n -y, --yes use non-interactive defaults\n --name <name> set the npm package name\n --[no-]router include or exclude Router\n --[no-]store include or exclude Store\n --[no-]testing include or exclude browser tests\n --[no-]ui include or exclude Gluon UI atoms\n --[no-]ssr include or exclude SSR and hydration\n --force write into an existing directory\n -h, --help show this help\n -v, --version show the create-gluon version\n\nSSR enables Router and Store. Explicit --ssr with --no-router or --no-store is invalid.\nRun create-gluon add-component --help for the app-local component workflow.\n"
Example
Display the canonical command usage and supported feature flags from a custom CLI host:
import {
CREATE_GLUON_VERSION,
ScaffoldError,
helpText,
normalizeFeatures,
parseCliArguments,
scaffoldProject,
type CliPrompt,
type GluonFeatures,
type ParsedCliArguments,
type ScaffoldErrorCode,
type ScaffoldOptions,
type ScaffoldResult,
} from 'create-gluon';
const parsed: ParsedCliArguments = parseCliArguments(['my-shop', '--ssr', '--ui', '--testing', '--yes']);
const features: GluonFeatures = normalizeFeatures(parsed);
const options = {
directory: parsed.directory!,
name: '@example/my-shop',
cwd: '/tmp',
force: true,
...features,
} satisfies ScaffoldOptions;
const prompt: CliPrompt = { question: async () => 'yes', close: () => undefined };
console.log(prompt, CREATE_GLUON_VERSION, helpText.split('\n')[0]);
try {
const result: ScaffoldResult = await scaffoldProject(options);
console.log(result.directory, result.features, result.files);
} catch (error) {
if (error instanceof ScaffoldError) {
const code: ScaffoldErrorCode = error.code;
console.error(code, error.message);
} else throw error;
}