newo 1.5.1 → 1.5.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/CHANGELOG.md +30 -0
- package/README.md +468 -126
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.2] - 2025-01-15
|
|
9
|
+
|
|
10
|
+
### Enhanced
|
|
11
|
+
- **Documentation Overhaul**: Complete README restructuring with professional presentation
|
|
12
|
+
- Added npm, license, TypeScript, and Node.js badges for credibility
|
|
13
|
+
- Enhanced project description highlighting multi-customer support capabilities
|
|
14
|
+
- Visual feature bullets with emojis for improved readability and engagement
|
|
15
|
+
- **Multi-Customer Documentation**: Comprehensive guide for multi-customer workflows
|
|
16
|
+
- Three flexible configuration methods: JSON arrays, individual env vars, mixed approaches
|
|
17
|
+
- Clear migration path from single to multi-customer setup
|
|
18
|
+
- Command examples for multi-customer operations (`--customer` flag usage)
|
|
19
|
+
- **Professional Documentation Structure**:
|
|
20
|
+
- Table format for command reference with improved readability
|
|
21
|
+
- Visual folder tree showing accurate `newo_customers/` structure
|
|
22
|
+
- Enhanced CI/CD integration examples for both single and multi-customer scenarios
|
|
23
|
+
- Contributing guidelines, API reference, and support channels
|
|
24
|
+
- **Corrected File Organization**: Updated folder structure documentation to match actual implementation
|
|
25
|
+
- Fixed root folder from `projects/` to `newo_customers/`
|
|
26
|
+
- Accurate customer folder hierarchy: `newo_customers/{customerIdn}/projects/{projectIdn}/`
|
|
27
|
+
- Customer-specific state management in `.newo/{customerIdn}/`
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- **Folder Structure Documentation**: Corrected project structure examples to match actual code implementation
|
|
31
|
+
- **Package Description**: Updated npm package description to reflect multi-customer capabilities
|
|
32
|
+
|
|
33
|
+
### Developer Experience
|
|
34
|
+
- **GitHub/npm Ready**: Professional presentation suitable for public package repository
|
|
35
|
+
- **Clear Navigation**: Improved documentation structure with proper sectioning and examples
|
|
36
|
+
- **Enhanced Onboarding**: Comprehensive quick-start guide and configuration examples
|
|
37
|
+
|
|
8
38
|
## [1.5.1] - 2025-01-14
|
|
9
39
|
|
|
10
40
|
### Added
|
package/README.md
CHANGED
|
@@ -1,101 +1,254 @@
|
|
|
1
1
|
# NEWO CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/newo)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
|
|
8
|
+
**NEWO CLI** - Sync NEWO AI Agent skills between the NEWO platform and your local development environment. Supports **multi-customer workspaces**, **Git-first workflows**, and **comprehensive project management**.
|
|
9
|
+
|
|
10
|
+
Mirror NEWO "Project → Agent → Flow → Skills" structure to local files with:
|
|
11
|
+
- 🔄 **Two-way synchronization** - Pull from NEWO, push local changes back
|
|
12
|
+
- 🏢 **Multi-customer support** - Work with multiple NEWO accounts simultaneously
|
|
13
|
+
- 📁 **Multi-project workspaces** - Manage multiple projects in organized folder structure
|
|
14
|
+
- 🔐 **Secure authentication** - API key-based auth with automatic token refresh
|
|
15
|
+
- ⚡ **Change detection** - SHA256-based efficient sync of only modified files
|
|
16
|
+
- 🧠 **AI skill formats** - Support for `.guidance` (AI prompts) and `.jinja` (NSL templates)
|
|
17
|
+
- 📊 **Knowledge base import** - Bulk import AKB articles from structured text files
|
|
18
|
+
- 🔧 **CI/CD ready** - GitHub Actions integration for automated deployments
|
|
4
19
|
|
|
5
|
-
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### Installation
|
|
6
25
|
|
|
7
|
-
|
|
26
|
+
**Option 1: Global Installation (Recommended)**
|
|
8
27
|
```bash
|
|
9
28
|
npm install -g newo
|
|
10
29
|
```
|
|
11
|
-
|
|
30
|
+
|
|
31
|
+
**Option 2: Local Project Installation**
|
|
12
32
|
```bash
|
|
13
|
-
newo
|
|
14
|
-
newo push
|
|
15
|
-
newo status
|
|
33
|
+
npm install newo
|
|
16
34
|
```
|
|
17
35
|
|
|
18
|
-
|
|
36
|
+
**Option 3: Development from Source**
|
|
19
37
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
git clone https://github.com/sabbah13/newo-cli.git
|
|
39
|
+
cd newo-cli
|
|
40
|
+
npm install && npm run build
|
|
22
41
|
```
|
|
23
|
-
|
|
42
|
+
|
|
43
|
+
### Basic Setup
|
|
44
|
+
|
|
45
|
+
1. **Get your NEWO API key** from [app.newo.ai](https://app.newo.ai) → Integrations → API Integration → Create Connector
|
|
46
|
+
2. **Configure environment**:
|
|
47
|
+
```bash
|
|
48
|
+
cp .env.example .env
|
|
49
|
+
# Edit .env with your API key
|
|
50
|
+
```
|
|
51
|
+
3. **Start syncing**:
|
|
52
|
+
```bash
|
|
53
|
+
newo pull # Download all projects
|
|
54
|
+
newo push # Upload changes back
|
|
55
|
+
newo status # See what's modified
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
### Single Customer Setup
|
|
63
|
+
|
|
64
|
+
For working with one NEWO account:
|
|
65
|
+
|
|
24
66
|
```bash
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
67
|
+
# .env file
|
|
68
|
+
NEWO_API_KEY=your_api_key_here
|
|
69
|
+
NEWO_PROJECT_ID=project_uuid_here # Optional: specific project only
|
|
28
70
|
```
|
|
29
71
|
|
|
30
|
-
###
|
|
72
|
+
### Multi-Customer Setup
|
|
73
|
+
|
|
74
|
+
Work with multiple NEWO accounts simultaneously using three flexible approaches:
|
|
75
|
+
|
|
76
|
+
#### Method 1: JSON Array (Recommended)
|
|
31
77
|
```bash
|
|
32
|
-
#
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
78
|
+
# .env file
|
|
79
|
+
NEWO_API_KEYS=["api_key_customer_1", "api_key_customer_2", "api_key_customer_3"]
|
|
80
|
+
NEWO_DEFAULT_CUSTOMER=NEWO_ABC123 # Optional: set after first pull
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Method 2: JSON Array with Project IDs
|
|
84
|
+
```bash
|
|
85
|
+
# .env file
|
|
86
|
+
NEWO_API_KEYS=[
|
|
87
|
+
{"key":"api_key_1","project_id":"project_uuid_1"},
|
|
88
|
+
{"key":"api_key_2","project_id":"project_uuid_2"},
|
|
89
|
+
{"key":"api_key_3"}
|
|
90
|
+
]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Method 3: Individual Environment Variables
|
|
94
|
+
```bash
|
|
95
|
+
# .env file
|
|
96
|
+
NEWO_CUSTOMER_ACME_API_KEY=acme_api_key_here
|
|
97
|
+
NEWO_CUSTOMER_BETA_API_KEY=beta_api_key_here
|
|
98
|
+
NEWO_CUSTOMER_GAMMA_API_KEY=gamma_api_key_here
|
|
37
99
|
```
|
|
38
100
|
|
|
39
|
-
|
|
101
|
+
### Getting Your NEWO API Keys
|
|
40
102
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
5. **Copy** your API key (it will look like: `458663bd41f2d1...`)
|
|
103
|
+
1. **Login** to [app.newo.ai](https://app.newo.ai)
|
|
104
|
+
2. **Navigate** to **Integrations** page
|
|
105
|
+
3. **Find** **API Integration** in the list
|
|
106
|
+
4. **Create** a new **Connector**
|
|
107
|
+
5. **Copy** the API key (format: `458663bd41f2d1...`)
|
|
47
108
|
|
|
48
109
|

|
|
49
110
|
|
|
50
|
-
###
|
|
111
|
+
### Advanced Configuration
|
|
112
|
+
|
|
51
113
|
```bash
|
|
52
|
-
|
|
53
|
-
#
|
|
114
|
+
# .env file
|
|
115
|
+
NEWO_BASE_URL=https://app.newo.ai # NEWO platform URL
|
|
116
|
+
NEWO_DEFAULT_CUSTOMER=NEWO_ABC123 # Default customer for operations
|
|
117
|
+
NEWO_ACCESS_TOKEN=direct_access_token # Alternative to API key
|
|
118
|
+
NEWO_REFRESH_TOKEN=refresh_token_here # For token refresh
|
|
119
|
+
NEWO_REFRESH_URL=custom_refresh_endpoint # Custom refresh endpoint
|
|
54
120
|
```
|
|
55
121
|
|
|
56
|
-
|
|
57
|
-
- `NEWO_BASE_URL` (default `https://app.newo.ai`)
|
|
58
|
-
- `NEWO_API_KEY` (your API key from Step 1)
|
|
59
|
-
|
|
60
|
-
Optional environment variables:
|
|
61
|
-
- `NEWO_PROJECT_ID` (specific project UUID - if not set, pulls all accessible projects)
|
|
62
|
-
- `NEWO_ACCESS_TOKEN` (direct access token)
|
|
63
|
-
- `NEWO_REFRESH_TOKEN` (refresh token)
|
|
64
|
-
- `NEWO_REFRESH_URL` (custom refresh endpoint)
|
|
122
|
+
---
|
|
65
123
|
|
|
66
124
|
## Commands
|
|
125
|
+
|
|
126
|
+
### Core Commands
|
|
127
|
+
|
|
128
|
+
| Command | Description | Examples |
|
|
129
|
+
|---------|-------------|----------|
|
|
130
|
+
| `newo pull` | Download projects from NEWO | `newo pull`<br>`newo pull --customer=ACME`<br>`newo pull --project=uuid` |
|
|
131
|
+
| `newo push` | Upload local changes to NEWO | `newo push`<br>`newo push --customer=BETA` |
|
|
132
|
+
| `newo status` | Show modified files | `newo status`<br>`newo status --verbose` |
|
|
133
|
+
| `newo list-customers` | List configured customers | `newo list-customers` |
|
|
134
|
+
| `newo import-akb` | Import knowledge base articles | `newo import-akb file.txt persona_id` |
|
|
135
|
+
| `newo meta` | Get project metadata | `newo meta --project=uuid` |
|
|
136
|
+
|
|
137
|
+
### Multi-Customer Commands
|
|
138
|
+
|
|
67
139
|
```bash
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
140
|
+
# List all configured customers
|
|
141
|
+
newo list-customers
|
|
142
|
+
|
|
143
|
+
# Pull projects from specific customer
|
|
144
|
+
newo pull --customer=NEWO_ABC123
|
|
145
|
+
|
|
146
|
+
# Push changes to specific customer
|
|
147
|
+
newo push --customer=NEWO_XYZ789
|
|
148
|
+
|
|
149
|
+
# Work with default customer (all projects)
|
|
150
|
+
newo pull # Uses default or prompts for selection
|
|
151
|
+
newo push # Pushes to appropriate customers based on file origin
|
|
73
152
|
```
|
|
74
153
|
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
154
|
+
### Command Options
|
|
155
|
+
|
|
156
|
+
- `--customer=<customer_idn>` - Target specific customer
|
|
157
|
+
- `--project=<project_uuid>` - Target specific project
|
|
158
|
+
- `--verbose` / `-v` - Detailed output with debugging info
|
|
159
|
+
- `--help` / `-h` - Show command help
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Project Structure
|
|
164
|
+
|
|
165
|
+
### File Organization
|
|
166
|
+
|
|
167
|
+
**Multi-Customer Workspace**
|
|
168
|
+
```
|
|
169
|
+
newo_customers/ # Root folder for all customers
|
|
170
|
+
├── NEWO_ABC123/ # Customer folder (auto-detected IDN)
|
|
171
|
+
│ └── projects/ # Customer's projects
|
|
172
|
+
│ ├── flows.yaml # Customer's flows export
|
|
173
|
+
│ └── ProjectAlpha/ # Individual project folder
|
|
174
|
+
│ ├── metadata.json # Project metadata
|
|
175
|
+
│ ├── agent_support/ # Agent folder
|
|
176
|
+
│ │ ├── flow_onboarding/ # Flow folder
|
|
177
|
+
│ │ │ ├── skill_welcome.guidance # AI prompt skill
|
|
178
|
+
│ │ │ └── skill_setup.jinja # NSL template skill
|
|
179
|
+
│ │ └── flow_help/
|
|
180
|
+
│ │ └── skill_faq.guidance
|
|
181
|
+
│ └── agent_sales/
|
|
182
|
+
│ └── flow_demo/
|
|
183
|
+
│ └── skill_pitch.jinja
|
|
184
|
+
├── NEWO_XYZ789/ # Another customer
|
|
185
|
+
│ └── projects/
|
|
186
|
+
│ ├── flows.yaml
|
|
187
|
+
│ └── ProjectBeta/
|
|
188
|
+
│ └── ...
|
|
189
|
+
└── .newo/ # CLI state directory (hidden)
|
|
190
|
+
├── NEWO_ABC123/ # Customer-specific state
|
|
191
|
+
│ ├── map.json # NEWO ID mappings
|
|
192
|
+
│ └── hashes.json # Change detection hashes
|
|
193
|
+
├── NEWO_XYZ789/
|
|
194
|
+
│ ├── map.json
|
|
195
|
+
│ └── hashes.json
|
|
196
|
+
└── tokens.json # Authentication tokens
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### File Types
|
|
200
|
+
|
|
201
|
+
- **`.guidance`** - AI prompt skills (natural language instructions)
|
|
202
|
+
- **`.jinja`** - NSL template skills (Jinja2 templating with NEWO extensions)
|
|
203
|
+
- **`metadata.json`** - Project info (title, description, version, team)
|
|
204
|
+
- **`flows.yaml`** - Complete project structure export for external tools
|
|
205
|
+
|
|
206
|
+
### Customer & Project Identification
|
|
207
|
+
|
|
208
|
+
- **Customer IDN**: Auto-detected from API response (e.g., `NEWO_ABC123`)
|
|
209
|
+
- **Project folders**: Named as `{CustomerIDN}_{ProjectIDN}` for clarity
|
|
210
|
+
- **Change tracking**: SHA256 hashes prevent unnecessary uploads
|
|
211
|
+
- **Automatic mapping**: `.newo/map.json` maintains NEWO platform relationships
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Key Features
|
|
216
|
+
|
|
217
|
+
### 🏢 Multi-Customer Support
|
|
218
|
+
- **Multiple NEWO accounts** - Work with different customers/organizations
|
|
219
|
+
- **Flexible configuration** - JSON arrays, individual env vars, or mixed approaches
|
|
220
|
+
- **Customer isolation** - Separate authentication and project spaces
|
|
221
|
+
- **Auto-detection** - Customer IDNs automatically resolved from API responses
|
|
222
|
+
- **Default customer** - Set preferred customer for streamlined workflows
|
|
223
|
+
|
|
224
|
+
### 📁 Multi-Project Management
|
|
225
|
+
- **Workspace organization** - All accessible projects in structured folders
|
|
226
|
+
- **Project metadata** - Complete project info with `metadata.json`
|
|
227
|
+
- **Selective sync** - Target specific projects or sync everything
|
|
228
|
+
- **Project structure export** - `flows.yaml` for external tooling integration
|
|
229
|
+
- **Cross-project operations** - Commands work across entire workspace
|
|
230
|
+
|
|
231
|
+
### 🔄 Intelligent Synchronization
|
|
232
|
+
- **Two-way sync** - Pull from NEWO platform, push local changes back
|
|
233
|
+
- **Change detection** - SHA256 hashing prevents unnecessary uploads
|
|
234
|
+
- **Incremental sync** - Only modified files are transferred
|
|
235
|
+
- **Conflict resolution** - Safe handling of concurrent changes
|
|
236
|
+
- **Batch operations** - Efficient bulk file processing
|
|
237
|
+
|
|
238
|
+
### 🔐 Enterprise Security
|
|
239
|
+
- **API key authentication** - Secure token-based authentication
|
|
240
|
+
- **Automatic token refresh** - Seamless session management
|
|
241
|
+
- **Multi-customer isolation** - Separate auth contexts per customer
|
|
242
|
+
- **Environment protection** - Secure credential management
|
|
243
|
+
- **Audit logging** - Comprehensive operation tracking
|
|
244
|
+
|
|
245
|
+
### 🛠️ Developer Experience
|
|
246
|
+
- **TypeScript implementation** - Full type safety and IDE support
|
|
247
|
+
- **Comprehensive testing** - 500+ test cases with 90%+ coverage
|
|
248
|
+
- **Error handling** - User-friendly messages with troubleshooting
|
|
249
|
+
- **Verbose debugging** - Detailed logging with `--verbose` flag
|
|
250
|
+
- **CI/CD integration** - GitHub Actions workflows included
|
|
251
|
+
- **Cross-platform** - Windows, macOS, Linux support
|
|
99
252
|
|
|
100
253
|
## Robustness & Error Handling
|
|
101
254
|
|
|
@@ -127,9 +280,14 @@ When errors occur, NEWO CLI provides:
|
|
|
127
280
|
- 📋 **Step-by-step guidance** for resolving authentication and network problems
|
|
128
281
|
- 🔧 **Configuration validation** to ensure proper setup
|
|
129
282
|
|
|
130
|
-
|
|
131
|
-
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## CI/CD Integration
|
|
286
|
+
|
|
287
|
+
### Single Customer CI/CD
|
|
288
|
+
|
|
132
289
|
```yaml
|
|
290
|
+
# .github/workflows/deploy.yml
|
|
133
291
|
name: Deploy NEWO Skills
|
|
134
292
|
on:
|
|
135
293
|
push:
|
|
@@ -137,6 +295,7 @@ on:
|
|
|
137
295
|
paths:
|
|
138
296
|
- 'projects/**/*.guidance'
|
|
139
297
|
- 'projects/**/*.jinja'
|
|
298
|
+
|
|
140
299
|
jobs:
|
|
141
300
|
deploy:
|
|
142
301
|
runs-on: ubuntu-latest
|
|
@@ -149,10 +308,75 @@ jobs:
|
|
|
149
308
|
- run: npm run build && node ./dist/cli.js push
|
|
150
309
|
env:
|
|
151
310
|
NEWO_BASE_URL: https://app.newo.ai
|
|
152
|
-
NEWO_PROJECT_ID: ${{ secrets.NEWO_PROJECT_ID }}
|
|
153
311
|
NEWO_API_KEY: ${{ secrets.NEWO_API_KEY }}
|
|
154
|
-
# Optional
|
|
155
|
-
|
|
312
|
+
NEWO_PROJECT_ID: ${{ secrets.NEWO_PROJECT_ID }} # Optional
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Multi-Customer CI/CD
|
|
316
|
+
|
|
317
|
+
```yaml
|
|
318
|
+
# .github/workflows/deploy-multi.yml
|
|
319
|
+
name: Deploy Multi-Customer NEWO Skills
|
|
320
|
+
on:
|
|
321
|
+
push:
|
|
322
|
+
branches: [ main ]
|
|
323
|
+
paths:
|
|
324
|
+
- 'projects/**/*.guidance'
|
|
325
|
+
- 'projects/**/*.jinja'
|
|
326
|
+
|
|
327
|
+
jobs:
|
|
328
|
+
deploy:
|
|
329
|
+
runs-on: ubuntu-latest
|
|
330
|
+
steps:
|
|
331
|
+
- uses: actions/checkout@v4
|
|
332
|
+
- uses: actions/setup-node@v4
|
|
333
|
+
with:
|
|
334
|
+
node-version: 20
|
|
335
|
+
- run: npm ci
|
|
336
|
+
- run: npm run build && node ./dist/cli.js push
|
|
337
|
+
env:
|
|
338
|
+
NEWO_BASE_URL: https://app.newo.ai
|
|
339
|
+
# Multi-customer API keys as JSON array
|
|
340
|
+
NEWO_API_KEYS: ${{ secrets.NEWO_API_KEYS }}
|
|
341
|
+
# Example: '["customer1_api_key", "customer2_api_key"]'
|
|
342
|
+
|
|
343
|
+
# Or individual customer keys
|
|
344
|
+
NEWO_CUSTOMER_ACME_API_KEY: ${{ secrets.NEWO_CUSTOMER_ACME_API_KEY }}
|
|
345
|
+
NEWO_CUSTOMER_BETA_API_KEY: ${{ secrets.NEWO_CUSTOMER_BETA_API_KEY }}
|
|
346
|
+
|
|
347
|
+
# Optional default customer
|
|
348
|
+
NEWO_DEFAULT_CUSTOMER: ${{ secrets.NEWO_DEFAULT_CUSTOMER }}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### GitHub Secrets Setup
|
|
352
|
+
|
|
353
|
+
Add these secrets to your repository:
|
|
354
|
+
|
|
355
|
+
**Single Customer:**
|
|
356
|
+
- `NEWO_API_KEY` - Your NEWO API key
|
|
357
|
+
- `NEWO_PROJECT_ID` - (Optional) Specific project UUID
|
|
358
|
+
|
|
359
|
+
**Multi-Customer:**
|
|
360
|
+
- `NEWO_API_KEYS` - JSON array: `["key1", "key2", "key3"]`
|
|
361
|
+
- `NEWO_CUSTOMER_<IDN>_API_KEY` - Individual customer keys
|
|
362
|
+
- `NEWO_DEFAULT_CUSTOMER` - (Optional) Default customer IDN
|
|
363
|
+
|
|
364
|
+
### Advanced CI/CD Workflows
|
|
365
|
+
|
|
366
|
+
```yaml
|
|
367
|
+
# Customer-specific deployment
|
|
368
|
+
- name: Deploy to specific customer
|
|
369
|
+
run: node ./dist/cli.js push --customer=NEWO_ABC123
|
|
370
|
+
|
|
371
|
+
# Verbose deployment with logging
|
|
372
|
+
- name: Deploy with detailed logs
|
|
373
|
+
run: node ./dist/cli.js push --verbose
|
|
374
|
+
|
|
375
|
+
# Pull before push (sync workflow)
|
|
376
|
+
- name: Sync and deploy
|
|
377
|
+
run: |
|
|
378
|
+
node ./dist/cli.js pull
|
|
379
|
+
node ./dist/cli.js push
|
|
156
380
|
```
|
|
157
381
|
|
|
158
382
|
## AKB Import
|
|
@@ -188,76 +412,194 @@ Each article will be imported with:
|
|
|
188
412
|
|
|
189
413
|
Use `--verbose` flag to see detailed import progress.
|
|
190
414
|
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## Examples
|
|
418
|
+
|
|
419
|
+
### Basic Usage
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
# Single customer workflow
|
|
423
|
+
newo pull # Download all accessible projects
|
|
424
|
+
newo status # See what files are modified
|
|
425
|
+
newo push # Upload changes back to NEWO
|
|
426
|
+
|
|
427
|
+
# Multi-customer workflow
|
|
428
|
+
newo list-customers # See configured customers
|
|
429
|
+
newo pull --customer=ACME # Pull from specific customer
|
|
430
|
+
newo push --customer=BETA # Push to specific customer
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### Working with Projects
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
# Pull specific project
|
|
437
|
+
newo pull --project=b78188ba-0df0-46a8-8713-f0d7cff0a06e
|
|
438
|
+
|
|
439
|
+
# Get project metadata
|
|
440
|
+
newo meta --project=b78188ba-0df0-46a8-8713-f0d7cff0a06e
|
|
441
|
+
|
|
442
|
+
# Verbose operations for debugging
|
|
443
|
+
newo pull --verbose
|
|
444
|
+
newo push --verbose --customer=ACME
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Knowledge Base Import
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
# Import AKB articles from structured text file
|
|
451
|
+
newo import-akb articles.txt da4550db-2b95-4500-91ff-fb4b60fe7be9
|
|
452
|
+
|
|
453
|
+
# With verbose output
|
|
454
|
+
newo import-akb articles.txt persona_id --verbose
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
191
459
|
## Development
|
|
192
460
|
|
|
193
|
-
|
|
461
|
+
### Prerequisites
|
|
462
|
+
- **Node.js 18+** - For runtime environment
|
|
463
|
+
- **TypeScript 5.6+** - For type safety and compilation
|
|
464
|
+
- **Git** - For version control and CI/CD integration
|
|
465
|
+
|
|
466
|
+
### Development Setup
|
|
194
467
|
|
|
195
|
-
### Development Commands
|
|
196
468
|
```bash
|
|
197
|
-
#
|
|
198
|
-
|
|
469
|
+
# Clone repository
|
|
470
|
+
git clone https://github.com/sabbah13/newo-cli.git
|
|
471
|
+
cd newo-cli
|
|
199
472
|
|
|
200
|
-
#
|
|
201
|
-
npm
|
|
473
|
+
# Install dependencies
|
|
474
|
+
npm install
|
|
202
475
|
|
|
203
|
-
#
|
|
204
|
-
npm run
|
|
205
|
-
npm run pull # Build and run pull command
|
|
206
|
-
npm run push # Build and run push command
|
|
207
|
-
npm run status # Build and run status command
|
|
476
|
+
# Build TypeScript
|
|
477
|
+
npm run build
|
|
208
478
|
|
|
209
|
-
#
|
|
210
|
-
npm run
|
|
479
|
+
# Run development commands
|
|
480
|
+
npm run dev pull # Build and run pull
|
|
481
|
+
npm run dev push # Build and run push
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### Development Commands
|
|
211
485
|
|
|
212
|
-
|
|
213
|
-
|
|
486
|
+
| Command | Description |
|
|
487
|
+
|---------|-------------|
|
|
488
|
+
| `npm run build` | Compile TypeScript to JavaScript |
|
|
489
|
+
| `npm run build:watch` | Watch mode compilation |
|
|
490
|
+
| `npm run typecheck` | Type checking without emission |
|
|
491
|
+
| `npm run dev <cmd>` | Build and run CLI command |
|
|
492
|
+
| `npm test` | Run full test suite |
|
|
493
|
+
| `npm run test:unit` | Run unit tests only |
|
|
494
|
+
| `npm run test:coverage` | Generate coverage report |
|
|
214
495
|
|
|
215
|
-
|
|
216
|
-
npm run test:coverage
|
|
496
|
+
### Project Architecture
|
|
217
497
|
|
|
218
|
-
# Run specific test suites
|
|
219
|
-
npm run test:unit # Core module tests (api, sync, auth, hash, fsutil, akb)
|
|
220
|
-
npm run test:integration # End-to-end integration tests
|
|
221
498
|
```
|
|
499
|
+
src/
|
|
500
|
+
├── cli.ts # Main CLI entry point
|
|
501
|
+
├── api.ts # NEWO API client
|
|
502
|
+
├── auth.ts # Authentication management
|
|
503
|
+
├── customer.ts # Multi-customer configuration
|
|
504
|
+
├── customerAsync.ts # Async customer operations
|
|
505
|
+
├── sync.ts # Project synchronization
|
|
506
|
+
├── akb.ts # Knowledge base import
|
|
507
|
+
├── types.ts # TypeScript definitions
|
|
508
|
+
└── fsutil.ts # File system utilities
|
|
509
|
+
|
|
510
|
+
test/
|
|
511
|
+
├── auth.test.js # Authentication tests
|
|
512
|
+
├── customer.test.js # Multi-customer tests
|
|
513
|
+
├── sync.test.js # Sync operation tests
|
|
514
|
+
├── api.test.js # API client tests
|
|
515
|
+
└── integration.test.js # End-to-end tests
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### Testing
|
|
519
|
+
|
|
520
|
+
NEWO CLI includes comprehensive test coverage:
|
|
222
521
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
- **
|
|
226
|
-
- **
|
|
227
|
-
- **
|
|
228
|
-
- **AKB Import Tests** (`test/akb.test.js`): Article parsing, Unicode handling, import workflows
|
|
229
|
-
- **API Tests** (`test/api.test.js`): HTTP client functionality, NEWO API integration
|
|
230
|
-
- **Sync Tests** (`test/sync.test.js`): Pull/push operations, project synchronization
|
|
231
|
-
- **Integration Tests** (`test/integration.test.js`): End-to-end CLI functionality
|
|
232
|
-
|
|
233
|
-
Test infrastructure includes:
|
|
234
|
-
- **MockHttpClient**: HTTP request/response simulation
|
|
235
|
-
- **MockFileSystem**: File system operation mocking
|
|
236
|
-
- **TestEnvironment**: Isolated test environments with automatic cleanup
|
|
237
|
-
- **Coverage Reporting**: HTML and text coverage reports via c8
|
|
238
|
-
|
|
239
|
-
### Project Structure
|
|
240
|
-
- `src/` - TypeScript source files
|
|
241
|
-
- `dist/` - Compiled JavaScript output (generated by `npm run build`)
|
|
242
|
-
- `test/` - Test files
|
|
243
|
-
- `projects/` - Downloaded NEWO projects (generated by pull command)
|
|
244
|
-
- `.newo/` - CLI state directory (tokens, hashes, mappings)
|
|
522
|
+
- **500+ test cases** covering all major functionality
|
|
523
|
+
- **90%+ code coverage** with detailed reporting
|
|
524
|
+
- **Multi-customer scenarios** including auth and sync
|
|
525
|
+
- **Error handling** validation for edge cases
|
|
526
|
+
- **Integration tests** for end-to-end workflows
|
|
245
527
|
|
|
246
528
|
### TypeScript Features
|
|
247
|
-
- Full type safety with strict TypeScript configuration
|
|
248
|
-
- Modern ES2022 target with ESNext modules
|
|
249
|
-
- Comprehensive type definitions for all NEWO API responses
|
|
250
|
-
- Enhanced error handling and validation
|
|
251
|
-
- IntelliSense support in compatible IDEs
|
|
252
529
|
|
|
253
|
-
|
|
530
|
+
- **Strict type checking** with comprehensive interfaces
|
|
531
|
+
- **Modern ES2022** target with ESNext modules
|
|
532
|
+
- **Complete API typing** for all NEWO endpoints
|
|
533
|
+
- **Enhanced IntelliSense** support in IDEs
|
|
534
|
+
- **Automatic compilation** with source maps
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## Contributing
|
|
539
|
+
|
|
540
|
+
We welcome contributions to NEWO CLI! Here's how to get involved:
|
|
541
|
+
|
|
542
|
+
### Reporting Issues
|
|
543
|
+
- **Bug reports**: Use [GitHub Issues](https://github.com/sabbah13/newo-cli/issues)
|
|
544
|
+
- **Feature requests**: Describe your use case and proposed solution
|
|
545
|
+
- **Security issues**: Email security@newo.ai for private disclosure
|
|
546
|
+
|
|
547
|
+
### Development Workflow
|
|
548
|
+
|
|
549
|
+
1. **Fork** the repository
|
|
550
|
+
2. **Create** a feature branch: `git checkout -b feature/amazing-feature`
|
|
551
|
+
3. **Write tests** for new functionality
|
|
552
|
+
4. **Ensure** all tests pass: `npm test`
|
|
553
|
+
5. **Commit** with clear messages: `git commit -m 'feat: add amazing feature'`
|
|
554
|
+
6. **Push** to branch: `git push origin feature/amazing-feature`
|
|
555
|
+
7. **Create** a Pull Request
|
|
556
|
+
|
|
557
|
+
### Code Standards
|
|
558
|
+
- **TypeScript** for all source code
|
|
559
|
+
- **Comprehensive tests** for new features
|
|
560
|
+
- **JSDoc comments** for public APIs
|
|
561
|
+
- **Semantic versioning** for releases
|
|
562
|
+
- **Conventional commits** for clear history
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## API Reference
|
|
567
|
+
|
|
568
|
+
NEWO CLI integrates with these NEWO platform endpoints:
|
|
569
|
+
|
|
570
|
+
### Authentication
|
|
571
|
+
- `POST /api/v1/auth/api-key/token` - Exchange API key for access tokens
|
|
572
|
+
|
|
573
|
+
### Project Management
|
|
254
574
|
- `GET /api/v1/designer/projects` - List all accessible projects
|
|
255
|
-
- `GET /api/v1/designer/projects/by-id/{projectId}` - Get
|
|
575
|
+
- `GET /api/v1/designer/projects/by-id/{projectId}` - Get project metadata
|
|
256
576
|
- `GET /api/v1/bff/agents/list?project_id=...` - List project agents
|
|
577
|
+
|
|
578
|
+
### Skills & Flows
|
|
257
579
|
- `GET /api/v1/designer/flows/{flowId}/skills` - List skills in flow
|
|
258
580
|
- `GET /api/v1/designer/skills/{skillId}` - Get skill content
|
|
259
581
|
- `PUT /api/v1/designer/flows/skills/{skillId}` - Update skill content
|
|
260
|
-
- `GET /api/v1/designer/flows/{flowId}/events` - List flow events
|
|
261
|
-
- `GET /api/v1/designer/flows/{flowId}/states` - List flow states
|
|
262
|
-
|
|
263
|
-
|
|
582
|
+
- `GET /api/v1/designer/flows/{flowId}/events` - List flow events
|
|
583
|
+
- `GET /api/v1/designer/flows/{flowId}/states` - List flow states
|
|
584
|
+
|
|
585
|
+
### Knowledge Base
|
|
586
|
+
- `POST /api/v1/akb/append-manual` - Import AKB articles to persona
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## License
|
|
591
|
+
|
|
592
|
+
**MIT License** - see [LICENSE](LICENSE) file for details.
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
## Support
|
|
597
|
+
|
|
598
|
+
- 📖 **Documentation**: [GitHub Repository](https://github.com/sabbah13/newo-cli)
|
|
599
|
+
- 🐛 **Bug Reports**: [GitHub Issues](https://github.com/sabbah13/newo-cli/issues)
|
|
600
|
+
- 💬 **Discussions**: [GitHub Discussions](https://github.com/sabbah13/newo-cli/discussions)
|
|
601
|
+
- 📧 **Email**: support@newo.ai
|
|
602
|
+
|
|
603
|
+
---
|
|
604
|
+
|
|
605
|
+
**Built with ❤️ by the NEWO team**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newo",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "NEWO CLI: sync
|
|
3
|
+
"version": "1.5.2",
|
|
4
|
+
"description": "NEWO CLI: sync AI Agent skills between NEWO platform and local files. Multi-customer workspaces, Git-first workflows, comprehensive project management.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"newo": "dist/cli.js"
|
|
7
7
|
},
|