@asterflow/cli
v2.2.0
Published
CLI for scaffolding AsterFlow projects, adding plugins, and generating the static fs-routing manifest.
Maintainers
Readme
@asterflow/cli
CLI for scaffolding AsterFlow projects, adding plugins, and generating the static fs-routing manifest.
📦 Installation
bunx @asterflow/cli@latest init my-app✨ Features
- Full project scaffolding:
initwritespackage.json,tsconfig.json,.gitignore, an app entry for the chosen adapter (Bun, Node, Express or Fastify), and example route files - interactively or entirely via flags. - Non-interactive by default when it needs to be: any
--flag, CI, or--yesskips prompting and fills in documented defaults instead, so agents and CI never hang waiting on input. - Empty-directory check: refuses to scaffold into a non-empty directory (ignoring things like
.git/.gitignore/an IDE folder). - Plugin management:
addmerges plugins into an existing project'spackage.json, installs them with the detected package manager, and prints the.use(...)snippet to wire each one up. - Route templates:
hello(a minimalGET /) andupload(a file upload via@asterflow/multipart, only offered when themultipartplugin is selected). - Static route manifest generation:
generatecalls@asterflow/fs'sgenerateRouteManifestto turn aroutes/directory into a manifest of static imports, with a--watchmode to regenerate on change.
❓ How to Use
Scaffold a new project - interactively, or fully via flags for CI/agents:
bunx @asterflow/cli@latest init my-app --adapter bun --plugins fs,multipart --routes hello,upload --yesManage an existing project with the other commands:
asterflow add fs,multipart # add plugins to package.json, install them, print .use(...) wiring
asterflow list # print available plugins
asterflow generate --watch # regenerate src/routes.gen.ts whenever src/routes/ changes🔗 Related Packages
- @asterflow/fs - its
generateRouteManifestpowers thegeneratecommand.
📄 License
This project is licensed under the MIT License.
