CLI Agent — Overview

The CMS Assets Agent (@synchronized-studio/cmsassets-agent) is a CLI that automatically integrates the response transformer into your project. Instead of manually adding imports and wrapping fetch calls, you run a single command; the agent scans your codebase, installs the transformer, and patches the right files.


What it does

  • Detects your stack — framework (Nuxt, Next, Remix, Astro, SvelteKit, Express, Hono, Fastify) and CMS (Prismic, Contentful, Sanity, Shopify, Cloudinary, Imgix, or generic S3/R2/GCS origins)
  • Finds injection points — fetch calls, loaders, useAsyncData/useFetch, getServerSideProps, API routes, composables
  • Installs @synchronized-studio/response-transformer and applies the correct options (including cmsAssetsUrl for Nuxt via runtime config when needed)
  • Adds a cmsassets:transform script to package.json so you can re-run when you add new CMS-backed code

Idempotent and safe to re-run: already-patched files are skipped.


Quick start

From your project root, after you've created a tenant and know your CMS Assets URL:

npx @synchronized-studio/cmsassets-agent init

You'll be prompted for your tenant slug so the agent can set CMS_ASSETS_URL (or configure Nuxt runtime config). Use the slug from your dashboard (e.g. my-projecthttps://my-project.cmsassets.com).


Re-run after code changes

When you add new pages, composables, or API routes that fetch CMS data:

npm run cmsassets:transform

Only files that are not yet transformed will be patched.


CLI Agent section


Next steps

Need help understanding this?Ask CMS Assets Copilot about features, setup, or integrations.
Ask Copilot →