שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתאם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודהעתקת ה-Markdown של המסמך ללוח
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
העתקת הקוד ללוח
or
העתקת הקוד ללוח
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:
העתקת הקוד ללוח
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 detailed 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 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:
העתקת הקוד ללוח
- Instructions for the Intlayer configuration file:
העתקת הקוד ללוח
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.
העתקת הקוד ללוח
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 organization. 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 flag, which injects the credentials for the duration of a single run instead of persisting them.
Manual Configuration
If the browser doesn't open automatically, you can manually visit the URL displayed in the terminal.
Examples
Login with Custom CMS URL
העתקת הקוד ללוח
Login with Specific Environment File
העתקת הקוד ללוח
Login in Verbose Mode
העתקת הקוד ללוח
Troubleshooting
Browser Doesn't Open
If the browser doesn't 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 properly
- That there are no firewalls blocking the connection
Credentials Not Received
If credentials are not received:
- Make sure you 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:
