Developers

Console Commands

Hyper includes console commands you can run from your Craft project’s directory.

Migrations

These commands convert fields and content from other link plugins into Hyper fields. Run the field step before the content step, or leave out --step to run both in order. Each source’s User Guide walks through a complete conversion, and Events explains how to map a custom source link type.

Converts Typed Link fields and their content to Hyper. Follow the Typed Link guide for the full process.

OptionDescriptionDefault
--stepThe step to run, either field, content or all for the full sequence. Typed Link also has a legacy step that updates fields from older Typed Link versions before the field step.all
--dry-runSet to 1 to preview the conversion without saving it.0
--sync-relationsSet to 0 to skip rebuilding Hyper’s relation rows after converting content.1
--create-backupSet to 1 to back up the database before writing, or 0 to skip the backup.The backupOnMigrate setting
php craft hyper/migrate/typed-link --step=field
php craft hyper/migrate/typed-link --step=content --dry-run=1
php craft hyper/migrate/typed-link

hyper/migrate/linkit

Converts Linkit fields and their content to Hyper. Follow the Linkit guide for the full process.

OptionDescriptionDefault
--stepThe step to run, either field, content or all for the full sequence.all
--dry-runSet to 1 to preview the conversion without saving it.0
--sync-relationsSet to 0 to skip rebuilding Hyper’s relation rows after converting content.1
--create-backupSet to 1 to back up the database before writing, or 0 to skip the backup.The backupOnMigrate setting
php craft hyper/migrate/linkit --step=field
php craft hyper/migrate/linkit --step=content --dry-run=1
php craft hyper/migrate/linkit

Converts Flipbox Link fields and their content to Hyper. Follow the Flipbox Link guide for the full process.

OptionDescriptionDefault
--stepThe step to run, either field, content or all for the full sequence.all
--dry-runSet to 1 to preview the conversion without saving it.0
--sync-relationsSet to 0 to skip rebuilding Hyper’s relation rows after converting content.1
--create-backupSet to 1 to back up the database before writing, or 0 to skip the backup.The backupOnMigrate setting
php craft hyper/migrate/link --step=field
php craft hyper/migrate/link --step=content --dry-run=1
php craft hyper/migrate/link

Converts Craft’s own Link field fields and their content to Hyper. Follow the Craft’s own Link field guide for the full process.

OptionDescriptionDefault
--stepThe step to run, either field, content or all for the full sequence.all
--dry-runSet to 1 to preview the conversion without saving it.0
--sync-relationsSet to 0 to skip rebuilding Hyper’s relation rows after converting content.1
--create-backupSet to 1 to back up the database before writing, or 0 to skip the backup.The backupOnMigrate setting
php craft hyper/migrate/craft-link --step=field
php craft hyper/migrate/craft-link --step=content --dry-run=1
php craft hyper/migrate/craft-link

hyper/migrate/oembed

Converts oEmbed fields and their content to Hyper. Follow the oEmbed guide for the full process.

OptionDescriptionDefault
--stepThe step to run, either field, content or all for the full sequence.all
--dry-runSet to 1 to preview the conversion without saving it.0
--sync-relationsSet to 0 to skip rebuilding Hyper’s relation rows after converting content.1
--create-backupSet to 1 to back up the database before writing, or 0 to skip the backup.The backupOnMigrate setting
php craft hyper/migrate/oembed --step=field
php craft hyper/migrate/oembed --step=content --dry-run=1
php craft hyper/migrate/oembed

hyper/migrate/entrify-categories

Updates Category links to Entry links with the same element IDs, for sites that have converted their categories to entries with Craft’s entrification. Follow the entrification guide for the full process.

OptionDescriptionDefault
--dry-runSet to 1 to preview the conversion without saving it.0
--sync-relationsSet to 0 to skip rebuilding Hyper’s relation rows after converting content.1
--create-backupSet to 1 to back up the database before writing, or 0 to skip the backup.The backupOnMigrate setting
php craft hyper/migrate/entrify-categories --dry-run=1
php craft hyper/migrate/entrify-categories

Content

These commands work on content already stored in a Hyper field. Each is a dry run unless you pass --dry-run=0.

hyper/content/modify

Runs every instance of a Hyper field through Hyper’s content API without changing its links, and reports how many owners matched and how many would be re-saved. With --dry-run=0, Hyper re-saves the stored link data in its current format and rebuilds the relation rows for owners that changed.

OptionDescriptionDefault
--fieldThe handle of the Hyper field to process. Required.
--dry-runSet to 0 to write changes. By default the command only reports what it would change.1
--include-nestedSet to 0 to skip instances of the field inside Matrix, Neo, Super Table and Vizy fields.1
--element-idsA comma-separated list of owner element IDs to limit the command to.All owners
--content-containsOnly process owners whose stored link data contains this text.
--delayThe number of seconds to wait between fetches, such as 2 or 0.5.0
php craft hyper/content/modify --field=navLinks
php craft hyper/content/modify --field=navLinks --element-ids=12,48 --dry-run=0

hyper/content/sync-relations

Rebuilds Hyper’s relation rows for a field from the link data saved on each owner, without changing that data. Run it when reverse relations or eager-loaded links don’t match the saved links.

OptionDescriptionDefault
--fieldThe handle of the Hyper field to process. Required.
--dry-runSet to 0 to write changes. By default the command only reports what it would change.1
--include-nestedSet to 0 to skip instances of the field inside Matrix, Neo, Super Table and Vizy fields.1
--element-idsA comma-separated list of owner element IDs to limit the command to.All owners
--content-containsOnly process owners whose stored link data contains this text.
php craft hyper/content/sync-relations --field=navLinks
php craft hyper/content/sync-relations --field=navLinks --dry-run=0

hyper/content/refresh-embeds

Fetches the metadata of Embed links again and saves it, for links whose stored embed data Hyper didn’t fetch itself. Embed links only render their embed HTML from metadata that Hyper fetched and signed, so links saved with only a URL, or with metadata your own code wrote without Embed::prepareEmbedData(), render as plain links until they’re refreshed. Run it after upgrading, as the upgrade guide describes. Links that Hyper fetched already are left as they are, and links of an Embed link type that’s disabled on the field are refreshed too.

The dry run lists the links it would refresh without contacting any provider. With --dry-run=0, Hyper fetches each URL once, applying the link type’s allowed domains, and saves the result on every element, draft and revision that uses it. If a fetch fails, the command reports the error and carries on with the other links, so you can run it again later for the ones that failed.

Providers such as YouTube limit how many requests they accept in a short time. When a provider responds that it's limiting requests or is unavailable, the command reports those links as failed and leaves them unchanged. Use --delay to space out the requests, and run the command again later for any that failed.

OptionDescriptionDefault
--fieldThe handle of a Hyper field to process.Every Hyper field with an Embed link type
--dry-runSet to 0 to fetch and save the metadata. By default the command only lists the links it would refresh.1
--include-nestedSet to 0 to skip instances of the field inside Matrix, Neo, Super Table and Vizy fields.1
--element-idsA comma-separated list of owner element IDs to limit the command to.All owners
--content-containsOnly process owners whose stored link data contains this text.
php craft hyper/content/refresh-embeds
php craft hyper/content/refresh-embeds --dry-run=0
php craft hyper/content/refresh-embeds --field=videos --element-ids=12,48 --dry-run=0
php craft hyper/content/refresh-embeds --delay=2 --dry-run=0

Updates the settings of fields from older Typed Link versions to the current Typed Link format. hyper/migrate/typed-link runs this as its legacy step, so you only need it on its own when updating those fields separately.

php craft hyper/typed-link-legacy