Developing Nibble
Commands
Every nibble command in one place, with what it is for.
Every command explains its own options:
bin/rails nibble:content:import --help
Checking a site
bin/rails nibble:check # schema, theme, roles, settings, pending migrations, ejected files
bin/rails nibble:check --support # a summary of this install, for pasting into an issue
bin/ci # every check Nibble runs on itself
nibble:check is the one to run when something is not behaving and you do not yet know why. It reads all three
schema layers, the settings, the roles and your ejected files, and reports every problem at once in plain
language.
Making things
bin/rails nibble:generate:theme almanac
bin/rails nibble:generate:view guides/index --collection=guides
bin/rails nibble:generate:collection guides
bin/rails nibble:generate:taxonomy regions
bin/rails nibble:generate:blueprint guides/gallery
bin/rails nibble:generate:fieldset seo
bin/rails nibble:generate:global contact
bin/rails nibble:generate:navigation main
bin/rails nibble:generate:form enquiry
Each writes a valid stub in the right place and refreshes the theme’s generated types. Prefer these to copying one of Nibble’s files, which leaves you maintaining a copy of something that will move.
People
bin/rails nibble:admin:create # asks for a role, name, email address and password
On a deployed server:
bin/kamal app exec -i 'bin/rails nibble:admin:create'
Content
bin/rails nibble:content:validate themes/crumbs/content # check a package without writing
bin/rails nibble:content:import # the active theme's package
bin/rails nibble:content:export tmp/package # this site's content as a package
bin/rails nibble:content:migrate --dry-run # pending schema/migrations/*.yml
bin/rails nibble:content:markdown # collections written as Markdown files
import takes --mode=update to refresh what is already there, --dry-run, and --webhooks to deliver
webhooks for what it changed. export takes --collections=, --locales= and --status=.
markdown takes a collection name to do just one, and --dry-run. See
Content written as files.
Maintenance
bin/rails nibble:schema:types # regenerate the theme's .nibble/types.d.ts
bin/rails nibble:search:rebuild # rebuild the search index
bin/rails nibble:assets:purge_unused # --confirm, --older-than-days=1
bin/rails nibble:upgrade # migrations and checks; runs before every boot
assets:purge_unused lists what it would remove and does nothing until you pass --confirm. Read
Backups before using it after a restore.
Installing and upgrading
./install.sh my-site # a new site
bin/rails nibble:install # --defaults, --force, --only=deploy
bin/rails nibble:eject <path> # take one of Nibble's files on
bin/nibble-upgrade [version] # on a workstation, never a server
Nibble’s own releases
bin/nibble-release 0.7.0 --feed ../nibble_site/content/docs/releases.json
See Releases.
Development only
bin/rails nibble:dev:seed # about 120 demo posts
RAILS_ENV=test bin/rails nibble:bench # render and listing budgets; --posts, --requests
The playground at /admin/nibble/playground renders every blueprint, plus one using every core fieldtype,
backed by in-memory records. It is the fastest way to see what a field looks like without making content. It is
development only.