Skip to content

pantoken-root / packages/cli/src / run

Hàm: run() ​

run(argv): Promise<void>

Beta

Chạy CLI.

Tham số ​

argv ​

readonly string[]

Trả về ​

Promise<void>

Các ví dụ ​

Thêm một component từ registry pantoken

ts
import { run } from "@pantoken/cli";

await run(["add", "button"]);

Tạo khung khởi đầu React

ts
import { run } from "@pantoken/cli";

await run(["create", "react", "--dir", "./my-app", "--no-install"]);

Tạo token Swift vào repo người tiêu thụ

ts
import { run } from "@pantoken/cli";

// Writes Sources/PanTokens/Tokens.swift + Package.swift under ./ios/DesignTokens.
await run(["generate", "swift", "--out", "./ios/DesignTokens"]);

Tạo bảng mẫu màu theo chủ đề ở định dạng cụ thể

ts
import { run } from "@pantoken/cli";

await run(["generate", "swatches", "--format", "gpl", "--theme", "canvas", "--out", "./out"]);