שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
היסטוריית גרסאות
- "init only installs the packages and sets up the framework; add one sub-command per setup step; --interactive fails without a terminal"v9.5.1329.9.2026
- "Add init infra sub-command"v9.5.621.9.2026
- "Add --no-gitignore option"v8.6.431.3.2026
- "Add init command"v7.5.930.12.2025
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתאם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודהעתקת ה-Markdown של המסמך ללוח
Initialize Intlayer
העתקת הקוד ללוח
The init command installs the Intlayer packages and sets up your framework (configuration file, TypeScript, bundler plugin, middleware/proxy, providers). It's the recommended way to get started with Intlayer.
Everything else (CI workflows, AI skills, MCP server, editor tooling, lint rules, CMS, infrastructure) is opt-in: pick it from the --interactive checklist, or run its dedicated sub-command.
Aliases:
npx intlayer init
Arguments:
--project-root [projectRoot]- Optional. Specify the project root directory. If not provided, the command will search for the project root starting from the current working directory.--no-gitignore- Optional. Skip the automatic update of the.gitignorefile. If this flag is set,.intlayerwill not be added to.gitignore.--no-framework-setup- Optional. Only install the packages, without touching the project files.--routing <routing>- Optional. Locale routing:prefix-no-default(default),prefix-all,no-prefix,search-paramsornone.--content <layout>- Optional. How content is declared:multilingual-{fileName}.content.{ts,json}next to the component, every locale in one file (setscompiler.output).per-locale-{fileName}.{locale}.content.{ts,json}next to the component (setscompiler.outputanddictionary.locale).centralized- one/locales/{locale}.{json,po}catalog per locale (adds thesyncJSON/syncPOplugin).namespaces-/locales/{locale}/{namespace}.{json,po}catalogs (adds thesyncJSON/syncPOplugin).
--content-format <format>- Optional, with--content.tsorjsonformultilingual/per-locale,jsonorpoforcentralized/namespaces. Defaults to the first one.--message-format <format>- Optional, with--content centralizedornamespacesin JSON. Message syntax of the catalogs:icu(default),i18next,vue-i18norintlayer.-i, --interactive- Optional. Pick the setup steps from a checklist (packages, CI, skills, MCP, VS Code, LSP, lint, CMS, infrastructure, …) instead of running the default set. Needs a terminal: without one (AI agent, CI), the command fails and lists the sub-commands to run instead.--no-github-actions- Optional. With--interactive, never scaffold the GitHub Actions workflows, even if selected.
What it does:
The init command performs the following setup tasks:
- Validates project structure - Ensures you're in a valid project directory with a
package.jsonfile - Installs the packages - Installs the missing Intlayer packages for your stack (e.g.
react-intlayer,vite-intlayer) and upgrades the outdated ones - Updates
.gitignore- Adds.intlayerto your.gitignorefile to exclude generated files from version control (can be skipped with--no-gitignore) - Configures TypeScript - Updates all
tsconfig.jsonfiles to include Intlayer type definitions (.intlayer/**/*.ts) - Creates configuration file - Generates an
intlayer.config.ts(for TypeScript projects) orintlayer.config.mjs(for JavaScript projects) with default settings - Updates the bundler / framework config - Adds the Intlayer plugin to your Vite, Next.js, Nuxt, Astro, … configuration, and scaffolds the middleware/proxy and providers when the framework supports it
Set up one step at a time
Every step of the --interactive checklist has its own sub-command. They never prompt when their values are passed as flags, so they are safe to run from an AI agent or a CI job.
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Command | What it sets up |
|---|---|
intlayer init packages | Installs the missing Intlayer packages and upgrades the outdated ones |
intlayer init project [--routing <routing>] [--content <layout>] | Configuration file, TypeScript, bundler plugin, middleware/proxy, providers and .gitignore |
intlayer init github-actions | The fill and test GitHub Actions workflows |
intlayer init vscode-extension | Recommends the Intlayer extension in .vscode/extensions.json |
intlayer init lsp | The Intlayer language server in .vscode/settings.json |
intlayer init eslint | The Intlayer lint rules (ESLint / oxlint), when the project already lints |
intlayer init skills [--platform <platform>] [--skills <skills…>] | The Intlayer documentation as AI agent skills |
intlayer init mcp [--platform <platform>] [--transport <stdio/sse>] | The Intlayer MCP server |
intlayer init extension [--browser <chrome/firefox>] | Opens the store page of the Intlayer browser extension |
intlayer init cms | Logs in to the Intlayer CMS through your browser and stores the credentials in .env |
intlayer init infra --mode <desktop/docker/compose> | The desktop app or a self-hosted stack |
From an AI agent or a CI job
An AI agent's shell has no terminal, so a prompt cannot be answered. Use the default command, then the sub-commands you need:
העתקת הקוד ללוח
Without a terminal:
init skillsinstalls the skills matching your stack unless--skillsis set (e.g.--skills Usage Content React).init skillsandinit mcpuse the detected AI platform (Claude Code, Cursor, VS Code, Windsurf, …) unless--platformis set, and fail with the list of platforms when none is detected.init mcpuses thestdiotransport unless--transportis set.init infrarequires--mode, andinit extensiononly prints the store links unless--browseris set.
The MCP server is always configured inside the project (for Claude Code, in .mcp.json).
Examples:
Basic initialization:
העתקת הקוד ללוח
This will initialize Intlayer in the current directory, automatically detecting the project root.
Initialize with custom project root:
העתקת הקוד ללוח
This will initialize Intlayer in the specified directory.
Initialize without updating .gitignore:
העתקת הקוד ללוח
This will set up all configuration files but will not modify your .gitignore.
Set up the infrastructure (desktop app or self-hosting):
העתקת הקוד ללוח
Downloads and runs the hosted installer (https://intlayer.org/install.sh, or install.ps1 on Windows), which asks how you want to run Intlayer:
- Desktop app: installs the native dashboard on your machine, connected to the Intlayer Cloud.
- All-in-one Docker: dashboard + API + MongoDB + Redis + MinIO in a single container.
- Docker Compose: one container per service, for scalable self-hosting.
Skip the menu with --mode:
העתקת הקוד ללוח
The same step is offered by npx intlayer init --interactive. See the init infra reference for the installer settings, and the self-hosting guide for what each mode sets up.
Example output:
העתקת הקוד ללוח
Notes:
- The command is idempotent - you can run it multiple times safely. It will skip steps that are already configured.
- If a configuration file already exists, it won't be overwritten.
- TypeScript config files without an
includearray (e.g., solution-style configs with references) are skipped. - The command will exit with an error if no
package.jsonis found in the project root.
