CLI reference
The dashild binary lives in @dashild/cli, which you install in the project:
pnpm add -D @dashild/cli@alphapnpm dashild <command>pnpm add -D installs the CLI as a development dependency: it is a tool for
building and checking your app, not code your production server needs to run.
pnpm dashild runs the locally installed binary, keeping the command version
consistent with the project.
pnpm create dashild is a different package (create-dashild) and only
scaffolds new apps.
Global option: --lang en|es (or DASHILD_LANG). It translates the main
messages; some command output (make:action, ui:add, eject, doctor) is
still English, and any value other than es falls back to en.
pnpm dashild init --auth better-auth --yesAdds the panel to an existing Next.js app. It reads
dashild-metadata.json, so run prisma generate first (or pass --metadata).
It prints the plan first; --yes writes, --dry-run never writes. Without
--force it refuses to overwrite existing files.
Use init once to create the panel’s connection points: configuration,
policies, server runtime, and the Next.js route. It is a scaffolding command,
not a migration runner or a replacement for your app’s layout and middleware.
| Option | Purpose |
|---|---|
--auth <none|better-auth> |
Auth integration. Defaults to none. |
--path <route> |
Mount route. Avoids an existing app/admin/page.tsx. |
--metadata <path> |
Explicit dashild-metadata.json. |
--cwd <dir> |
Project root. Defaults to the current directory. |
--yes |
Apply the plan. |
--dry-run |
Show the plan only. |
--force |
Overwrite the generated files. |
--tenancy |
Add the Organization model, tenant session, switch action, and sidebar switcher. Requires Better Auth and a schema without auth models. |
It writes panel.ts, policies.ts, actions/index.ts, icons.tsx,
runtime.ts, server.ts, registry.tsx, and the mount route. With
--auth better-auth it also writes the auth files, models, and env keys, and
appends missing keys to .env.example.
It does not touch middleware.ts/proxy.ts, the root layout, next.config,
or your .env.
--force overwrites the generated files (including the auth ones) but it does
not bypass a route conflict when you pass an explicit --path; choose another
route instead. Running init a second time fails on the files it already wrote,
and --force rewrites them.
upgrade
Section titled “upgrade”pnpm dashild upgrade --checkpnpm dashild upgrade --dry-runpnpm dashild upgradeUpdates the four @dashild/* packages to the npm latest tag, installs them,
runs prisma generate, and records the version in dashild.json. It never
rewrites the generated glue; it lists the version marker of each generated file
so you can review the ones from an older CLI. See Upgrading.
Options: --tag alpha, --to <v>, --check, --dry-run, --no-install,
--no-generate, --cwd.
make:resource
Section titled “make:resource”pnpm dashild make:resource CustomerReads the Prisma metadata and writes src/dashild/resources/customer.ts. The
file is write-once: it never overwrites an existing resource.
Use this after adding a Prisma model when you want Dashild to create the first table/form definition for it. Then edit the generated file to choose the fields and permissions your app actually needs.
- Skips
id,@updatedAt, and foreign keys written by a relation (Prisma marks them read-only). - Includes
Bytesfields, scalar lists as a JSON array, and m2m relations as a multiselect. o2m relations are managed from the child’s detail page. - Adds the resource to
panel.resourcesand a fail-closed entry topolicies.ts. --no-registerleavespanel.tsandpolicies.tsuntouched.--dir,--metadata,--cwd, and--dry-runare available.
make:widget
Section titled “make:widget”pnpm dashild make:widget RevenueOverview --statspnpm dashild make:widget OrdersChart --chart barpnpm dashild make:widget LatestOrders --tableWrites src/dashild/widgets/<name>.ts and adds the export to panel.widgets.
The file is write-once. The default type is stats; --info is an alias.
| Option | Purpose |
|---|---|
--stats / --info |
Stat cards |
--chart [type] |
Chart: line, area, bar, pie, doughnut |
--table |
Table widget |
--width <width> |
full, half, third, two-thirds |
--dir <path> |
Widgets folder |
--no-register |
Leave panel.ts untouched |
--dry-run |
Print the file without writing it |
See Dashboard widgets for the data contract and examples.
make:action
Section titled “make:action”pnpm dashild make:action Customer exportAppends a typed handler stub to src/dashild/actions/index.ts. It does not
edit the resource: declare the action in table.actions or form.actions.
Running it twice does not duplicate the handler, and dashild doctor
recognizes the generated assignment.
Use it when an action needs server-side behavior that normal create/edit/delete cannot express. The stub is only a starting point: implement the operation and return a suitable result before exposing it to users.
Options: --cwd, --dir (actions folder).
doctor
Section titled “doctor”pnpm dashild doctorpnpm dashild doctor --jsonParses resources with Babel and compares them with the metadata: model, slug,
columns, filters, form fields, relations, policy, the policies.ts entry,
action handlers, requires predicates, and duplicate slugs. It reports the
file and the line when the issue has one, and exits with code 1 on errors.
Findings such as a column without a form field are warnings and do not change
the exit code. It also exits with 1 when there is no resource at all. --json
is for CI.
Run doctor after generating or editing resources, and before opening a pull
request. It reports likely wiring and metadata errors; it does not execute the
app, connect to the database, or replace TypeScript and test runs.
Options: --cwd, --dir, --metadata, --policies, --actions, --json.
skill install
Section titled “skill install”pnpm dashild skill installpnpm dashild skill install --agent claudeCopies the Dashild agent skill into .claude/skills/dashild and/or
.opencode/skills/dashild, and adds a short pointer to AGENTS.md. Reinstalling
replaces the skill and refreshes the block. See AI assistant.
ui:add
Section titled “ui:add”pnpm dashild ui:add avatar-cell email-fieldCopies cell and field templates to components/dashild/ (or --dir). It does
not edit registry.tsx; it prints the exact call to add, for example
registerCell("avatar", AvatarCell). Options: --force, --dry-run, --dir,
--cwd.
Available templates: avatar-cell, email-field. An unknown name is reported
and the command still exits with code 0.
Use ui:add to copy a starter React component into your app. The printed
registration line is a separate step: add it to registry.tsx, then reference
the registered name from the resource definition.
pnpm dashild ejectpnpm dashild eject --yesRemoves the files written by init: the panel files, the mount route, and the
dashild script. It keeps resources, auth files, the Prisma generator, and
dependencies, and lists the ones it can detect. Without --yes it only prints
the plan. Options: --cwd, --path (when the route cannot be read from
panel.ts), --dry-run.
Use eject when you intentionally want to remove Dashild’s generated glue.
It does not uninstall packages, remove auth, or delete resource definitions.
Review the preview and create a backup or Git checkpoint before confirming.
Exit codes
Section titled “Exit codes”0 success; 1 a failed check, a refused overwrite, a missing metadata file,
or a validation error. A doctor run with no resources also exits with 1.