@newpeak/barista-cli 0.1.15 → 0.1.16

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.
Files changed (44) hide show
  1. package/README.ja.md +209 -620
  2. package/README.md +206 -755
  3. package/README.vi.md +206 -623
  4. package/README.zh.md +340 -0
  5. package/dist/commands/liberica/orgs/batch-delete.d.ts +3 -0
  6. package/dist/commands/liberica/orgs/batch-delete.d.ts.map +1 -0
  7. package/dist/commands/liberica/orgs/batch-delete.js +109 -0
  8. package/dist/commands/liberica/orgs/batch-delete.js.map +1 -0
  9. package/dist/commands/liberica/orgs/create.d.ts +3 -0
  10. package/dist/commands/liberica/orgs/create.d.ts.map +1 -0
  11. package/dist/commands/liberica/orgs/create.js +131 -0
  12. package/dist/commands/liberica/orgs/create.js.map +1 -0
  13. package/dist/commands/liberica/orgs/disable.d.ts +3 -0
  14. package/dist/commands/liberica/orgs/disable.d.ts.map +1 -0
  15. package/dist/commands/liberica/orgs/disable.js +98 -0
  16. package/dist/commands/liberica/orgs/disable.js.map +1 -0
  17. package/dist/commands/liberica/orgs/enable.d.ts +3 -0
  18. package/dist/commands/liberica/orgs/enable.d.ts.map +1 -0
  19. package/dist/commands/liberica/orgs/enable.js +98 -0
  20. package/dist/commands/liberica/orgs/enable.js.map +1 -0
  21. package/dist/commands/liberica/orgs/get.d.ts +3 -0
  22. package/dist/commands/liberica/orgs/get.d.ts.map +1 -0
  23. package/dist/commands/liberica/orgs/get.js +79 -0
  24. package/dist/commands/liberica/orgs/get.js.map +1 -0
  25. package/dist/commands/liberica/orgs/index.d.ts.map +1 -1
  26. package/dist/commands/liberica/orgs/index.js +15 -21
  27. package/dist/commands/liberica/orgs/index.js.map +1 -1
  28. package/dist/commands/liberica/orgs/list.d.ts +3 -0
  29. package/dist/commands/liberica/orgs/list.d.ts.map +1 -0
  30. package/dist/commands/liberica/orgs/list.js +51 -0
  31. package/dist/commands/liberica/orgs/list.js.map +1 -0
  32. package/dist/commands/liberica/orgs/update.d.ts +3 -0
  33. package/dist/commands/liberica/orgs/update.d.ts.map +1 -0
  34. package/dist/commands/liberica/orgs/update.js +136 -0
  35. package/dist/commands/liberica/orgs/update.js.map +1 -0
  36. package/dist/core/api/client.d.ts +7 -1
  37. package/dist/core/api/client.d.ts.map +1 -1
  38. package/dist/core/api/client.js +128 -0
  39. package/dist/core/api/client.js.map +1 -1
  40. package/dist/index.js +1 -1
  41. package/dist/types/org.d.ts +38 -0
  42. package/dist/types/org.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/README.en.md +0 -757
package/README.en.md DELETED
@@ -1,757 +0,0 @@
1
- # ☕ Barista CLI
2
-
3
- <p align="center">
4
- <a href="./README.md"><img src="https://img.shields.io/badge/-简体中文-green?style=flat-square" alt="简体中文"></a>
5
- <a href="./README.en.md"><img src="https://img.shields.io/badge/-English-blue?style=flat-square" alt="English"></a>
6
- <a href="./README.ja.md"><img src="https://img.shields.io/badge/-日本語-red?style=flat-square" alt="日本語"></a>
7
- <a href="./README.vi.md"><img src="https://img.shields.io/badge/-Tiếng%20Việt-green?style=flat-square" alt="Tiếng Việt"></a>
8
- </p>
9
-
10
- <p align="center">
11
- <img src="https://img.shields.io/badge/AI--Native-CLI-blue?style=flat-square" alt="AI-Native">
12
- <img src="https://img.shields.io/badge/Liberica-Production%20SaaS-green?style=flat-square" alt="Liberica">
13
- <img src="https://img.shields.io/badge/Arabica-Sales%20Platform-orange?style=flat-square" alt="Arabica">
14
- <img src="https://img.shields.io/badge/Node.js-18%2B-brightgreen?style=flat-square" alt="Node.js 18+">
15
- </p>
16
-
17
- <p align="center">
18
- <strong>AI-Native CLI Tool</strong> that seamlessly bridges Liberica Production Management SaaS and Arabica Sales Platform
19
- </p>
20
-
21
- ---
22
-
23
- ## 📋 Table of Contents
24
-
25
- - [Project Introduction](#project-introduction)
26
- - [Quick Start](#quick-start)
27
- - [Architecture Design](#architecture-design)
28
- - [Command Documentation](#command-documentation)
29
- - [Advanced Features](#advanced-features)
30
- - [Configuration](#configuration)
31
- - [AI Integration](#ai-integration)
32
- - [Development Guide](#development-guide)
33
- - [Contributing](#contributing)
34
-
35
- ---
36
-
37
- ## Project Introduction
38
-
39
- Barista CLI is an AI-Native command-line tool designed specifically for the Newpeak ecosystem. It provides a unified interface for managing Liberica Production Management SaaS and Arabica Sales Platform.
40
-
41
- ### Core Features
42
-
43
- | Feature | Description |
44
- |---------|-------------|
45
- | 🌍 **Multi-Environment Support** | Seamless switching between dev, test, prod-cn, and prod-jp environments |
46
- | 🏢 **Multi-Tenant Architecture** | Supports multi-tenant environment configuration and isolation |
47
- | 🔐 **Token Authentication** | Securely stored in system keychain with environment isolation |
48
- | 🧪 **Dry-Run Mode** | All write operations support preview to avoid mistakes |
49
- | 🤖 **AI Integration** | JSON output format optimized for Claude Code |
50
- | 🔄 **Cross-Service Operations** | Data synchronization between Liberica and Arabica |
51
-
52
- ### Use Cases
53
-
54
- - **Production Planning Management**: Create, query, and cancel production orders
55
- - **Product Data Management**: Cross-platform product search and synchronization
56
- - **Customer Operations**: Query customer information and generate quotes
57
- - **AI Automation**: Automate business processes through Claude Code
58
-
59
- ---
60
-
61
- ## Quick Start
62
-
63
- ### Installation
64
-
65
- ```bash
66
- # Install via npm
67
- npm install -g @newpeak/barista-cli
68
-
69
- # Or via yarn
70
- yarn global add @newpeak/barista-cli
71
-
72
- # Verify installation
73
- barista --version
74
- ```
75
-
76
- ### Initial Configuration
77
-
78
- ```bash
79
- # 1. Initialize config directory
80
- barista init
81
-
82
- # 2. Login with credentials (recommended method, automatically sets environment and tenant)
83
- barista liberica auth login dev your-tenant your-username your-password
84
-
85
- # Or interactive login (system will prompt for missing information)
86
- barista liberica auth login
87
-
88
- # 3. Verify login status
89
- barista auth status
90
-
91
- # 4. View current context (confirm environment is automatically set)
92
- barista context show
93
- ```
94
-
95
- **Note**: After using `barista liberica auth login`, the system automatically sets the current environment context, so subsequent commands do not need to specify `--env` and `--tenant` parameters.
96
-
97
- ### Basic Usage Examples
98
-
99
- ```bash
100
- # View current context
101
- barista context show
102
-
103
- # List all orders (Liberica)
104
- barista liberica orders list
105
-
106
- # Search products (supports fuzzy search)
107
- barista liberica products search --keyword "coffee machine"
108
-
109
- # View Arabica product catalog
110
- barista arabica products public-catalog
111
-
112
- # Create production order (dry-run preview mode)
113
- barista liberica orders create --product-id 123 --quantity 100 --dry-run
114
- ```
115
-
116
- ---
117
-
118
- ## Architecture Design
119
-
120
- ### Environment Mapping
121
-
122
- #### Liberica (Production Management SaaS)
123
-
124
- | Environment | Domain Format | Description |
125
- |-------------|---------------|-------------|
126
- | dev | `{tenant}-dev.newpeaksh.com` | Development environment |
127
- | test | `{tenant}-test.newpeaksh.com` | Test environment |
128
- | prod-cn | `{tenant}.newpeaksh.com` | China production environment |
129
- | prod-jp | `{tenant}.newpeakjp.com` | Japan production environment |
130
-
131
- #### Arabica (Sales Platform)
132
-
133
- | Environment | Domain | Description |
134
- |-------------|--------|-------------|
135
- | dev | `arabica-dev.newpeaksh.com` | Development environment |
136
- | test | `arabica-test.newpeaksh.com` | Test environment |
137
- | prod-cn | `www.newpeaksh.com` | China production environment |
138
- | prod-jp | `members.newpeakjp.com` | Japan production environment |
139
-
140
- ### Authentication Mechanism
141
-
142
- Barista CLI uses Token-based authentication:
143
-
144
- ```
145
- ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
146
- │ Barista CLI │────▶│ Auth Server │────▶│ API Servers │
147
- │ │ │ │ │ │
148
- │ • Login Request │ │ • Verify Creds │ │ • Verify Token │
149
- │ • Store Token │◀────│ • Issue JWT │◀────│ • Return Data │
150
- │ (Keychain) │ │ │ │ │
151
- └─────────────────┘ └──────────────────┘ └─────────────────┘
152
- ```
153
-
154
- **Security Features:**
155
-
156
- - **Keychain Storage**: Tokens are securely stored in system keychain (macOS Keychain, Windows Credential, Linux Secret Service)
157
- - **Auto Skip Auth**: Public interfaces (like product catalog queries) do not require authentication
158
- - **Environment Isolation**: Each environment and tenant uses independent tokens
159
- - **Token Refresh**: Supports automatic refresh of tokens nearing expiration
160
-
161
- ---
162
-
163
- ## Command Documentation
164
-
165
- > **Complete Command Reference**: For a complete reference of all commands (including implemented and planned), please see [Command Reference](./docs/commands/REFERENCE.md).
166
-
167
- ### Command Structure
168
-
169
- ```
170
- barista <service> <resource> <action> [options]
171
- ```
172
-
173
- **Examples:**
174
-
175
- ```bash
176
- barista liberica orders list --page 1 --size 20
177
- barista arabica quotes calculate --product-id 123 --quantity 10
178
- ```
179
-
180
- ### Global Options
181
-
182
- | Option | Description | Example |
183
- |--------|-------------|---------|
184
- | `--env` | Specify environment | `--env prod-cn` |
185
- | `--tenant` | Specify tenant | `--tenant electionjp` |
186
- | `--service` | Specify service | `--service liberica` |
187
- | `--dry-run` | Preview mode | `--dry-run` |
188
- | `--json` | JSON output | `--json` |
189
- | `--help` | Show help | `--help` |
190
-
191
- ### Context Management
192
-
193
- Context management is used to quickly switch working environments, avoiding the need to specify environment parameters for every command.
194
-
195
- ```bash
196
- # View current context
197
- barista context show
198
-
199
- # Output example:
200
- # ┌─────────────┬─────────────────┐
201
- # │ Property │ Value │
202
- # ├─────────────┼─────────────────┤
203
- # │ Current Env │ dev │
204
- # │ Current Tenant│ electionjp │
205
- # │ Current Service│ liberica │
206
- # │ Token Status│ Logged In │
207
- # │ Token Expiry│ 2024-12-31 │
208
- # └─────────────┴─────────────────┘
209
-
210
- # Switch environment
211
- barista context use-env [dev|test|prod-cn|prod-jp]
212
-
213
- # Switch tenant
214
- barista context use-tenant <tenant-name>
215
-
216
- # Switch default service
217
- barista context use-service [liberica|arabica]
218
- ```
219
-
220
- ### Authentication Management
221
-
222
- Barista CLI provides two login methods:
223
-
224
- #### 1. Credential Login (Recommended)
225
- Use username and password for complete authentication flow, automatically obtaining and storing Token:
226
-
227
- ```bash
228
- # Liberica credential login
229
- barista liberica auth login <env> [tenant] [username] [password]
230
-
231
- # Example: Login to Liberica test environment
232
- barista liberica auth login test electionjp admin@shanghai.newpeaksh.com 123456
233
-
234
- # Interactive login (system will prompt for missing information)
235
- barista liberica auth login
236
-
237
- # After login, the current environment context is automatically set
238
- ```
239
-
240
- #### 2. Direct Token Storage
241
- Suitable for scenarios where you already have a JWT Token (e.g., obtained from other sources):
242
-
243
- ```bash
244
- # Directly store Token
245
- barista auth login --service <service> --env <env> [--tenant <tenant>]
246
-
247
- # Example: Store Liberica development environment Token
248
- barista auth login --service liberica --env dev --tenant electionjp
249
- # Prompt: Enter your token: [input existing Token]
250
-
251
- # Check login status
252
- barista auth status
253
-
254
- # Output example:
255
- # ✓ Liberica (dev) - Logged In (Expires: 2024-12-31)
256
- # ✗ Liberica (test) - Not Logged In
257
- # ✓ Arabica (prod-cn) - Logged In (Expires: 2024-12-30)
258
-
259
- # Logout (clear Token)
260
- barista auth logout --service <service> --env <env>
261
-
262
- # Logout all environments
263
- barista auth logout --all
264
- ```
265
-
266
- **Important**: After using `barista liberica auth login`, the system automatically sets the current environment context, so subsequent commands do not need to specify `--env` parameter.
267
-
268
- ### Liberica Commands
269
-
270
- #### Order Management
271
-
272
- ```bash
273
- # List orders (paginated)
274
- barista liberica orders list [--page <n>] [--size <n>] [--status <status>]
275
-
276
- # Get single order details
277
- barista liberica orders get <order-id>
278
-
279
- # Create order
280
- barista liberica orders create \
281
- --product-id <id> \
282
- --quantity <n> \
283
- [--delivery-date <date>] \
284
- [--note <text>]
285
-
286
- # Cancel order
287
- barista liberica orders cancel <order-id> [--reason <text>]
288
- ```
289
-
290
- #### Product Management
291
-
292
- ```bash
293
- # Search products
294
- barista liberica products search --keyword <keyword> [--category <id>]
295
-
296
- # Get product details
297
- barista liberica products get <product-id>
298
-
299
- # Get public product list (no auth required)
300
- barista liberica products public-list [--category <id>] [--page <n>]
301
- ```
302
-
303
- #### Production Planning
304
-
305
- ```bash
306
- # View production schedule
307
- barista liberica production schedule [--start-date <date>] [--end-date <date>]
308
-
309
- # Reschedule production
310
- barista liberica production reschedule <order-id> --new-date <date> [--dry-run]
311
-
312
- # Query capacity
313
- barista liberica production capacity [--date <date>] [--line <line-id>]
314
- ```
315
-
316
- ### Arabica Commands
317
-
318
- #### Product Management
319
-
320
- ```bash
321
- # List products
322
- barista arabica products list [--page <n>] [--size <n>] [--category <id>]
323
-
324
- # Search products
325
- barista arabica products search --keyword <keyword>
326
-
327
- # Get product catalog (public interface)
328
- barista arabica products public-catalog [--lang <zh|jp|en>]
329
- ```
330
-
331
- #### Quote Management
332
-
333
- ```bash
334
- # Calculate quote
335
- barista arabica quotes calculate \
336
- --product-id <id> \
337
- --quantity <n> \
338
- [--options <json>]
339
-
340
- # Create quote
341
- barista arabica quotes create \
342
- --customer-id <id> \
343
- --items <json> \
344
- [--valid-days <n>]
345
- ```
346
-
347
- #### Customer Management
348
-
349
- ```bash
350
- # Search customers
351
- barista arabica customers search --keyword <keyword> [--type <type>]
352
-
353
- # Get customer details
354
- barista arabica customers get <customer-id>
355
- ```
356
-
357
- ### Cross-Service Commands
358
-
359
- Cross-service commands enable data synchronization and business process衔接 between Liberica and Arabica.
360
-
361
- ```bash
362
- # Generate quote from order
363
- barista cross quote-from-order <order-id> [--target-service arabica]
364
-
365
- # Output example:
366
- # ✓ Quote Generated
367
- # ┌──────────┬────────────┐
368
- # │ Property │ Value │
369
- # ├──────────┼────────────┤
370
- # │ Order ID │ 12345 │
371
- # │ Quote ID │ QT-2024-001│
372
- # │ Amount │ ¥50,000 │
373
- # │ Validity │ 30 days │
374
- # └──────────┴────────────┘
375
-
376
- # Sync order status to Arabica
377
- barista cross sync-order <order-id> [--direction liberica-to-arabica]
378
- ```
379
-
380
- ---
381
-
382
- ## Advanced Features
383
-
384
- ### Dry-Run Mode
385
-
386
- Dry-Run mode allows you to preview the impact of write operations before executing them, avoiding mistakes.
387
-
388
- ```bash
389
- # All write operations support --dry-run option
390
- barista liberica orders create --product-id 123 --quantity 100 --dry-run
391
-
392
- # Output example:
393
- # 🔍 Dry-Run Mode: Operation will not be executed
394
- # ┌─────────────────┬──────────────────────┐
395
- # │ Operation │ Create Order │
396
- # ├─────────────────┼──────────────────────┤
397
- # │ Product │ Coffee Machine Pro (ID: 123) │
398
- # │ Quantity │ 100 │
399
- # │ Estimated Amount│ ¥50,000 │
400
- # │ Estimated Delivery│ 2024-12-31 │
401
- # │ Impact │ Add one order record │
402
- # └─────────────────┴──────────────────────┘
403
- #
404
- # ⚠️ Confirm execution? Add --confirm option or remove --dry-run
405
- ```
406
-
407
- **Default Dry-Run Operations:**
408
-
409
- The following destructive operations have Dry-Run mode enabled by default and require explicit confirmation:
410
-
411
- - Cancel order
412
- - Delete product
413
- - Batch update
414
-
415
- ### JSON Output Format
416
-
417
- Barista CLI supports JSON output for script processing and AI integration:
418
-
419
- ```bash
420
- barista liberica orders list --json
421
-
422
- # Output example:
423
- {
424
- "success": true,
425
- "data": {
426
- "items": [
427
- {
428
- "id": "12345",
429
- "productName": "Coffee Machine Pro",
430
- "quantity": 100,
431
- "status": "in_production",
432
- "createdAt": "2024-01-15T10:30:00Z"
433
- }
434
- ],
435
- "pagination": {
436
- "page": 1,
437
- "size": 20,
438
- "total": 150
439
- }
440
- }
441
- }
442
- ```
443
-
444
- ### CSV Export Format
445
-
446
- Barista CLI supports CSV format export, suitable for data analysis and Excel processing:
447
-
448
- ```bash
449
- # Export dictionary type data as CSV
450
- barista liberica dict-types tenant-items --lang ja --all --csv --output ./dict-data.csv
451
-
452
- # Output features:
453
- # • UTF-8 with BOM encoding ensures proper Chinese character recognition in Excel
454
- # • Automatic escape of special characters (commas, quotes, line breaks)
455
- # • Support for custom output file paths
456
- # • Can be combined with --json for both output formats
457
- ```
458
-
459
- CSV files use UTF-8 with BOM encoding to ensure correct display of Chinese, Japanese, Vietnamese and other Unicode characters in Microsoft Excel and other tools.
460
-
461
- ---
462
-
463
- ## Configuration
464
-
465
- ### Configuration File
466
-
467
- The configuration file is located at `~/.barista/config.yaml`:
468
-
469
- ```yaml
470
- # Barista CLI Configuration File
471
-
472
- # Default context settings
473
- defaults:
474
- env: dev
475
- tenant: electionjp
476
- service: liberica
477
-
478
- # Environment configuration
479
- environments:
480
- dev:
481
- liberica:
482
- baseUrl: "https://{tenant}-dev.newpeaksh.com"
483
- timeout: 30000
484
- arabica:
485
- baseUrl: "https://arabica-dev.newpeaksh.com"
486
- timeout: 30000
487
-
488
- test:
489
- liberica:
490
- baseUrl: "https://{tenant}-test.newpeaksh.com"
491
- timeout: 30000
492
- arabica:
493
- baseUrl: "https://arabica-test.newpeaksh.com"
494
- timeout: 30000
495
-
496
- prod-cn:
497
- liberica:
498
- baseUrl: "https://{tenant}.newpeaksh.com"
499
- timeout: 60000
500
- arabica:
501
- baseUrl: "https://www.newpeaksh.com"
502
- timeout: 60000
503
-
504
- prod-jp:
505
- liberica:
506
- baseUrl: "https://{tenant}.newpeakjp.com"
507
- timeout: 60000
508
- arabica:
509
- baseUrl: "https://members.newpeakjp.com"
510
- timeout: 60000
511
-
512
- # Output configuration
513
- output:
514
- format: table # table | json
515
- color: true
516
- timestamp: true
517
- ```
518
-
519
- ### Multi-Tenant Configuration
520
-
521
- Supports configuring multiple tenants for quick switching:
522
-
523
- ```bash
524
- # Add tenant configuration
525
- barista config add-tenant \
526
- --name customer-a \
527
- --liberica-id customer-a-id \
528
- --arabica-id customer-a-arabica-id
529
-
530
- # List configured tenants
531
- barista config list-tenants
532
-
533
- # Quick switch tenant
534
- barista context use-tenant customer-a
535
- ```
536
-
537
- ---
538
-
539
- ## AI Integration
540
-
541
- Barista CLI is optimized for AI programming assistants, especially Claude Code.
542
-
543
- ### Claude Code Usage Examples
544
-
545
- ```typescript
546
- // Using Barista CLI in Claude Code
547
- // Example: Get order list and analyze
548
-
549
- const result = await $`barista liberica orders list --json --page 1 --size 10`;
550
- const orders = JSON.parse(result.stdout);
551
-
552
- // Analyze order data
553
- const analysis = orders.data.items.map(order => ({
554
- id: order.id,
555
- status: order.status,
556
- amount: order.amount
557
- }));
558
- ```
559
-
560
- ### Skills Files
561
-
562
- Barista CLI provides Claude Code Skills files, located at:
563
-
564
- ```
565
- ~/.barista/claude/skills/
566
- ├── orders.md # Order management skills
567
- ├── products.md # Product management skills
568
- ├── quotes.md # Quote management skills
569
- └── customers.md # Customer management skills
570
- ```
571
-
572
- **Example Skills File:**
573
-
574
- ```markdown
575
- # Order Management Skills
576
-
577
- ## List Pending Orders
578
-
579
- When user asks about pending orders:
580
-
581
- 1. Execute command: barista liberica orders list --status pending --json
582
- 2. Parse the returned JSON
583
- 3. Summarize order count and total amount
584
- 4. List key information for the top 5 orders
585
-
586
- ## Create New Order
587
-
588
- When user needs to create an order:
589
-
590
- 1. Confirm product ID and quantity
591
- 2. Use dry-run preview: barista liberica orders create --dry-run ...
592
- 3. Execute actual command after user confirmation
593
- ```
594
-
595
- ### AI-Friendly Output
596
-
597
- All commands support the `--json` option, returning structured JSON data:
598
-
599
- ```bash
600
- # Query with structured output
601
- barista liberica orders get 12345 --json
602
-
603
- {
604
- "success": true,
605
- "data": {
606
- "id": "12345",
607
- "status": "in_production",
608
- "product": {
609
- "id": "100",
610
- "name": "Coffee Machine Pro"
611
- },
612
- "quantity": 100,
613
- "amount": 50000,
614
- "timeline": {
615
- "created": "2024-01-15T10:30:00Z",
616
- "delivery": "2024-02-15"
617
- }
618
- },
619
- "meta": {
620
- "requestId": "req-abc123",
621
- "timestamp": "2024-01-15T10:30:00Z"
622
- }
623
- }
624
- ```
625
-
626
- ---
627
-
628
- ## Development Guide
629
-
630
- ### Project Structure
631
-
632
- ```
633
- coffee-barista-cli/
634
- ├── bin/
635
- │ └── barista.js # Entry file
636
- ├── src/
637
- │ ├── commands/ # Command implementations
638
- │ │ ├── context/ # Context management commands
639
- │ │ ├── auth/ # Authentication commands
640
- │ │ ├── liberica/ # Liberica service commands
641
- │ │ │ ├── orders.js
642
- │ │ │ ├── products.js
643
- │ │ │ └── production.js
644
- │ │ ├── arabica/ # Arabica service commands
645
- │ │ │ ├── products.js
646
- │ │ │ ├── quotes.js
647
- │ │ │ └── customers.js
648
- │ │ └── cross/ # Cross-service commands
649
- │ ├── core/ # Core modules
650
- │ │ ├── auth.js # Authentication management
651
- │ │ ├── config.js # Configuration management
652
- │ │ ├── context.js # Context management
653
- │ │ └── api-client.js # API client
654
- │ ├── utils/ # Utility functions
655
- │ │ ├── formatter.js # Output formatting
656
- │ │ ├── validator.js # Parameter validation
657
- │ │ └── keychain.js # Keychain operations
658
- │ └── templates/ # Template files
659
- ├── skills/ # Claude Code Skills
660
- ├── tests/ # Test files
661
- ├── package.json
662
- └── README.md
663
- ```
664
-
665
- ### Local Development
666
-
667
- ```bash
668
- # 1. Clone repository
669
- git clone https://gitlab.newpeaksh.com/coffee/coffee-barista-cli.git
670
- cd coffee-barista-cli
671
-
672
- # 2. Install dependencies
673
- npm install
674
-
675
- # 3. Link globally (development mode)
676
- npm link
677
-
678
- # 4. Verify link
679
- barista --version
680
-
681
- # 5. Run tests
682
- npm test
683
-
684
- # 6. Code linting
685
- npm run lint
686
- ```
687
-
688
- ### Adding New Commands
689
-
690
- **Important**: New commands must follow the [Command Design Specification](./docs/COMMAND_DESIGN_SPEC.md), including design documentation, technical review, and other complete processes.
691
-
692
- For detailed steps, please refer to:
693
- - [Complete Command Reference](./docs/commands/REFERENCE.md) - All command list and development priorities
694
- - [Command Design Specification](./docs/COMMAND_DESIGN_SPEC.md#5-command-development-process)
695
- - [Command Development Guide](./docs/COMMANDS.md)
696
-
697
- ---
698
-
699
- ## Contributing
700
-
701
- We welcome all forms of contributions, including but not limited to:
702
-
703
- - 🐛 Reporting bugs
704
- - 💡 Suggesting new features
705
- - 📝 Improving documentation
706
- - 🔧 Submitting code fixes
707
- - ✨ Adding new features
708
-
709
- ### Commit Conventions
710
-
711
- Please follow [Conventional Commits](https://www.conventionalcommits.org/) specification:
712
-
713
- ```bash
714
- # Fix bug
715
- fix: fix order list pagination issue
716
-
717
- # Add feature
718
- feat: add inventory query command
719
-
720
- # Documentation update
721
- docs: update environment mapping in README
722
-
723
- # Code refactoring
724
- refactor: refactor API client error handling
725
- ```
726
-
727
- ### Development Workflow
728
-
729
- 1. Fork this repository
730
- 2. Create feature branch: `git checkout -b feature/my-feature`
731
- 3. Commit changes: `git commit -m 'feat: add some feature'`
732
- 4. Push branch: `git push origin feature/my-feature`
733
- 5. Create Pull Request
734
-
735
- ---
736
-
737
- ## Related Projects
738
-
739
- | Project | Description | Link |
740
- |---------|-------------|------|
741
- | ☕ Liberica Backend | Production Management SaaS Backend | [coffee-liberica-end](https://gitlab.newpeaksh.com/coffee/coffee-liberica-end) |
742
- | 🖥️ Liberica Frontend | Production Management Web Frontend | [coffee-liberica-front](https://gitlab.newpeaksh.com/coffee/coffee-liberica-front) |
743
- | 📱 Liberica Mobile | Production Management Mobile | [coffee-liberica-mobile-front](https://gitlab.newpeaksh.com/coffee/coffee-liberica-mobile-front) |
744
- | 🛒 Arabica Backend | Sales Platform Backend | [coffee-arabica-end](https://gitlab.newpeaksh.com/coffee/coffee-arabica-end) |
745
- | 🌐 Arabica Frontend | Sales Platform Frontend | [coffee-arabica-front](https://gitlab.newpeaksh.com/coffee/coffee-arabica-front) |
746
-
747
- ---
748
-
749
- ## License
750
-
751
- [MIT](LICENSE) © Newpeak Technology
752
-
753
- ---
754
-
755
- <p align="center">
756
- Powered by ☕
757
- </p>