Docs CLI Reference

CLI Reference

Complete reference for all i1n CLI commands, flags, and options.

Overview

The i1n CLI is the primary interface for managing localization. Install it globally with npm i -g i1n.

All commands run in the context of the current project directory, using the configuration from i1n.config.json.

i1n init

Initialize i1n in a project. Runs an interactive setup that detects your project framework, sets the locale file format and directory, configures the source language, and creates i1n.config.json.

This command only needs to be run once per project. Re-run it to reconfigure settings.

i1n push

Push local translation files to i1n. The CLI scans your locale files (e.g., locales/**/*.json) and syncs only the keys and languages that have actually changed since your last sync.

Before sending anything to the server, push performs a three-way comparison between your local files, the current server state, and the baseline from your last sync (stored in locales/.i1n-push-state.json). The payload includes only the (key, language) pairs you modified. Languages you did not touch are preserved on the server, so a teammate's dashboard edit to a key you never opened is never overwritten.

If a key and language were edited on both sides since the last sync (a true conflict), the CLI prompts interactively: keep the local value, accept the server value, or abort the push. Server-only changes (edits made by another user or in the dashboard while you were working) are automatically written into your local files at push time, and i1n.d.ts is regenerated when needed.

Available flags: --translate [langs] triggers AI translation after push (example: i1n push --translate es,fr,de,ja); --strategy <mode> sets conflict policy to interactive (default in a terminal), ours (local wins), theirs (server wins), or abort (exit on any conflict). --force is shorthand for --strategy ours and overwrites server values, which is destructive and discards any server-side edits made by other writers.

i1n pull

Pull translations from i1n and write local files. Fetches all translations, writes locale files in your configured format, and generates i1n.d.ts TypeScript type definitions.

Run this after translations are complete, or as part of your CI/CD pipeline to ensure files are always in sync.

i1n add-language

Add new target languages to your project interactively. The command checks available language slots on your plan and allows reactivation of previously-used languages without consuming new slots.

Language availability depends on your plan: Starter supports 2, Pro supports 5, Business supports 12, and Enterprise supports all 182 languages.

i1n limits

Display project limits and current usage. Shows keys used vs. limit, AI translation credits used vs. limit, language slots used vs. available, and a list of active languages.

Use this command to monitor consumption and determine when a plan upgrade may be necessary.

i1n setup-ai

Generate AI agent context rules for the project. Creates rule files for Cursor (.cursor/rules/i1n.mdc), Claude Code (CLAUDE.md), Windsurf (.windsurfrules), GitHub Copilot (.github/copilot-instructions.md), Codex (AGENTS.md), and Antigravity (.antigravity/rules.md).

These files teach AI agents to use translation keys instead of hardcoded strings, place keys in correct namespace files, preserve interpolation variables, and run i1n push after modifications.

i1n mcp

Start a Model Context Protocol (MCP) server that exposes i1n tools to AI coding assistants. This allows Cursor, Claude Code, Windsurf, and other MCP-compatible agents to execute i1n commands directly — push, pull, translate, add languages, and more — without leaving the IDE.

The MCP server exposes 8 tools: i1n_status, i1n_push, i1n_pull, i1n_translate, i1n_add_language, i1n_extract_and_translate, i1n_search, and i1n_setup_bridge. The standout feature is i1n_extract_and_translate — your AI agent extracts hardcoded strings from a component, passes them to i1n, and they are instantly pushed, translated to all active languages, and type definitions are regenerated. The i1n_push tool runs the same three-way diff as the CLI but aborts on conflict so the agent can decide whether to pull, ask, or resolve manually before retrying. Configure it with: claude mcp add i1n -- npx i1n mcp.

terminal
i1n init
i1n push
i1n push --translate es,fr,ja
i1n pull
i1n add-language
i1n limits
i1n setup-ai
i1n mcp

Related