HomeSandboxShowcaseAppDocBlog
    • EnglishEnglish
      EN
    • русскийRussian
      RU
    • 日本語Japanese
      JA
    • françaisFrench
      FR
    • 한국어Korean
      KO
    • 中文Chinese
      ZH
    • españolSpanish
      ES
    • DeutschGerman
      DE
    • العربيةArabic
      AR
    • italianoItalian
      IT
    • British EnglishBritish English
      EN-GB
    • portuguêsPortuguese
      PT
    • हिन्दीHindi
      HI
    • TürkçeTurkish
      TR
    • polskiPolish
      PL
    • IndonesiaIndonesian
      ID
    • Tiếng ViệtVietnamese
      VI
    • українськаUkrainian
      UK
    /
    Filter docs by framework
    Alt+←
    Why Intlayer ?
    Get Started
    Concept
    • How Intlayer Works
    • Configuration
    • TestFillBuildWatchExtractLoginPushPullConfigurationListVersionEditorLiveDebugDoc ReviewDoc TranslateSDK
    • Visual Editor
    • CMS
    • CI/CD Integration
    • TranslationPluralEnumerationConditionGenderInsertionFileNestingMarkdownHTMLFunction Fetching
    • Per Locale File
    • Compiler
    • Auto Fill
    • Testing
    • Bundle Optimization
    Environment
    • Next.js 14 and App Router
      Next.js 15
      Next.js no locale path
      Next.js and Page Router
      Compiler
    • Tanstack Start Solid
    • Astro and React
      Astro and Svelte
      Astro and Vue
      Astro and Solid
      Astro and Preact
      Astro and Lit
      Astro and Vanilla JS
    • React Router v7
      React Router v7 (fs-routes)
      Compiler
    • Nuxt and Vue
    • Vite and Solid
    • SvelteKit
    • Vite and Preact
    • Vite and Vanilla JS
    • Vite and Lit
    • Angular 19 (Webpack)
      Analog
    • React CRA
    • React Native and Expo
    • Express.js
      NestJS
      Fastify
      Hono
      Adonis
    • Lynx and React
    Plugins
    • JSON
    • gettext (.po)
    VS Code Extension
    Agent
    • MCP Server
    • Agent skills
    Releases
    • v8
    • v7
    • v6
    Benchmark
    • Next.js
    • TanStack
    • Vue
    • Solid
    • Svelte
    Blog
    Ask a question
    1. Documentation
    2. Concept
    3. CLI
    4. Init
    Creation:2025-12-30Last update:2025-12-30
    Reference this doc to your favorite AI assistant
    ChatGPT
    Claude
    DeepSeek
    Google AI mode
    Gemini
    Perplexity
    Mistral
    Grok

    Ask your question and get a summary of the document by referencing this page and the AI provider of your choice

    Version History

    1. "Added --no-gitignore option"
      v8.6.431/03/2026
    2. "Added init command content"
      v7.5.930/12/2025

    The content of this page was translated using an AI.

    See the last version of the original content in English
    Edit this doc

    If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.

    GitHub link to the documentation
    Copy

    Copy doc Markdown to clipboard

    Initialise Intlayer

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer init

    The init command automatically configures Intlayer for your project by creating necessary files and settings. This is the recommended way to start with Intlayer.

    Aliases:

    • npx intlayer init

    Arguments:

    • --project-root [projectRoot] - Optional. Specify the project's root directory. If not provided, the command will search for the project root starting from the current working directory.
    • --no-gitignore - Optional. Skips the automatic update of the .gitignore file. If this flag is set, .intlayer will not be added to .gitignore.

    What it does:

    The init command performs the following setup tasks:

    1. Validates project structure - Ensures you are in a valid project directory with a package.json file.
    2. Updates .gitignore - Adds .intlayer to your .gitignore file to exclude generated files from version control (can be skipped with --no-gitignore).
    3. Configures TypeScript - Updates any tsconfig.json files to include the Intlayer type definitions (.intlayer/**/*.ts).
    4. Creates configuration file - Generates intlayer.config.ts (for TypeScript projects) or intlayer.config.mjs (for JavaScript projects) with default settings.
    5. Updates Vite configuration - If a Vite config file is detected, it adds the import for the vite-intlayer plugin.
    6. Updates Next.js configuration - If a Next.js config file is detected, it adds the import for the next-intlayer plugin.

    Examples:

    Basic initialisation:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer init

    This initialises Intlayer in the current directory, with automatic project root detection.

    Initialisation with a custom project root:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer init --project-root ./my-project

    This initialises Intlayer in the specified directory.

    Initialisation without updating .gitignore:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer init --no-gitignore

    This will set up all configuration files but will not modify your .gitignore file.

    Output Example:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer initChecking Intlayer configuration...✓ Added .intlayer to .gitignore✓ Updated tsconfig.json to include intlayer types✓ Created intlayer.config.ts✓ Injected import into vite.config.ts✓ Intlayer init setup complete.

    Notes:

    • The command is idempotent - you can safely run it multiple times. Already configured steps will be automatically skipped.
    • If a configuration file already exists, it will not be overwritten.
    • TypeScript configurations without an include array (e.g. solution-style configurations with references) are skipped.
    • The command stops with an error if no package.json is found in the project root.
    Why Intlayer ?
    Alt+→

    On this page

      Discussions are anonymous and regularly reviewed to address common issues. Feel free to share feature ideas, feedback on the documentation, or anything related to Intlayer, we use this input to shape our roadmap and improve the product.

      npx intlayer init
      npx intlayer init
      npx intlayer init --project-root ./my-project
      npx intlayer init --no-gitignore
      npx intlayer initChecking Intlayer configuration...✓ Added .intlayer to .gitignore✓ Updated tsconfig.json to include intlayer types✓ Created intlayer.config.ts✓ Injected import into vite.config.ts✓ Intlayer init setup complete.