nt3 CLI is designed for use in CI/CD pipelines. All commands support non-interactive authentication via a flag or environment variable, and produce machine-readable JSON output with --json.
Recommended pattern
1 on any error, making it straightforward to fail a pipeline step when something goes wrong.
GitHub Actions
Push on source file change
This workflow triggers whenever the source translation file is updated onmain, pushes the new strings to Entri, triggers AI translation, and pulls the results back as a commit.
Pull on demand
A manually triggered workflow for pulling the latest translations without running a full sync:Environment variables
NT3_API_TOKEN
Set this variable instead of running nt3 login. It takes priority over stored credentials and requires no login step:
NT3_TOKEN (or any name you prefer) and reference it with ${{ secrets.NT3_TOKEN }}.
Adding secrets in GitHub
- Go to your repository on GitHub
- Navigate to Settings > Secrets and variables > Actions
- Click New repository secret
- Set the name to
NT3_TOKENand paste your Entri API token as the value
GitLab CI
NT3_TOKEN as a CI/CD variable in Settings > CI/CD > Variables.
Exit codes
All commands respect these exit codes, so pipeline steps fail automatically on error without any additional scripting.
Parsing JSON output
With--json, commands write structured JSON to stdout. You can pipe this to jq for further processing:
Tips for reliable pipelines
- Pin the CLI version to avoid unexpected behavior from updates:
npm install -g nt3@1.2.3 - Cache the npm install using
actions/cacheto speed up workflows - Use
[skip ci]in auto-commit messages to prevent recursive workflow triggers - Run
nt3 statusearly in a workflow to debug authentication issues before the real commands run