langctl 0.0.1 → 0.1.0
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/NPM_PUBLISH_GUIDE.md +293 -0
- package/QUICK_PUBLISH.md +64 -0
- package/README.md +287 -32
- package/dist/auth.d.ts +33 -0
- package/dist/auth.js +106 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.js +41 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +33 -0
- package/dist/commands/debug.d.ts +3 -0
- package/dist/commands/debug.js +63 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +93 -0
- package/dist/commands/projects.d.ts +2 -0
- package/dist/commands/projects.js +54 -0
- package/dist/commands/pull.d.ts +9 -0
- package/dist/commands/pull.js +194 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.js +71 -0
- package/dist/exporters/index.d.ts +36 -0
- package/dist/exporters/index.js +214 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +166 -0
- package/dist/supabase.d.ts +14 -0
- package/dist/supabase.js +33 -0
- package/dist/utils/banner.d.ts +9 -0
- package/dist/utils/banner.js +24 -0
- package/package.json +22 -3
- package/translations/en.json +5 -0
- package/translations/en.xml +9 -0
- package/translations/fr.json +4 -0
- package/translations/fr.xml +7 -0
- package/translations/hi.json +4 -0
- package/translations/hi.xml +7 -0
- package/translations/ios/en.strings +9 -0
- package/translations/ios/fr.strings +6 -0
- package/translations/ios/hi.strings +6 -0
- package/translations/ios/ja.strings +6 -0
- package/translations/ja.json +4 -0
- package/translations/ja.xml +7 -0
- package/PUBLISH_GUIDE.md +0 -209
- package/bin/langctl.js +0 -19
- package/index.js +0 -26
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# 🚀 Publishing Langctl CLI to npm
|
|
2
|
+
|
|
3
|
+
**Date:** January 5, 2026
|
|
4
|
+
**Package:** langctl
|
|
5
|
+
**Version:** 0.1.0
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✅ Pre-Publish Checklist
|
|
10
|
+
|
|
11
|
+
Before publishing, verify these items:
|
|
12
|
+
|
|
13
|
+
- [x] Package name available: `langctl` ✅
|
|
14
|
+
- [x] README.md complete with examples ✅
|
|
15
|
+
- [x] package.json properly configured ✅
|
|
16
|
+
- [x] .npmignore configured ✅
|
|
17
|
+
- [x] TypeScript source code ready ✅
|
|
18
|
+
- [x] License file present (MIT) ✅
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 📋 Step-by-Step Publishing Guide
|
|
23
|
+
|
|
24
|
+
### Step 1: Verify npm Login
|
|
25
|
+
|
|
26
|
+
Check if you're logged into npm:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm whoami
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**If not logged in:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm login
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Enter your credentials:
|
|
39
|
+
- Username
|
|
40
|
+
- Password
|
|
41
|
+
- Email
|
|
42
|
+
- One-time password (if 2FA enabled)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### Step 2: Final Build & Test
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd /Users/siddharthsaxena/Documents/projects/langctl/langctl-cli
|
|
50
|
+
|
|
51
|
+
# Clean previous build
|
|
52
|
+
rm -rf dist/
|
|
53
|
+
|
|
54
|
+
# Fresh build
|
|
55
|
+
npm run build
|
|
56
|
+
|
|
57
|
+
# Verify build succeeded
|
|
58
|
+
ls -la dist/
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Expected:** You should see `.js` and `.d.ts` files in dist/
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### Step 3: Test Package Locally
|
|
66
|
+
|
|
67
|
+
Before publishing, test the package works:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Link package globally for testing
|
|
71
|
+
npm link
|
|
72
|
+
|
|
73
|
+
# Test the CLI
|
|
74
|
+
langctl --version
|
|
75
|
+
langctl --help
|
|
76
|
+
|
|
77
|
+
# If it works, unlink
|
|
78
|
+
npm unlink -g langctl
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### Step 4: Dry Run (Recommended)
|
|
84
|
+
|
|
85
|
+
See what will be published WITHOUT actually publishing:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm pack --dry-run
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This shows:
|
|
92
|
+
- ✅ Files that will be included
|
|
93
|
+
- ✅ Package size
|
|
94
|
+
- ✅ No errors
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Step 5: Create Package Tarball (Optional)
|
|
99
|
+
|
|
100
|
+
Create actual tarball to inspect:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm pack
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This creates: `langctl-0.1.0.tgz`
|
|
107
|
+
|
|
108
|
+
**To inspect:**
|
|
109
|
+
```bash
|
|
110
|
+
tar -xzf langctl-0.1.0.tgz
|
|
111
|
+
ls -la package/
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Clean up after:**
|
|
115
|
+
```bash
|
|
116
|
+
rm langctl-0.1.0.tgz
|
|
117
|
+
rm -rf package/
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### Step 6: Publish to npm! 🚀
|
|
123
|
+
|
|
124
|
+
**First time publishing (public package):**
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm publish --access public
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Expected output:**
|
|
131
|
+
```
|
|
132
|
+
npm notice
|
|
133
|
+
npm notice 📦 langctl@0.1.0
|
|
134
|
+
npm notice === Tarball Contents ===
|
|
135
|
+
npm notice 1.1kB LICENSE
|
|
136
|
+
npm notice 2.3kB README.md
|
|
137
|
+
npm notice 845B package.json
|
|
138
|
+
npm notice 15.2kB dist/...
|
|
139
|
+
npm notice === Tarball Details ===
|
|
140
|
+
npm notice name: langctl
|
|
141
|
+
npm notice version: 0.1.0
|
|
142
|
+
npm notice package size: XX.X kB
|
|
143
|
+
npm notice unpacked size: XXX.X kB
|
|
144
|
+
npm notice total files: XX
|
|
145
|
+
npm notice
|
|
146
|
+
+ langctl@0.1.0
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Step 7: Verify Publication
|
|
152
|
+
|
|
153
|
+
**Check on npm:**
|
|
154
|
+
1. Visit: https://www.npmjs.com/package/langctl
|
|
155
|
+
2. Verify README displays correctly
|
|
156
|
+
3. Check version number
|
|
157
|
+
|
|
158
|
+
**Test installation:**
|
|
159
|
+
```bash
|
|
160
|
+
# In a different directory
|
|
161
|
+
npx langctl@latest --version
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 🎉 Success! Package Published
|
|
167
|
+
|
|
168
|
+
Your CLI is now available globally at:
|
|
169
|
+
- **npm:** https://www.npmjs.com/package/langctl
|
|
170
|
+
- **Install:** `npm install -g langctl`
|
|
171
|
+
- **Use:** `npx langctl`
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 📊 Post-Publish Tasks
|
|
176
|
+
|
|
177
|
+
### Update Landing Page
|
|
178
|
+
|
|
179
|
+
Add npm install instructions to langctl.com:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
npm install -g langctl
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Update README (if needed)
|
|
186
|
+
|
|
187
|
+
If you notice issues, you can publish patches:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Fix README or other files
|
|
191
|
+
# Bump version
|
|
192
|
+
npm version patch # 0.1.0 → 0.1.1
|
|
193
|
+
|
|
194
|
+
# Rebuild and republish
|
|
195
|
+
npm run build
|
|
196
|
+
npm publish
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Monitor npm Stats
|
|
200
|
+
|
|
201
|
+
Check download stats:
|
|
202
|
+
- https://www.npmjs.com/package/langctl
|
|
203
|
+
- https://npmtrends.com/langctl
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 🔧 Troubleshooting
|
|
208
|
+
|
|
209
|
+
### Error: "You do not have permission to publish"
|
|
210
|
+
|
|
211
|
+
**Solution:**
|
|
212
|
+
```bash
|
|
213
|
+
npm login
|
|
214
|
+
npm whoami # Verify correct account
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Error: "Package name already exists"
|
|
218
|
+
|
|
219
|
+
**Solution:** The name is taken. Since you reserved it, make sure you're logged in correctly.
|
|
220
|
+
|
|
221
|
+
### Error: "Must be logged in to publish"
|
|
222
|
+
|
|
223
|
+
**Solution:**
|
|
224
|
+
```bash
|
|
225
|
+
npm login
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Build errors
|
|
229
|
+
|
|
230
|
+
**Solution:**
|
|
231
|
+
```bash
|
|
232
|
+
rm -rf node_modules/ dist/
|
|
233
|
+
npm install
|
|
234
|
+
npm run build
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 📈 Version Updates (Future)
|
|
240
|
+
|
|
241
|
+
**Patch (bug fixes):** 0.1.0 → 0.1.1
|
|
242
|
+
```bash
|
|
243
|
+
npm version patch
|
|
244
|
+
npm run build
|
|
245
|
+
npm publish
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Minor (new features):** 0.1.0 → 0.2.0
|
|
249
|
+
```bash
|
|
250
|
+
npm version minor
|
|
251
|
+
npm run build
|
|
252
|
+
npm publish
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Major (breaking changes):** 0.1.0 → 1.0.0
|
|
256
|
+
```bash
|
|
257
|
+
npm version major
|
|
258
|
+
npm run build
|
|
259
|
+
npm publish
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## ✅ Final Checklist
|
|
265
|
+
|
|
266
|
+
Before running `npm publish`:
|
|
267
|
+
|
|
268
|
+
- [ ] Logged into npm (`npm whoami`)
|
|
269
|
+
- [ ] Build succeeded (`npm run build`)
|
|
270
|
+
- [ ] Local test passed (`npm link` + test commands)
|
|
271
|
+
- [ ] Dry run clean (`npm pack --dry-run`)
|
|
272
|
+
- [ ] Ready to publish! (`npm publish --access public`)
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## 🎯 Quick Command Summary
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# From langctl-cli directory:
|
|
280
|
+
npm whoami # Verify login
|
|
281
|
+
npm run build # Build TypeScript
|
|
282
|
+
npm pack --dry-run # Preview package
|
|
283
|
+
npm publish --access public # Publish!
|
|
284
|
+
npx langctl@latest --version # Verify
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
**Good luck! You're about to publish your first npm package! 🚀**
|
|
290
|
+
|
|
291
|
+
**Questions? Issues?**
|
|
292
|
+
- npm support: https://www.npmjs.com/support
|
|
293
|
+
- Package page: https://www.npmjs.com/package/langctl
|
package/QUICK_PUBLISH.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 🚀 PUBLISH LANGCTL - QUICK COMMANDS
|
|
2
|
+
|
|
3
|
+
**Run these commands in order on YOUR MAC:**
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# 1. Navigate to CLI directory
|
|
7
|
+
cd /Users/siddharthsaxena/Documents/projects/langctl/langctl-cli
|
|
8
|
+
|
|
9
|
+
# 2. Check npm login
|
|
10
|
+
npm whoami
|
|
11
|
+
|
|
12
|
+
# 3. If not logged in:
|
|
13
|
+
npm login
|
|
14
|
+
|
|
15
|
+
# 4. Build the package
|
|
16
|
+
npm run build
|
|
17
|
+
|
|
18
|
+
# 5. Test locally (optional but recommended)
|
|
19
|
+
npm link
|
|
20
|
+
langctl --version
|
|
21
|
+
langctl --help
|
|
22
|
+
npm unlink -g langctl
|
|
23
|
+
|
|
24
|
+
# 6. Dry run to preview
|
|
25
|
+
npm pack --dry-run
|
|
26
|
+
|
|
27
|
+
# 7. PUBLISH! 🚀
|
|
28
|
+
npm publish --access public
|
|
29
|
+
|
|
30
|
+
# 8. Verify it worked
|
|
31
|
+
npx langctl@latest --version
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## ✅ Expected Result
|
|
37
|
+
|
|
38
|
+
After `npm publish`, you should see:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
+ langctl@0.1.0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then check: https://www.npmjs.com/package/langctl
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🎉 That's It!
|
|
49
|
+
|
|
50
|
+
Your CLI is now installable worldwide:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g langctl
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
or
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx langctl --help
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
**Full guide:** See `NPM_PUBLISH_GUIDE.md` for detailed instructions and troubleshooting.
|
package/README.md
CHANGED
|
@@ -1,57 +1,312 @@
|
|
|
1
|
-
# Langctl
|
|
1
|
+
# Langctl CLI
|
|
2
2
|
|
|
3
3
|
> CLI-first translation management for developers
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Langctl is a command-line tool that lets you manage translations directly from your terminal. Pull translations in multiple formats, sync with your projects, and integrate seamlessly into your CI/CD pipeline.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g langctl
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or use with npx:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx langctl --help
|
|
17
|
+
```
|
|
14
18
|
|
|
15
|
-
##
|
|
19
|
+
## Quick Start
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
- 🤖 **AI-Powered** - Context-aware translations using advanced AI
|
|
19
|
-
- 💰 **Affordable** - Starting free, pay only for what you use
|
|
20
|
-
- ⚡ **Fast** - Setup in under 2 minutes
|
|
21
|
-
- 🔧 **Framework Agnostic** - Works with Angular, React, Vue, and more
|
|
21
|
+
### 1. Initialize Configuration
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Run the interactive setup wizard to configure Langctl:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
langctl init
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This will:
|
|
30
|
+
- Configure Supabase connection (uses defaults)
|
|
31
|
+
- Authenticate with your API key (get one from the dashboard)
|
|
32
|
+
- Set your default language preference
|
|
33
|
+
|
|
34
|
+
### 2. List Your Projects
|
|
35
|
+
|
|
36
|
+
View all projects you have access to:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
langctl projects list
|
|
27
40
|
```
|
|
28
41
|
|
|
29
|
-
|
|
42
|
+
### 3. Pull Translations
|
|
43
|
+
|
|
44
|
+
Download translations for a project:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
langctl pull <project-id> --language en --format json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Commands
|
|
51
|
+
|
|
52
|
+
### `langctl init`
|
|
53
|
+
|
|
54
|
+
Interactive setup wizard to configure the CLI.
|
|
30
55
|
|
|
31
56
|
```bash
|
|
32
|
-
# Initialize langctl in your project
|
|
33
57
|
langctl init
|
|
58
|
+
```
|
|
34
59
|
|
|
35
|
-
|
|
36
|
-
langctl scan
|
|
60
|
+
### `langctl auth <api-key>`
|
|
37
61
|
|
|
38
|
-
|
|
39
|
-
langctl translate --target es,fr,de --ai
|
|
62
|
+
Authenticate with an API key from the dashboard.
|
|
40
63
|
|
|
41
|
-
|
|
42
|
-
langctl
|
|
64
|
+
```bash
|
|
65
|
+
langctl auth lc_abc123...
|
|
43
66
|
```
|
|
44
67
|
|
|
45
|
-
|
|
68
|
+
### `langctl logout`
|
|
46
69
|
|
|
47
|
-
|
|
48
|
-
- 📧 Email: hello@langctl.com
|
|
49
|
-
- 🐙 GitHub: [github.com/siddharthsaxena0/langctl](https://github.com/siddharthsaxena0/langctl)
|
|
70
|
+
Clear authentication credentials.
|
|
50
71
|
|
|
51
|
-
|
|
72
|
+
```bash
|
|
73
|
+
langctl logout
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `langctl config`
|
|
77
|
+
|
|
78
|
+
View current configuration.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
langctl config
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### `langctl projects list`
|
|
85
|
+
|
|
86
|
+
Show all accessible projects.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
langctl projects list
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `langctl pull <project-id>`
|
|
93
|
+
|
|
94
|
+
Pull translations from a project.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
langctl pull <project-id> [options]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Options:**
|
|
101
|
+
|
|
102
|
+
- `-l, --language <code>` - Language code to pull (default: en)
|
|
103
|
+
- `-f, --format <type>` - Export format (default: json)
|
|
104
|
+
- `json` - Flat JSON (key-value pairs)
|
|
105
|
+
- `json-nested` - Nested JSON (organized by key structure)
|
|
106
|
+
- `ios` - iOS .strings format
|
|
107
|
+
- `android` - Android XML format
|
|
108
|
+
- `flutter` - Flutter ARB format
|
|
109
|
+
- `-o, --output <path>` - Output file path (default: ./translations/<filename>)
|
|
110
|
+
- `--no-published-only` - Include unpublished translations
|
|
111
|
+
|
|
112
|
+
**Examples:**
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Pull English translations as JSON
|
|
116
|
+
langctl pull abc-123 --language en --format json
|
|
117
|
+
|
|
118
|
+
# Pull Spanish translations as iOS strings
|
|
119
|
+
langctl pull abc-123 --language es --format ios
|
|
120
|
+
|
|
121
|
+
# Pull all translations (including unpublished)
|
|
122
|
+
langctl pull abc-123 --language en --no-published-only
|
|
123
|
+
|
|
124
|
+
# Custom output path
|
|
125
|
+
langctl pull abc-123 --language en --output ./locales/en.json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Export Formats
|
|
129
|
+
|
|
130
|
+
### JSON (Flat)
|
|
131
|
+
|
|
132
|
+
Simple key-value pairs with dot notation.
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"home.welcome": "Welcome!",
|
|
137
|
+
"home.subtitle": "Get started with {{appName}}"
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### JSON (Nested)
|
|
142
|
+
|
|
143
|
+
Organized by key structure.
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"home": {
|
|
148
|
+
"welcome": "Welcome!",
|
|
149
|
+
"subtitle": "Get started with {{appName}}"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### iOS Strings
|
|
155
|
+
|
|
156
|
+
Standard iOS .strings format.
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
"home.welcome" = "Welcome!";
|
|
160
|
+
"home.subtitle" = "Get started with %1$@";
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Android XML
|
|
164
|
+
|
|
165
|
+
Android resources XML format.
|
|
166
|
+
|
|
167
|
+
```xml
|
|
168
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
169
|
+
<resources>
|
|
170
|
+
<string name="home.welcome">Welcome!</string>
|
|
171
|
+
<string name="home.subtitle">Get started with %1$s</string>
|
|
172
|
+
</resources>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Flutter ARB
|
|
176
|
+
|
|
177
|
+
Application Resource Bundle format for Flutter.
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"@@locale": "en",
|
|
182
|
+
"home.welcome": "Welcome!",
|
|
183
|
+
"home.subtitle": "Get started with {appName}",
|
|
184
|
+
"@home.subtitle": {
|
|
185
|
+
"placeholders": {
|
|
186
|
+
"appName": {
|
|
187
|
+
"type": "String"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Configuration
|
|
195
|
+
|
|
196
|
+
Configuration is stored in `~/.langctl/config.json`:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"supabaseUrl": "https://xxx.supabase.co",
|
|
201
|
+
"supabaseAnonKey": "eyJ...",
|
|
202
|
+
"apiKey": "lc_...",
|
|
203
|
+
"organizationId": "uuid",
|
|
204
|
+
"organizationName": "Company Name",
|
|
205
|
+
"defaultProject": "uuid",
|
|
206
|
+
"defaultLanguage": "en"
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## API Keys
|
|
211
|
+
|
|
212
|
+
Generate API keys from the Langctl dashboard:
|
|
213
|
+
|
|
214
|
+
1. Go to Settings → API Keys
|
|
215
|
+
2. Click "Generate New Key"
|
|
216
|
+
3. Copy the key (shown only once)
|
|
217
|
+
4. Use it with `langctl auth <key>` or `langctl init`
|
|
218
|
+
|
|
219
|
+
API keys are organization-scoped and provide access to all projects within that organization.
|
|
220
|
+
|
|
221
|
+
## CI/CD Integration
|
|
222
|
+
|
|
223
|
+
Example GitHub Actions workflow:
|
|
52
224
|
|
|
53
|
-
|
|
225
|
+
```yaml
|
|
226
|
+
name: Sync Translations
|
|
54
227
|
|
|
55
|
-
|
|
228
|
+
on:
|
|
229
|
+
schedule:
|
|
230
|
+
- cron: '0 0 * * *' # Daily at midnight
|
|
231
|
+
workflow_dispatch:
|
|
232
|
+
|
|
233
|
+
jobs:
|
|
234
|
+
sync:
|
|
235
|
+
runs-on: ubuntu-latest
|
|
236
|
+
steps:
|
|
237
|
+
- uses: actions/checkout@v3
|
|
238
|
+
|
|
239
|
+
- name: Setup Node.js
|
|
240
|
+
uses: actions/setup-node@v3
|
|
241
|
+
with:
|
|
242
|
+
node-version: '18'
|
|
243
|
+
|
|
244
|
+
- name: Install Langctl
|
|
245
|
+
run: npm install -g langctl
|
|
246
|
+
|
|
247
|
+
- name: Configure Langctl
|
|
248
|
+
env:
|
|
249
|
+
LANGCTL_API_KEY: ${{ secrets.LANGCTL_API_KEY }}
|
|
250
|
+
run: langctl auth $LANGCTL_API_KEY
|
|
251
|
+
|
|
252
|
+
- name: Pull Translations
|
|
253
|
+
run: |
|
|
254
|
+
langctl pull ${{ secrets.PROJECT_ID }} --language en --format json
|
|
255
|
+
langctl pull ${{ secrets.PROJECT_ID }} --language es --format json
|
|
256
|
+
|
|
257
|
+
- name: Commit Changes
|
|
258
|
+
run: |
|
|
259
|
+
git config --global user.name "Langctl Bot"
|
|
260
|
+
git config --global user.email "bot@langctl.com"
|
|
261
|
+
git add translations/
|
|
262
|
+
git commit -m "chore: update translations" || echo "No changes"
|
|
263
|
+
git push
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Troubleshooting
|
|
267
|
+
|
|
268
|
+
### "Not authenticated" error
|
|
269
|
+
|
|
270
|
+
Run `langctl auth <api-key>` or `langctl init` to authenticate.
|
|
271
|
+
|
|
272
|
+
### "Supabase not configured" error
|
|
273
|
+
|
|
274
|
+
Run `langctl init` to configure Supabase connection.
|
|
275
|
+
|
|
276
|
+
### "Project not found" error
|
|
277
|
+
|
|
278
|
+
- Verify the project ID with `langctl projects list`
|
|
279
|
+
- Check that your API key has access to the organization
|
|
280
|
+
|
|
281
|
+
### Invalid API key format
|
|
282
|
+
|
|
283
|
+
API keys should:
|
|
284
|
+
- Start with `lc_`
|
|
285
|
+
- Be 67 characters long
|
|
286
|
+
- Be generated from the Langctl dashboard
|
|
287
|
+
|
|
288
|
+
## Development
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Install dependencies
|
|
292
|
+
npm install
|
|
293
|
+
|
|
294
|
+
# Build TypeScript
|
|
295
|
+
npm run build
|
|
296
|
+
|
|
297
|
+
# Run in development mode
|
|
298
|
+
npm run dev
|
|
299
|
+
|
|
300
|
+
# Test CLI
|
|
301
|
+
node dist/index.js --help
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Support
|
|
305
|
+
|
|
306
|
+
- **Documentation:** [langctl.com/docs](https://langctl.com/docs)
|
|
307
|
+
- **Issues:** [github.com/siddharthsaxena0/langctl/issues](https://github.com/siddharthsaxena0/langctl/issues)
|
|
308
|
+
- **Email:** hello@langctl.com
|
|
309
|
+
|
|
310
|
+
## License
|
|
56
311
|
|
|
57
|
-
|
|
312
|
+
MIT © Siddharth Saxena
|