CLI

The cli makes it easy to connect your Next.js project with the Locanext service.

You can install it from npm: @locanext/nts


Create a New Project

npx @locanext/nts create
  • Creates a new Next.js project using your project settings from the website.
  • Internally it uses the official create-next-app@latest, so your project always follows the best practices from the Next.js team.
  • After running this command, you get a ready-to-use multilingual Next.js app.

Initialize CLI in an Existing Project

npx nts init
  • Links your local Next.js project with the project you created on the website.
  • Creates the nts.config.json file in your project.
  • In this file, you define the path to your JSON translation files.

Update Translations

npx nts update
  • Downloads the latest translations from the website.
  • Updates your local JSON files.
  • Updates types for t-function.

Authentication

  • When you log in through the CLI, your access tokens are stored in your user folder~/.nts
  • This allows the CLI to work without asking you to log in every time.