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. "Add --no-gitignore option"
      v8.6.43/31/2026
    2. "Add init command"
      v7.5.912/30/2025
    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

    Initialize Intlayer

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer init

    The init command automatically sets up Intlayer in your project by configuring necessary files and settings. It's the recommended way to get started with Intlayer.

    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 .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're 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 all tsconfig.json files to include Intlayer type definitions (.intlayer/**/*.ts)
    4. Creates configuration file - Generates an intlayer.config.ts (for TypeScript projects) or intlayer.config.mjs (for JavaScript projects) with default settings
    5. Updates Vite config - If a Vite configuration file is detected, adds the vite-intlayer plugin import
    6. Updates Next.js config - If a Next.js configuration file is detected, adds the next-intlayer plugin import

    Examples:

    Basic initialization:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer init

    This will initialize Intlayer in the current directory, automatically detecting the project root.

    Initialize with custom project root:

    bash
    Copy code

    Copy the code to the clipboard

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

    This will initialize Intlayer in the specified directory.

    Initialize 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.

    Example output:

    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 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 include array (e.g., solution-style configs with references) are skipped.
    • The command will exit with an error if no package.json is found in the project root.
    Why Intlayer ?
    Alt+→

    In 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.