langctl 0.1.2 → 0.2.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/NEXT_PHASE.md DELETED
@@ -1,618 +0,0 @@
1
- # Langctl CLI - Next Phase (Phase 3)
2
-
3
- **Future Enhancements & Feature Ideas**
4
-
5
- This document outlines potential features for Phase 3 and beyond. These are not committed but represent natural evolution of the CLI tool.
6
-
7
- ---
8
-
9
- ## Phase 3: Advanced Features
10
-
11
- ### 1. API Key Management Commands
12
-
13
- Allow users to manage their API keys directly from CLI.
14
-
15
- **Commands**:
16
- ```bash
17
- langctl apikeys list # List all API keys
18
- langctl apikeys create <name> # Generate new API key
19
- langctl apikeys revoke <key-id> # Revoke an API key
20
- langctl apikeys get <key-id> # Get key details
21
- ```
22
-
23
- **Benefits**:
24
- - No need to switch to dashboard for key management
25
- - Easier automation and CI/CD setup
26
- - Key rotation workflows
27
-
28
- **Implementation**:
29
- - Create `manage-api-keys` Edge Function
30
- - Add `apikeys.ts` command file
31
- - Support scopes/permissions during creation
32
-
33
- ---
34
-
35
- ### 2. Translation History & Version Control
36
-
37
- View and manage translation history.
38
-
39
- **Commands**:
40
- ```bash
41
- langctl history <project> <key> # View key history
42
- langctl history <project> --language en # View language history
43
- langctl diff <project> <key> <from> <to> # Compare versions
44
- langctl rollback <project> <key> <version> # Rollback to version
45
- ```
46
-
47
- **Benefits**:
48
- - Track who changed what and when
49
- - Rollback bad translations
50
- - Audit trail for compliance
51
-
52
- **Implementation**:
53
- - Edge Function queries `translation_history` table
54
- - Display diffs with colored output
55
- - Confirmation prompt for rollback
56
-
57
- ---
58
-
59
- ### 3. Bulk Operations
60
-
61
- Efficient batch operations on translations.
62
-
63
- **Commands**:
64
- ```bash
65
- # Bulk update from CSV
66
- langctl bulk update <project> <csv-file>
67
-
68
- # Bulk delete by pattern
69
- langctl bulk delete <project> --pattern "test.*"
70
-
71
- # Bulk publish by module
72
- langctl bulk publish <project> --module auth
73
-
74
- # Bulk copy from one language to another
75
- langctl bulk copy <project> --from en --to es --empty-only
76
- ```
77
-
78
- **Benefits**:
79
- - Faster large-scale updates
80
- - Migration support
81
- - Cleanup operations
82
-
83
- **Implementation**:
84
- - CSV parser for bulk updates
85
- - Pattern matching (glob/regex)
86
- - Progress bars for large operations
87
- - Dry-run mode (`--dry-run`)
88
-
89
- ---
90
-
91
- ### 4. Translation Search & Discovery
92
-
93
- Advanced search across translations.
94
-
95
- **Commands**:
96
- ```bash
97
- # Search across all projects
98
- langctl search "welcome" --all-projects
99
-
100
- # Search with regex
101
- langctl search --regex "error\\..*" --project my-app
102
-
103
- # Find missing translations
104
- langctl missing <project> --language es
105
-
106
- # Find untranslated keys
107
- langctl untranslated <project>
108
-
109
- # Find duplicate values
110
- langctl duplicates <project> --language en
111
- ```
112
-
113
- **Benefits**:
114
- - Quick discovery
115
- - Quality assurance
116
- - Find reusable translations
117
-
118
- **Implementation**:
119
- - Edge Function with full-text search
120
- - Support for regex patterns
121
- - Highlight matches in output
122
-
123
- ---
124
-
125
- ### 5. Webhooks Management
126
-
127
- Manage webhook endpoints from CLI.
128
-
129
- **Commands**:
130
- ```bash
131
- langctl webhooks list # List webhooks
132
- langctl webhooks create <url> # Create webhook
133
- langctl webhooks delete <id> # Delete webhook
134
- langctl webhooks test <id> # Test webhook
135
- langctl webhooks logs <id> # View webhook logs
136
- ```
137
-
138
- **Benefits**:
139
- - Configure integrations via CLI
140
- - Debug webhook issues
141
- - Automation workflows
142
-
143
- **Implementation**:
144
- - `manage-webhooks` Edge Function
145
- - Webhook event filtering
146
- - Retry configuration
147
-
148
- ---
149
-
150
- ### 6. Module Management
151
-
152
- Enhanced module operations.
153
-
154
- **Commands**:
155
- ```bash
156
- langctl modules list <project> # List modules
157
- langctl modules create <project> <name> # Create module
158
- langctl modules rename <project> <old> <new> # Rename module
159
- langctl modules delete <project> <name> # Delete module
160
- langctl modules merge <project> <from> <into> # Merge modules
161
- ```
162
-
163
- **Benefits**:
164
- - Better organization
165
- - Refactoring support
166
- - Module-level operations
167
-
168
- **Implementation**:
169
- - Edge Function for module operations
170
- - Bulk key updates for rename/merge
171
- - Validation to prevent conflicts
172
-
173
- ---
174
-
175
- ### 7. Interactive Mode
176
-
177
- REPL-style interactive CLI.
178
-
179
- **Command**:
180
- ```bash
181
- langctl interactive
182
- # or
183
- langctl -i
184
- ```
185
-
186
- **Features**:
187
- - Command auto-completion
188
- - Context-aware suggestions
189
- - Multi-line inputs
190
- - Command history
191
- - Session persistence
192
-
193
- **Benefits**:
194
- - Better UX for exploratory work
195
- - Faster iteration
196
- - Learning tool for new users
197
-
198
- **Implementation**:
199
- - Use `inquirer` or `prompts` library
200
- - Maintain session state
201
- - Implement readline interface
202
-
203
- ---
204
-
205
- ### 8. Translation Validation
206
-
207
- Validate translations for quality and consistency.
208
-
209
- **Commands**:
210
- ```bash
211
- # Validate all translations
212
- langctl validate <project>
213
-
214
- # Check specific validations
215
- langctl validate <project> --check placeholders
216
- langctl validate <project> --check length
217
- langctl validate <project> --check format
218
-
219
- # Fix common issues
220
- langctl validate <project> --fix
221
- ```
222
-
223
- **Checks**:
224
- - Placeholder consistency (`{{name}}` in all languages)
225
- - Length limits (too long/short)
226
- - Format consistency (capitalization, punctuation)
227
- - HTML/XML tag matching
228
- - URL validity
229
- - Variable interpolation
230
-
231
- **Benefits**:
232
- - Quality assurance
233
- - Catch errors early
234
- - Automated QA
235
-
236
- **Implementation**:
237
- - Validation rules engine
238
- - Configurable rules per project
239
- - Auto-fix capabilities
240
-
241
- ---
242
-
243
- ### 9. Translation Memory & Suggestions
244
-
245
- Leverage existing translations for new keys.
246
-
247
- **Commands**:
248
- ```bash
249
- # Find similar translations
250
- langctl suggest <project> <key>
251
-
252
- # Auto-translate from memory
253
- langctl auto-translate <project> --language es --similarity 0.9
254
-
255
- # Export translation memory
256
- langctl tm export <project> --language en
257
-
258
- # Import translation memory
259
- langctl tm import <project> <file>
260
- ```
261
-
262
- **Benefits**:
263
- - Faster translations
264
- - Consistency
265
- - Reuse existing work
266
-
267
- **Implementation**:
268
- - Fuzzy matching algorithm
269
- - Translation memory database
270
- - Confidence scoring
271
-
272
- ---
273
-
274
- ### 10. Git Integration
275
-
276
- Native Git workflow integration.
277
-
278
- **Commands**:
279
- ```bash
280
- # Initialize translation tracking
281
- langctl git init
282
-
283
- # Commit translations
284
- langctl git commit -m "Update translations"
285
-
286
- # Create pull request with translations
287
- langctl git pr
288
-
289
- # Sync with Git
290
- langctl git pull
291
- langctl git push
292
-
293
- # Compare with Git branch
294
- langctl git diff main
295
- ```
296
-
297
- **Benefits**:
298
- - Version control integration
299
- - PR-based workflows
300
- - Branch-specific translations
301
-
302
- **Implementation**:
303
- - Git hooks
304
- - Branch detection
305
- - Auto-commit on export
306
- - PR creation via GitHub/GitLab API
307
-
308
- ---
309
-
310
- ### 11. Analytics & Insights
311
-
312
- Usage statistics and insights.
313
-
314
- **Commands**:
315
- ```bash
316
- # View usage stats
317
- langctl analytics usage <project>
318
-
319
- # Most used keys
320
- langctl analytics top-keys <project>
321
-
322
- # Translation coverage
323
- langctl analytics coverage <project>
324
-
325
- # Activity timeline
326
- langctl analytics activity --last 30d
327
-
328
- # Export analytics
329
- langctl analytics export --format csv
330
- ```
331
-
332
- **Metrics**:
333
- - Most/least used keys
334
- - Translation completion rates
335
- - Update frequency
336
- - Contributor activity
337
- - Export patterns
338
-
339
- **Benefits**:
340
- - Data-driven decisions
341
- - Identify unused keys
342
- - Track team activity
343
-
344
- **Implementation**:
345
- - Analytics Edge Function
346
- - Database queries on usage data
347
- - Chart rendering (ASCII art)
348
-
349
- ---
350
-
351
- ### 12. Configuration Profiles
352
-
353
- Multiple configuration profiles for different environments.
354
-
355
- **Commands**:
356
- ```bash
357
- # Create profile
358
- langctl profile create staging
359
-
360
- # Switch profile
361
- langctl profile use production
362
-
363
- # List profiles
364
- langctl profile list
365
-
366
- # Delete profile
367
- langctl profile delete dev
368
- ```
369
-
370
- **Benefits**:
371
- - Easy environment switching
372
- - Different API keys per environment
373
- - Team-specific configs
374
-
375
- **Implementation**:
376
- - Multiple config files: `~/.langctl/profiles/`
377
- - Active profile in `~/.langctl/config.json`
378
- - Profile-specific settings
379
-
380
- ---
381
-
382
- ### 13. Automated Translation (AI)
383
-
384
- AI-powered translation suggestions.
385
-
386
- **Commands**:
387
- ```bash
388
- # Auto-translate missing keys
389
- langctl translate <project> --from en --to es --ai
390
-
391
- # Review AI suggestions
392
- langctl translate review <project>
393
-
394
- # Accept/reject suggestions
395
- langctl translate accept <project> <key>
396
- langctl translate reject <project> <key>
397
-
398
- # Batch translate
399
- langctl translate batch <project> --languages es,fr,de
400
- ```
401
-
402
- **Benefits**:
403
- - Faster translation workflow
404
- - Reduce manual work
405
- - Maintain consistency
406
-
407
- **Implementation**:
408
- - Integration with translation APIs (Google, DeepL, GPT)
409
- - Confidence scoring
410
- - Human review workflow
411
- - Cost estimation
412
-
413
- ---
414
-
415
- ### 14. Custom Scripts & Plugins
416
-
417
- Extensibility via custom scripts.
418
-
419
- **Commands**:
420
- ```bash
421
- # Run custom script
422
- langctl script run my-script.js
423
-
424
- # Install plugin
425
- langctl plugin install langctl-formatter
426
-
427
- # List plugins
428
- langctl plugin list
429
-
430
- # Create script template
431
- langctl script init
432
- ```
433
-
434
- **Benefits**:
435
- - Extensibility
436
- - Custom workflows
437
- - Community contributions
438
-
439
- **Implementation**:
440
- - Plugin system with hooks
441
- - Script execution sandbox
442
- - npm package support
443
- - Plugin marketplace
444
-
445
- ---
446
-
447
- ### 15. Offline Mode
448
-
449
- Work without internet connection.
450
-
451
- **Commands**:
452
- ```bash
453
- # Enable offline mode
454
- langctl offline enable
455
-
456
- # Sync to local cache
457
- langctl offline sync <project>
458
-
459
- # Work offline
460
- langctl offline keys list <project>
461
-
462
- # Push when back online
463
- langctl offline push
464
- ```
465
-
466
- **Benefits**:
467
- - Work anywhere
468
- - Faster operations
469
- - Resilience
470
-
471
- **Implementation**:
472
- - SQLite local cache
473
- - Sync protocol
474
- - Conflict resolution
475
-
476
- ---
477
-
478
- ## Priority Ranking
479
-
480
- ### High Priority (Implement First)
481
- 1. **Translation Validation** - Quality is critical
482
- 2. **Bulk Operations** - High user demand
483
- 3. **Translation Search** - Improves discoverability
484
- 4. **Module Management** - Better organization
485
-
486
- ### Medium Priority
487
- 5. **Translation History** - Version control
488
- 6. **API Key Management** - Self-service
489
- 7. **Configuration Profiles** - Environment management
490
- 8. **Interactive Mode** - Better UX
491
-
492
- ### Low Priority (Nice to Have)
493
- 9. **Webhooks Management** - Advanced users
494
- 10. **Analytics & Insights** - Power users
495
- 11. **Git Integration** - Specific workflows
496
- 12. **Translation Memory** - Efficiency gains
497
-
498
- ### Future Exploration
499
- 13. **Automated Translation (AI)** - Cost/benefit analysis needed
500
- 14. **Custom Scripts & Plugins** - After core stabilization
501
- 15. **Offline Mode** - Complex, evaluate demand
502
-
503
- ---
504
-
505
- ## Technical Considerations
506
-
507
- ### Edge Functions Needed
508
-
509
- New Edge Functions for Phase 3:
510
- - `manage-api-keys`
511
- - `manage-webhooks`
512
- - `manage-modules`
513
- - `translation-history`
514
- - `search-translations`
515
- - `validate-translations`
516
- - `analytics`
517
- - `translation-memory`
518
-
519
- ### Database Changes
520
-
521
- Potential new tables:
522
- - `validation_rules` - Custom validation rules
523
- - `translation_memory` - TM cache
524
- - `analytics_events` - Usage tracking
525
- - `plugins` - Installed plugins
526
- - `offline_sync` - Sync metadata
527
-
528
- ### CLI Dependencies
529
-
530
- New packages to consider:
531
- - `inquirer` - Interactive prompts
532
- - `csv-parse` - CSV handling
533
- - `better-sqlite3` - Offline cache
534
- - `fuzzy-search` - Fuzzy matching
535
- - `simple-git` - Git integration
536
- - `cli-chart` - ASCII charts
537
-
538
- ---
539
-
540
- ## User Feedback Integration
541
-
542
- Before implementing Phase 3, gather user feedback on:
543
-
544
- 1. **Most Requested Features**: Survey users
545
- 2. **Pain Points**: Identify bottlenecks
546
- 3. **Usage Patterns**: Analytics from Phase 1 & 2
547
- 4. **Edge Cases**: Unique workflows
548
-
549
- ---
550
-
551
- ## Implementation Strategy
552
-
553
- ### Incremental Rollout
554
-
555
- 1. **Alpha Testing**: Internal team only
556
- 2. **Beta Release**: Select customers
557
- 3. **Stable Release**: All users
558
- 4. **Feature Flags**: Toggle new features
559
-
560
- ### Backward Compatibility
561
-
562
- - Maintain existing command signatures
563
- - Deprecate features gracefully
564
- - Provide migration paths
565
- - Version API responses
566
-
567
- ### Documentation
568
-
569
- - Update README for each feature
570
- - Add examples to WORKING_INSTRUCTIONS
571
- - Create video tutorials
572
- - Blog posts for major features
573
-
574
- ---
575
-
576
- ## Success Metrics
577
-
578
- Track these metrics to evaluate Phase 3:
579
-
580
- - **Adoption Rate**: % of users using new features
581
- - **Time Saved**: Efficiency improvements
582
- - **Error Reduction**: Validation impact
583
- - **User Satisfaction**: NPS score
584
- - **Feature Usage**: Most/least used features
585
-
586
- ---
587
-
588
- ## Questions to Answer
589
-
590
- Before starting Phase 3:
591
-
592
- 1. Which features provide most value?
593
- 2. What's the development effort vs. impact?
594
- 3. Are there any breaking changes needed?
595
- 4. What's the maintenance burden?
596
- 5. How does this affect the web dashboard?
597
-
598
- ---
599
-
600
- ## Conclusion
601
-
602
- Phase 3 should focus on:
603
- - **Quality**: Validation and consistency
604
- - **Efficiency**: Bulk operations and search
605
- - **Organization**: Module management
606
- - **Intelligence**: AI-assisted workflows
607
-
608
- Prioritize features that:
609
- - Solve real user problems
610
- - Have clear ROI
611
- - Align with CLI-first philosophy
612
- - Don't duplicate dashboard functionality unnecessarily
613
-
614
- ---
615
-
616
- **Status**: Planning Phase
617
- **Target**: Q2 2026 (tentative)
618
- **Dependencies**: Phase 1 & 2 stable, user feedback collected