---
title: "systhema codemod"
description: "Run one codemod."
requested_language: ar
language: en
translation_notice: "This page isn't translated yet"
url: https://docs.systhema.app/ar/next/cli/codemod
version: unreleased (main)
docs_index: https://docs.systhema.app/ar/next/llms.txt
---
> This page isn't translated yet. Showing English.


Run a single code codemod on the current project. Mostly useful for debugging or for re-running an individual codemod after manual edits.

```bash
systhema codemod --list                          # list available codemods
systhema codemod rename-systhema-bin             # run by id
systhema codemod rename-systhema-bin --dry-run   # plan only
```

`systhema upgrade` runs every applicable codemod for you; see [Upgrading](https://docs.systhema.app/ar/next/getting-started/upgrading.md).

## Options

<!-- generated:cli-flags codemod -->

| Flag        | Description             | Default |
| ----------- | ----------------------- | ------- |
| `--dry-run` | Plan only, no changes   | `false` |
| `--list`    | List available codemods | `false` |

<!-- /generated -->

## Available codemods

<!-- generated:codemods -->

| ID                                      | Release | What it changes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Applies when                                                                                                                             |
| --------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `add-browserslist-to-package-json`      | `1.6.0` | Adds a `browserslist` field to the project root package.json with Systhema's modern baseline (`describeModernBaseline()`). Without this Next.js falls back to its default targets (Chrome 64+, etc.) and ships ~14 KB of polyfills for `Array.prototype.at`/`.flat`/`.flatMap` to every public page. Idempotent — does nothing if `browserslist` is already defined (whether the consumer set their own list or accepts the recommended one).                                                                                                                                                                                                                                                                                                                                                                                | Idempotent — does nothing if `browserslist` is already defined (whether the consumer set their own list or accepts the recommended one). |
| `add-cookie-consent-to-next-layout`     | `1.6.0` | Adds the `cookieConsent={getSysthemaCookieConsentConfig()}` prop to <SysthemaProvider> in the project's app/layout.tsx (or src/app/layout.tsx) so the cookie consent banner renders. Idempotent — does nothing if the prop is already present or if no SysthemaProvider is found (custom layout).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Idempotent — does nothing if the prop is already present or if no SysthemaProvider is found (custom layout).                             |
| `add-payload-instance-to-root-layout`   | `1.6.0` | Adds the `payloadInstance` prop to <RootLayout> in the consumer's app/(site)/template.tsx, enabling the cookie consent banner to resolve its config from the GeneralSettings global. Reuses an already-resolved payload instance if the layout has one (e.g. a custom `const payload = await getPayloadAuth(...)`), otherwise falls back to `getPayload({ config: configPromise })` and injects the `getPayload` / `configPromise` imports if missing. Idempotent — does nothing if the prop is already present, no template.tsx is found, or the project is not a Payload project.                                                                                                                                                                                                                                          | Idempotent — does nothing if the prop is already present, no template.tsx is found, or the project is not a Payload project.             |
| `adopt-icon-picker`                     | `1.6.0` | Preserves `faIconPickerField` compatibility calls and wraps custom Lexical converters that inject `data.icon`/`iconBefore`/`iconAfter` straight into `dangerouslySetInnerHTML` with `resolveIconForRender(…).svg` so Material Symbols identifier-only picks render. Ambiguous icon usages are reported, not rewritten. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                          |
| `optin-cookie-consent-tab`              | `1.6.0` | Preserve the cookie consent admin tab for a configured banner, without replacing existing General Settings choices. SQL databases need the tab's columns, localized fields and child tables. Run nav renames before schema additions, then copy settings. For push-mode PostgreSQL, review `systhema migrate --schema --dry-run`, then apply `systhema migrate --schema`; do not run `payload migrate` with a dev-push marker or generate a full-schema migration without a baseline. For a migration-based project with an existing snapshot baseline and no dev marker, use `pnpm payload migrate:create`, review the DDL, then `pnpm payload migrate`. `systhema migrate --schema` needs `@systhemaui/cli` and `@systhemaui/payload` at 1.7.0-canary.16 or later; an older Payload package does not register the command. |                                                                                                                                          |
| `remove-importmap-from-systhema-page`   | `1.6.0` | Drops the `importMap` import and the `importMap={importMap}` prop pass on <SysthemaPage> in the consumer's (site)/(systhema)/[[...segments]]/page.tsx. The prop was never read inside @systhemaui/payload, but importing the admin importMap from a public route was dragging the entire admin component graph into the public bundle. Idempotent — does nothing if neither the import nor the prop are present, or no matching page.tsx is found.                                                                                                                                                                                                                                                                                                                                                                           | Idempotent — does nothing if neither the import nor the prop are present, or no matching page.tsx is found.                              |
| `rename-emails-capability-strings`      | `1.6.0` | Rewrites occurrences of 'global.emails.read' and 'global.emails.update' in the project's TypeScript source to the new capability strings under 'global.general-settings.*'. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                          |
| `rename-figure-w-full`                  | `1.6.0` | Rewrites occurrences of the legacy `figure-w-full` CSS class to the new `figure-w-screen` name across project source files (.ts/.tsx/.js/.jsx/.css/.scss/.mdx/.md/.html/.svelte/.vue). Whole-token match only; build artifacts and node_modules are skipped. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                          |
| `rename-systhema-bin`                   | `1.6.0` | The project-local `systhema` bin was renamed to `systhema-core` in the next release so the `systhema` name belongs to the global Systhema CLI. This codemod updates npm scripts so they keep working.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                          |
| `add-searchparams-to-systhema-page`     | `1.7.0` | Adds the searchParams prop (param destructure + type) and forwards it to <SysthemaPage> in the consumer catch-all route so wildcard redirects can preserve the incoming query string. Idempotent — no-op when searchParams is already present or no matching page.tsx is found.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Idempotent — no-op when searchParams is already present or no matching page.tsx is found.                                                |
| `allow-pinch-zoom-in-root-layout`       | `1.7.0` | Deletes `maximumScale` and `userScalable` from the root layout's `viewport` export. Systhema used to scaffold both, which blocks pinch-zoom and fails WCAG 1.4.4 (Resize Text) plus Lighthouse's `[user-scalable="no"]` audit. The layout is a scaffold-mode file, so an upgrade can't rewrite it wholesale — this codemod edits the two properties in place and leaves everything else, including `viewportFit: 'cover'`, untouched. Idempotent.                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                          |
| `extract-forms-redirects-modules`       | `1.7.0` | Moves payload.config.ts's inline `forms: {…}` object and `redirect: <bool>` flag into `src/payload/forms.ts` and `src/payload/redirects.ts`, wired back by shorthand, so `systhema setup forms\|redirects` can toggle them. A customised forms object and an already-extracted module are left alone. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                          |
| `host-aware-robots`                     | `1.7.0` | Replaces the static app/robots.ts with app/robots.txt/route.ts. The static metadata file has no request context, so on a site serving one domain per locale every domain advertised the primary domain’s sitemap.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                          |
| `raise-browserslist-to-modern-baseline` | `1.7.0` | Systhema's browser baseline is `describeModernBaseline()` — the union of Tailwind v4's own floor, Next 16's "baseline widely available" target and Swiper 14's. Tailwind is a hard requirement, so a Systhema site does not render below that line whatever the JavaScript is compiled for. This raises any `>=` floor in the root package.json `browserslist` that sits below it, so the build stops down-compiling and shipping legacy JavaScript for browsers the CSS never supported. A floor already at or above the baseline is left alone, a browser absent from the list is not added, and every other query shape (`last 2 versions`, `defaults`, `> 0.5%`) is untouched. Projects that keep their targets in a `.browserslistrc` need to raise them by hand. Idempotent.                                           |                                                                                                                                          |
| `rename-seo-capability-strings`         | `1.7.0` | Rewrites occurrences of 'global.seo.read', 'global.seo.update', and the 'global.seo._' wildcard in the project's TypeScript source to their 'global.general-settings.seo._' equivalents. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                          |
| `repair-fa-icon-picker-import`          | `1.7.0` | Restores faIconPickerField imports from the FontAwesome subpath after the old adopt-icon-picker rename. Reports ambiguous generic picker calls from the fields barrel without modifying them. Preserves aliases and shadowing bindings. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                          |
| `replace-admin-favicon`                 | `1.7.0` | Rewrites the admin favicon to the Systhema mark and renames it to match the new `admin.meta.icons` default. The artwork is only overwritten when the file is still Systhema's shipped placeholder — a customised icon is renamed with its artwork untouched. Also rewrites hardcoded '/gg-icon.svg' references in the project's source. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                          |
| `add-postinstall-cache-refresh`         | `1.7.1` | Adds a postinstall script that refreshes the package token cache from existing generated artifacts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                          |
| `declare-email-schema`                  | `1.7.1` | Rewrites the generated Resend module and emails option so schema registration is source-controlled. Skips customized files.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                          |
| `rewrite-icon-tag-variants`             | `1.7.1` | Rewrites removed `Icon.<tag>` JSX variants imported from `@systhemaui/react` or `@systhemaui/next` to `Icon as="tag"`. Preserves `Icon.a`, reports ambiguous members and spread attributes for review, and leaves other icon components unchanged.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                          |
| `commit-managed-files-ledger`           | `1.7.3` | A project whose .gitignore excludes all of .systhema/ never commits the managed-files ledger, so every fresh checkout loses the record of which managed files you edited and the next create-app-files run takes the one-time backup path again. Narrows the rule to .systhema/* and re-includes the ledger.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                                                                                          |
| `rename-deduplicated-translation-keys`  | `1.7.4` | Rewrites the 130 removed Systhema Admin translation keys (for example 'common:background_variant') to the surviving key with the same text in every language (for example 'common:backgroundVariant') across the project's TypeScript source. Idempotent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                          |
| `robots-host-allowlist`                 | `1.7.5` | Rewrites the scaffolded app/robots.txt/route.ts to resolve its origin with resolveSysthemaPublicOrigin, so a forged Host or X-Forwarded-Host header can no longer poison the CDN-cached robots.txt.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                          |

<!-- /generated -->
