nt3 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -0
- package/main.js +1 -1
- package/package.json +2 -7
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# nt3
|
|
2
|
+
|
|
3
|
+
CLI for the [Entri](https://entri.app) localization management platform. Sync translation files between your codebase and Entri.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g nt3
|
|
9
|
+
# or use without installing
|
|
10
|
+
npx nt3 <command>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node.js 18+.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Authenticate
|
|
19
|
+
nt3 login
|
|
20
|
+
|
|
21
|
+
# 2. Initialize project config
|
|
22
|
+
nt3 init
|
|
23
|
+
|
|
24
|
+
# 3. Push source strings
|
|
25
|
+
nt3 push
|
|
26
|
+
|
|
27
|
+
# 4. Pull translations
|
|
28
|
+
nt3 pull
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
### `nt3 login`
|
|
34
|
+
|
|
35
|
+
Authenticate with your Entri API token. Tokens are stored in `~/.nt3/config.json`.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
nt3 login # Interactive prompt
|
|
39
|
+
nt3 login -t entri_abc123... # Non-interactive (CI/CD)
|
|
40
|
+
nt3 login -u https://custom.api.url # Custom API URL
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `nt3 logout`
|
|
44
|
+
|
|
45
|
+
Remove stored authentication.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
nt3 logout
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `nt3 init`
|
|
52
|
+
|
|
53
|
+
Create a `.nt3.yml` configuration file in the current directory.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
nt3 init # Interactive prompt
|
|
57
|
+
nt3 init -p proj_abc123 -f po --path "locales/{lang}/messages.po" # Non-interactive
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
| Flag | Description | Default |
|
|
61
|
+
|------|-------------|---------|
|
|
62
|
+
| `-p, --project-id <id>` | Project ID from Entri | (prompted) |
|
|
63
|
+
| `-s, --source-language <lang>` | Source language code | `en` |
|
|
64
|
+
| `--path <pattern>` | File pattern with `{lang}` placeholder | `src/locales/{lang}.json` |
|
|
65
|
+
| `-f, --format <format>` | File format (see below) | `json-nested` |
|
|
66
|
+
| `--force` | Overwrite existing config | `false` |
|
|
67
|
+
|
|
68
|
+
### `nt3 push`
|
|
69
|
+
|
|
70
|
+
Upload source translation files to Entri.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
nt3 push # Push source files
|
|
74
|
+
nt3 push --overwrite # Overwrite existing translations
|
|
75
|
+
nt3 push --json # JSON output for CI/CD
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
| Flag | Description |
|
|
79
|
+
|------|-------------|
|
|
80
|
+
| `-o, --overwrite` | Overwrite existing translations (default: skip) |
|
|
81
|
+
| `--json` | Output results as JSON |
|
|
82
|
+
|
|
83
|
+
### `nt3 pull`
|
|
84
|
+
|
|
85
|
+
Download translations from Entri to local files.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
nt3 pull # Pull all target languages
|
|
89
|
+
nt3 pull -l fr # Pull French only
|
|
90
|
+
nt3 pull --json # JSON output for CI/CD
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
| Flag | Description |
|
|
94
|
+
|------|-------------|
|
|
95
|
+
| `-l, --language <lang>` | Pull a specific language only |
|
|
96
|
+
| `--json` | Output results as JSON |
|
|
97
|
+
|
|
98
|
+
### `nt3 status`
|
|
99
|
+
|
|
100
|
+
Show current authentication and project configuration.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
nt3 status
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Configuration
|
|
107
|
+
|
|
108
|
+
The CLI uses a `.nt3.yml` file in your project root:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
project_id: "proj_abc123"
|
|
112
|
+
source_language: en
|
|
113
|
+
file_patterns:
|
|
114
|
+
- path: "src/locales/{lang}.json"
|
|
115
|
+
format: json-nested
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The `{lang}` placeholder is replaced with the language code (e.g., `en`, `fr`, `nl`).
|
|
119
|
+
|
|
120
|
+
### Supported Formats
|
|
121
|
+
|
|
122
|
+
| Format | Extension | Description |
|
|
123
|
+
|--------|-----------|-------------|
|
|
124
|
+
| `json-flat` | `.json` | Flat key-value JSON |
|
|
125
|
+
| `json-nested` | `.json` | Nested JSON objects |
|
|
126
|
+
| `yaml` | `.yaml` | YAML key-value |
|
|
127
|
+
| `po` | `.po` | GNU gettext PO |
|
|
128
|
+
| `xliff` | `.xlf` | XLIFF 1.2 |
|
|
129
|
+
| `xliff2` | `.xlf` | XLIFF 2.0 |
|
|
130
|
+
| `arb` | `.arb` | Application Resource Bundle (Flutter) |
|
|
131
|
+
| `android-xml` | `.xml` | Android string resources |
|
|
132
|
+
| `ios-strings` | `.strings` | iOS Localizable.strings |
|
|
133
|
+
| `ios-stringsdict` | `.stringsdict` | iOS Stringsdict (plurals) |
|
|
134
|
+
|
|
135
|
+
## CI/CD
|
|
136
|
+
|
|
137
|
+
Use the `--json` flag and non-interactive authentication for CI pipelines:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
nt3 login -t $NT3_TOKEN
|
|
141
|
+
nt3 push --json
|
|
142
|
+
nt3 pull --json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
Proprietary
|