@acryldev/create-blends
v1.7.43
Published
Create an Acryl app: npm create @acryldev/blends@latest
Readme
@acryldev/create-blends
Create an Acryl app with one command.
npm create @acryldev/blends@latest my-appIt asks which template you want, creates my-app, and prints what to run next. Other package managers work the same way: pnpm create @acryldev/blends@latest, yarn create @acryldev/blends, bun create @acryldev/blends.
Templates
Every template is a Cordis app: blend.yaml lists the plugins that are mounted and every plugin is a folder in plugins/.
| Template | What you get |
| --- | --- |
| blank | the smallest app: the router, a server and one route, with a test |
| nodejs | a web app: routes, a server-rendered JSX page and a client component, with tests; run with Node.js 22.19 or newer |
| notes | a full-stack starter: accounts (scrypt, cookie session), notes in SQLite through the db port, validated forms, search, a JSON API with a typed test client, csrf on, a test for every route |
| chat | an AI chat starter: the answer streams token by token (Server-Sent Events) from an OpenAI-compatible API (DeepSeek by default, key only from DEEPSEEK_API_KEY), a client component with a Stop button that also stops the request to the model, history in SQLite, tests with a mock model |
| todo | a to-do list on the router and state: CRUD routes, a page, tests |
| agent | the blank app with an offline agent that builds plugins into the running app, through the door (acryl-app is the old name for it and still works) |
Every template includes AGENTS.md, CLAUDE.md and a copy of the framework documentation in docs/framework/, so a coding agent working in the folder reads the API from the folder.
Non-interactive use
Arguments for the initializer go after -- with npm create:
npm create @acryldev/blends@latest my-app -- --template nodejs --install --pm npm| Option | |
| --- | --- |
| --template <name> | blank, nodejs, notes, chat, todo or agent (the same list as acrylblends init; acryl-app still means agent; a bare name after the directory means the same: npm create @acryldev/blends@latest my-app notes) |
| --desktop | put the app inside the ACRYL frame: npm run dev opens it with the chat, the panels and Settings. Not with a starter from a source |
| --install | install the dependencies after creating the app |
| --pm <manager> | npm, pnpm, yarn or bun (default: the one that ran the command) |
| -y, --yes | ask nothing: template nodejs, directory acrylblends-app unless given |
Then
cd my-app
npm install # unless you passed --install
npm run dev # prints its URL; GET / answers "Acryl!"
npm testimport { Acryl } from '@acryldev/blends'
const app = new Acryl()
app.get('/', (c) => c.text('Acryl!'))
export default appWhere an app's shared code comes from
An app made here holds two kinds of code that are not its own, and says so in its files:
- The library plugins (
plugins/door,@acryldev/router,desktop,instance,plugin-shareand the others named inplugins/library.json) are copies of the acrylblends library, from https://github.com/acrylblends/acrylblends.plugins/library.lock.jsonrecords the release each came from and a hash of every file.npx @acryldev/blends upgradebrings them to the newest release; when a file was changed here, it stops, shows the diff and changes nothing (--forcereplaces it and keeps a backup in.acryl/upgrade-backup/). Fix a library plugin in acrylblends, not here; your own code goes in a plugin of your own underplugins/. - The frame and its parts (
@acryldev/blends-frame,@acryldev/settingsand the other@acryldev/*packages inpackage.json) and the framework (acrylblends) come from npm, built from the same repository (ide/andpackages/).npm installinstalls them;npx @acryldev/blends upgrademovespackage.jsonto the release it brings.
Everything else (blend.yaml, src/, your plugins under plugins/) is the app's own, and an upgrade never touches it.
Links
- Documentation: https://acrylblends.github.io/docs (mirrored at https://acryl.dev/docs)
- The framework package: https://www.npmjs.com/package/acrylblends
- Source and issues: https://github.com/acrylblends/acrylblends
- Blends registry: https://acrylblends.github.io/blends
- ACRYL: https://acryl.dev
MIT license.
The notes template
npm create @acryldev/blends@latest my-notes -- --template notes makes a small full-stack app, written to be read and copied:
- sign up and log in (scrypt password hashes from
node:crypto, a random token in anhttpOnlycookie, sessions in the database); - notes in SQLite through the built-in
node:sqlite(Node.js 22.19 or later, nothing native to install), with create, edit, delete and search forms, server-side validation with messages on the page, and a redirect (303) after each POST; - a JSON API under
/api/notesthat shares the validation rules, with a test that uses the typedtestClient; - csrf protection on, a test for every route, and an
AGENTS.mdthat describes the files so a coding agent can extend it; - a live character counter and an instant filter written as a small script in the page. When the client components of
acrylblends/jsx/domcan be served without a bundler (planned for 0.7.2), they will replace that script here.
npx @acryldev/blends add desktop followed by npm install and npm run desktop runs it as a desktop window (see docs/framework/getting-started/desktop.md).
Templates from a repository or a package
npm create @acryldev/blends@latest my-app github:owner/repo[#ref]
npm create @acryldev/blends@latest my-app @scope/name[@version]
npm create @acryldev/blends@latest my-app ./template.tgzThe source is downloaded as a tarball (never cloned) or packed with npm pack --ignore-scripts, unpacked, and read: it must hold an acryl.template.json (name, description, optional plugins), it is checked for secrets, and only then is the folder created. Nothing of the template is installed or run; if its package.json defines install scripts they are listed, and --install prints what will run before it runs. See the @acryldev/create-blends guide in docs/framework/guides/.
