remove, restore, reset, remove-backups
Removing a file the template ships, and getting it back. Nothing is deleted without a reference check and a backup first.
remove
npm run smart-admin -- remove <target> [--backup|--no-backup]The target is a path from the project root. There is no --help on this command — it would be read as a filename.
It refuses while anything imports the file
Checking references to src/shared/components/common/SaRating.vue...
Refusing — 1 file(s) reference this:
src/modules/ui-kit/pages/ratings.vue
Detection is regex-based (basename match). If these matches are false
positives — comments, unrelated identifiers, dynamic imports — remove
the references manually first.The check is a basename regex, and the command says so. It over-matches rather than under-matches: a comment mentioning the file counts as a reference. That is the right way round — a false refusal costs you one manual edit, a missed reference costs you a broken build.
When nothing references it
Checking references to src/shared/utils/scratch-demo.ts...
✔ Removed src/shared/utils/scratch-demo.ts
Backup: .smart-admin/backups/1790267645352/src/shared/utils/scratch-demo.ts
Restore: npm run smart-admin -- restore src/shared/utils/scratch-demo.ts
Delete backups: npm run smart-admin -- remove-backupsEvery message carries the command that undoes it.
restore
npm run smart-admin -- restore <target>✔ Restored src/shared/utils/scratch-demo.ts
From: .smart-admin/backups/1790267645352/src/shared/utils/scratch-demo.tsWith no backup for that path it says so and does nothing.
reset
Restores every backed-up file whose destination is currently missing. It is a dry run unless you pass --yes.
npm run smart-admin -- reset
npm run smart-admin -- reset --yesFound 6 backed-up file(s):
src/assets/styles/locales.css present — skip
src/core/config/defaultConfig.ts present — skip
src/core/i18n/index.ts present — skip
src/core/i18n/localeMeta.ts present — skip
src/locales/nl.json from 2026-09-24T16:33:09.377Z
src/shared/utils/scratch-demo.ts present — skip
Dry run — would restore 1 file(s). Pass --yes to apply.A file that is already there is skipped, not overwritten. reset puts back what is missing; it does not roll your edits back to the backup.
remove-backups
Deletes the backups themselves. Also a dry run unless you pass --yes.
Usage: smart-admin remove-backups [--yes] [--backup <timestamp>]2 backup(s) in .smart-admin/backups/:
1790267645352 2026-09-24T16:34:05.352Z · 1 file(s), 24 B
1790267589377 2026-09-24T16:33:09.377Z · 5 file(s), 305.2 kb
Dry run — would delete 2 backup(s), 6 file(s), 305.2 kb. Pass --yes to apply.
This cannot be undone — anything removed but not committed goes with them.With --yes:
deleted .smart-admin/backups/1790267645352/
deleted .smart-admin/backups/1790267589377/
removed the empty .smart-admin/backups/
✔ Deleted 2 backup(s), 305.2 kb freed.Pass --backup <timestamp> to delete one rather than all of them.
Where backups live
.smart-admin/backups/{timestamp}/, keeping each file's original path underneath. .gitignore already covers that directory, and the CLI says "already covers" rather than adding a duplicate rule.
Turning them off
--backup and --no-backup answer that question up front, so a script or a CI run never blocks on a terminal that is not there.
To skip them outside development, create .smart-admin/config.json:
{
"backups": {
"devOnly": true
}
}Backups are then skipped whenever NODE_ENV=production or CI is set. An explicit --backup still wins over it.
The shape of all four
Every destructive command here follows the same rules, which is what makes them safe to try:
- A dry run is the default for
resetandremove-backups. - A backup comes first for
removeandremove-locale. - The undo is printed in the success message.
- A refusal names the files that caused it.
Related
remove-locale— the same backup machinery, for a language.- CLI overview — the backup policy in one place.
- Project structure — what is safe to remove.