Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
The content of this page was translated using an AI.
See the last version of the original content in EnglishIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Intlayer CLI Login Command
Description
The login command of the Intlayer CLI allows you to authenticate with the Intlayer CMS. This command automatically opens your default browser to complete the authentication process and receive the necessary credentials (Client ID and Client Secret) to use Intlayer services.
Usage
Copy the code to the clipboard
or
Copy the code to the clipboard
Options
--cms-url <url>
Specify the URL of the Intlayer CMS to connect to for authentication.
- Type:
string - Default: The value configured in
intlayer.config.*orhttps://intlayer.org - Example:
Copy the code to the clipboard
Configuration Options
You can also use common configuration options:
--env-file <path>: Path to the environment file-e, --env <env>: Execution environment--base-dir <dir>: Base directory of the project--verbose: Enable verbose output (default: true)--prefix <prefix>: Prefix for logs
How It Works
- Local Server Start: The command starts a local HTTP server on a random port to receive credentials from the CMS.
- Browser opening: The command automatically opens your default browser to the CMS login URL
- Authentication: Complete the authentication in the browser using your Intlayer account
- Credentials reception: The local server receives the Client ID and Client Secret from the CMS
- Instructions: The command displays instructions for configuring credentials in your project
Output
After a successful login, the command will display:
- The received credentials (Client ID and Client Secret)
- Instructions for the
.envfile:
Copy the code to the clipboard
- Instructions for the Intlayer configuration file:
Copy the code to the clipboard
Keeping the access key safe
intlayer login issues an access key: a clientId / clientSecret pair that every credentialed command (push, pull, fill, configuration push, live, …) uses to authenticate.
Copy the code to the clipboard
import type { IntlayerConfig } from "intlayer";
const config: IntlayerConfig = {
editor: {
clientId: process.env.INTLAYER_CLIENT_ID,
clientSecret: process.env.INTLAYER_CLIENT_SECRET,
},
};
export default config;
clientSecretis a server-side credential. It grants full project-scoped API access — reading and writing your dictionaries, your project and your organisation. Keep it in.env(git-ignored) or your CI secret store, and never inline it in the configuration file.
Intlayer enforces this rather than only documenting it:
clientSecretis stripped from the configuration your bundler inlines, so it cannot reach a browser bundle whatever framework integration you use. It is only ever read server-side, at runtime, from the environment.clientIdis different: it is the public project key, safe to ship, and used by@intlayer/analyticsto obtain a short-lived, ingest-only token.
Commenting clientId out is enough to disable every credentialed behaviour — remote dictionary fetching, CMS access, analytics — even when the environment variables are still defined.
For CI pipelines, prefer the ci command, which injects the credentials for the duration of a single run instead of persisting them.
Manual Configuration
If the browser does not open automatically, you can manually visit the URL displayed in the terminal.
Examples
Login with Custom CMS URL
Copy the code to the clipboard
Login with Specific Environment File
Copy the code to the clipboard
Login in Verbose Mode
Copy the code to the clipboard
Troubleshooting
Browser Doesn't Open
If the browser does not open automatically, copy the URL displayed in the terminal and open it manually in your browser.
Connection Issues
If you encounter connection issues, verify:
- That the CMS URL is correct
- That your internet connection is working correctly
- That no firewalls are blocking the connection
Credentials Not Received
If credentials are not received:
- Ensure you have completed the authentication process in the browser
- Verify that the local port is not blocked
- Try the command again
Next Steps
After completing the login:
- Add the credentials to your
.envfile - Configure your
intlayer.config.*file with the credentials - Use CLI commands to manage your dictionaries:
npx intlayer push- Push dictionaries to the CMSnpx intlayer pull- Pull dictionaries from the CMSnpx intlayer fill- Fill in missing translations
