onex-cli 1.0.0__tar.gz
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.
- onex_cli-1.0.0/CHANGELOG.md +78 -0
- onex_cli-1.0.0/LICENSE +21 -0
- onex_cli-1.0.0/MANIFEST.in +16 -0
- onex_cli-1.0.0/PKG-INFO +387 -0
- onex_cli-1.0.0/README.md +345 -0
- onex_cli-1.0.0/onex/__init__.py +1 -0
- onex_cli-1.0.0/onex/__main__.py +56 -0
- onex_cli-1.0.0/onex/commands/__init__.py +1 -0
- onex_cli-1.0.0/onex/commands/debug.py +231 -0
- onex_cli-1.0.0/onex/commands/deploy.py +348 -0
- onex_cli-1.0.0/onex/commands/dev.py +86 -0
- onex_cli-1.0.0/onex/commands/env.py +350 -0
- onex_cli-1.0.0/onex/commands/init.py +392 -0
- onex_cli-1.0.0/onex/commands/invoke.py +355 -0
- onex_cli-1.0.0/onex/commands/login.py +373 -0
- onex_cli-1.0.0/onex/commands/logout.py +54 -0
- onex_cli-1.0.0/onex/commands/logs.py +95 -0
- onex_cli-1.0.0/onex/commands/platform.py +255 -0
- onex_cli-1.0.0/onex/commands/provision.py +95 -0
- onex_cli-1.0.0/onex/commands/status.py +134 -0
- onex_cli-1.0.0/onex/commands/trace.py +534 -0
- onex_cli-1.0.0/onex/commands/validate.py +139 -0
- onex_cli-1.0.0/onex/commands/vpn.py +198 -0
- onex_cli-1.0.0/onex/config.py +151 -0
- onex_cli-1.0.0/onex/runtime/__init__.py +7 -0
- onex_cli-1.0.0/onex/runtime/local_runtime.py +677 -0
- onex_cli-1.0.0/onex/schema/__init__.py +35 -0
- onex_cli-1.0.0/onex/schema/service_descriptor.py +1352 -0
- onex_cli-1.0.0/onex/schema/validator.py +357 -0
- onex_cli-1.0.0/onex/utils.py +514 -0
- onex_cli-1.0.0/onex/vpn/__init__.py +35 -0
- onex_cli-1.0.0/onex/vpn/platform_detector.py +268 -0
- onex_cli-1.0.0/onex/vpn/setup_vpn.py +206 -0
- onex_cli-1.0.0/onex/vpn/wireguard_manager.py +468 -0
- onex_cli-1.0.0/onex_cli.egg-info/PKG-INFO +387 -0
- onex_cli-1.0.0/onex_cli.egg-info/SOURCES.txt +40 -0
- onex_cli-1.0.0/onex_cli.egg-info/dependency_links.txt +1 -0
- onex_cli-1.0.0/onex_cli.egg-info/entry_points.txt +2 -0
- onex_cli-1.0.0/onex_cli.egg-info/requires.txt +5 -0
- onex_cli-1.0.0/onex_cli.egg-info/top_level.txt +1 -0
- onex_cli-1.0.0/setup.cfg +4 -0
- onex_cli-1.0.0/setup.py +66 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-02-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **VPN Module**: Complete cross-platform VPN setup support (macOS, Linux, Windows)
|
|
12
|
+
- `onex vpn setup` - Setup VPN from WireGuard config file
|
|
13
|
+
- `onex vpn connect/disconnect` - Manage VPN connections
|
|
14
|
+
- `onex vpn status` - Check VPN connection status
|
|
15
|
+
- Automatic environment detection from VPN IP ranges
|
|
16
|
+
|
|
17
|
+
- **One-Command Setup**: `onex init` command for complete environment setup
|
|
18
|
+
- Automatic VPN setup and connection
|
|
19
|
+
- Platform login with credential download
|
|
20
|
+
- Auto-generated .env file in service repository
|
|
21
|
+
- Connectivity verification
|
|
22
|
+
|
|
23
|
+
- **Environment Management**: Enhanced environment switching and configuration
|
|
24
|
+
- `onex env` - Show active environment
|
|
25
|
+
- `onex env sync` - Regenerate .env file
|
|
26
|
+
- `onex use <env>` - Switch active environment
|
|
27
|
+
- Automatic credential storage in `~/.onex/`
|
|
28
|
+
|
|
29
|
+
- **Debug Mode**: VS Code debugging support with debugpy
|
|
30
|
+
- `onex debug --service <name>` - Start service with debugger
|
|
31
|
+
- Hot-reload for code changes
|
|
32
|
+
- Breakpoint debugging support
|
|
33
|
+
|
|
34
|
+
- **Platform Commands**: Platform management utilities
|
|
35
|
+
- `onex platform health` - Check platform health
|
|
36
|
+
- `onex platform info` - Show platform information
|
|
37
|
+
|
|
38
|
+
- **Service Deployment**: Deploy services to OneXERP platform
|
|
39
|
+
- `onex deploy` - Deploy from service directory
|
|
40
|
+
- `onex validate` - Validate service.yml schema
|
|
41
|
+
- Real-time deployment progress
|
|
42
|
+
|
|
43
|
+
- **Monitoring & Debugging**:
|
|
44
|
+
- `onex trace <trace_id>` - End-to-end request tracing
|
|
45
|
+
- `onex logs <service>` - View service logs
|
|
46
|
+
- `onex status <service>` - Check service status
|
|
47
|
+
|
|
48
|
+
- **Service Management**:
|
|
49
|
+
- `onex invoke <service>:<function>` - Direct function invocation
|
|
50
|
+
- `onex provision <service>` - Provision service resources
|
|
51
|
+
|
|
52
|
+
### Security
|
|
53
|
+
- Removed hardcoded credentials and tokens
|
|
54
|
+
- Added placeholder values with clear instructions
|
|
55
|
+
- Documented all example IPs and URLs as customizable
|
|
56
|
+
- Secure credential storage in `~/.onex/` with proper permissions
|
|
57
|
+
|
|
58
|
+
### Documentation
|
|
59
|
+
- Complete VPN setup guide for developers
|
|
60
|
+
- Updated developer guide with simplified workflow
|
|
61
|
+
- Added troubleshooting sections
|
|
62
|
+
- Documented all CLI commands and options
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
- Installation method from local file to PyPI package
|
|
66
|
+
- Simplified developer onboarding from 5 steps to 2 steps
|
|
67
|
+
- Service repository no longer requires platform repository access
|
|
68
|
+
|
|
69
|
+
## [0.1.0] - 2026-02-12
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- Initial release
|
|
73
|
+
- Basic deployment functionality
|
|
74
|
+
- Service validation
|
|
75
|
+
- Login/logout commands
|
|
76
|
+
|
|
77
|
+
[1.0.0]: https://github.com/onexerp/onex-cli/releases/tag/v1.0.0
|
|
78
|
+
[0.1.0]: https://github.com/onexerp/onex-cli/releases/tag/v0.1.0
|
onex_cli-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OneXERP Platform Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Include important package files
|
|
2
|
+
include README.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include CHANGELOG.md
|
|
5
|
+
|
|
6
|
+
# Include package data
|
|
7
|
+
recursive-include onex *.py
|
|
8
|
+
recursive-include onex *.yml
|
|
9
|
+
recursive-include onex *.yaml
|
|
10
|
+
|
|
11
|
+
# Exclude Python cache and build artifacts
|
|
12
|
+
global-exclude __pycache__
|
|
13
|
+
global-exclude *.py[co]
|
|
14
|
+
global-exclude .DS_Store
|
|
15
|
+
global-exclude *.so
|
|
16
|
+
global-exclude .git*
|
onex_cli-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: onex-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official CLI for deploying and managing services on OneXERP Platform
|
|
5
|
+
Home-page: https://github.com/onexerp/onex-cli
|
|
6
|
+
Author: OneXERP Platform Team
|
|
7
|
+
Author-email: platform@onexerp.com
|
|
8
|
+
Project-URL: Documentation, https://github.com/onexerp/onex-cli#readme
|
|
9
|
+
Project-URL: Bug Reports, https://github.com/onexerp/onex-cli/issues
|
|
10
|
+
Project-URL: Source, https://github.com/onexerp/onex-cli
|
|
11
|
+
Project-URL: Changelog, https://github.com/onexerp/onex-cli/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: onexerp platform cli deployment serverless microservices vpn wireguard
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Environment :: Console
|
|
22
|
+
Requires-Python: >=3.12
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: click>=8.1.7
|
|
26
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
27
|
+
Requires-Dist: requests>=2.31.0
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
29
|
+
Requires-Dist: pydantic>=2.0.0
|
|
30
|
+
Dynamic: author
|
|
31
|
+
Dynamic: author-email
|
|
32
|
+
Dynamic: classifier
|
|
33
|
+
Dynamic: description
|
|
34
|
+
Dynamic: description-content-type
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: keywords
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
Dynamic: project-url
|
|
39
|
+
Dynamic: requires-dist
|
|
40
|
+
Dynamic: requires-python
|
|
41
|
+
Dynamic: summary
|
|
42
|
+
|
|
43
|
+
# OneXERP Platform CLI (`onex`)
|
|
44
|
+
|
|
45
|
+
Official CLI tool for deploying and managing services on the OneXERP Platform.
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
The `onex` CLI provides a unified interface for:
|
|
50
|
+
- Deploying services to different environments (local/dev/staging/prod)
|
|
51
|
+
- Validating service configurations (`service.yml`)
|
|
52
|
+
- Invoking service functions directly
|
|
53
|
+
- Tracing requests through the platform
|
|
54
|
+
- Viewing service logs and status
|
|
55
|
+
- Managing service resources
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
### For Service Developers
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# From onexerp-services repository root:
|
|
63
|
+
pip install -e ../onexerp-platform-NEW/onex-cli
|
|
64
|
+
|
|
65
|
+
# Or add to requirements.txt:
|
|
66
|
+
onex-cli @ file:../onexerp-platform-NEW/onex-cli
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### For Platform Developers
|
|
70
|
+
|
|
71
|
+
The CLI is automatically available when working in the platform repository:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# From onexerp-platform-NEW:
|
|
75
|
+
cd onex-cli
|
|
76
|
+
pip install -e .
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
### Deploy a Service
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Deploy to local environment
|
|
85
|
+
onex deploy
|
|
86
|
+
|
|
87
|
+
# Deploy to specific environment
|
|
88
|
+
onex deploy --env dev
|
|
89
|
+
onex deploy --env staging
|
|
90
|
+
onex deploy --env prod
|
|
91
|
+
|
|
92
|
+
# Deploy from specific directory
|
|
93
|
+
onex deploy --service-dir ./services/product
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Validate Service Configuration
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Validate service.yml without deploying
|
|
100
|
+
onex validate
|
|
101
|
+
|
|
102
|
+
# Validate specific service
|
|
103
|
+
onex validate --service-dir ./services/product
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Invoke Functions
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Sync invoke (returns result immediately)
|
|
110
|
+
onex invoke product:calculateTotal '{"items": [...]}'
|
|
111
|
+
|
|
112
|
+
# Async invoke (fire and forget)
|
|
113
|
+
onex invoke --async product:processLargeFile '{"file_id": "123"}'
|
|
114
|
+
|
|
115
|
+
# Specify environment
|
|
116
|
+
onex invoke --env dev product:calculateTotal '{"items": [...]}'
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Trace Requests
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Trace a request by trace_id
|
|
123
|
+
onex trace 550e8400-e29b-41d4-a716-446655440000
|
|
124
|
+
|
|
125
|
+
# Trace with environment
|
|
126
|
+
onex trace 550e8400-e29b-41d4-a716-446655440000 --env local
|
|
127
|
+
|
|
128
|
+
# Follow trace in real-time
|
|
129
|
+
onex trace 550e8400-e29b-41d4-a716-446655440000 --follow
|
|
130
|
+
|
|
131
|
+
# JSON output
|
|
132
|
+
onex trace 550e8400-e29b-41d4-a716-446655440000 --json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### View Service Status
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Check service health and deployment status
|
|
139
|
+
onex status product
|
|
140
|
+
|
|
141
|
+
# Check all services
|
|
142
|
+
onex status
|
|
143
|
+
|
|
144
|
+
# Specify environment
|
|
145
|
+
onex status product --env dev
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### View Logs
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# View service logs
|
|
152
|
+
onex logs product
|
|
153
|
+
|
|
154
|
+
# Follow logs in real-time
|
|
155
|
+
onex logs product --follow
|
|
156
|
+
|
|
157
|
+
# Last N lines
|
|
158
|
+
onex logs product --lines 100
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Development Mode
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Run service locally with hot-reload
|
|
165
|
+
onex dev
|
|
166
|
+
|
|
167
|
+
# Specify service directory
|
|
168
|
+
onex dev --service-dir ./services/product
|
|
169
|
+
|
|
170
|
+
# Specify port
|
|
171
|
+
onex dev --port 8001
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Initialize Configuration
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Interactive configuration setup
|
|
178
|
+
onex init
|
|
179
|
+
|
|
180
|
+
# Creates ~/.onex/config.yml with platform URLs and API keys
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Provision Resources
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Manually provision MongoDB collections, indexes, etc.
|
|
187
|
+
onex provision
|
|
188
|
+
|
|
189
|
+
# Specify environment
|
|
190
|
+
onex provision --env dev
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Configuration
|
|
194
|
+
|
|
195
|
+
The CLI uses `~/.onex/config.yml` for environment-specific settings:
|
|
196
|
+
|
|
197
|
+
```yaml
|
|
198
|
+
environments:
|
|
199
|
+
local:
|
|
200
|
+
platform_url: http://localhost:8000
|
|
201
|
+
deployment_url: http://localhost:8002
|
|
202
|
+
dev:
|
|
203
|
+
platform_url: https://dev-platform.onexerp.com
|
|
204
|
+
deployment_url: https://dev-platform.onexerp.com:8002
|
|
205
|
+
api_key: ${ONEX_DEV_API_KEY}
|
|
206
|
+
staging:
|
|
207
|
+
platform_url: https://staging-platform.onexerp.com
|
|
208
|
+
deployment_url: https://staging-platform.onexerp.com:8002
|
|
209
|
+
api_key: ${ONEX_STAGING_API_KEY}
|
|
210
|
+
prod:
|
|
211
|
+
platform_url: https://platform.onexerp.com
|
|
212
|
+
deployment_url: https://platform.onexerp.com:8002
|
|
213
|
+
api_key: ${ONEX_PROD_API_KEY}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Service Configuration
|
|
217
|
+
|
|
218
|
+
Services must include a `service.yml` file:
|
|
219
|
+
|
|
220
|
+
```yaml
|
|
221
|
+
name: product
|
|
222
|
+
version: 1.0.0
|
|
223
|
+
description: Product management service
|
|
224
|
+
|
|
225
|
+
deployment:
|
|
226
|
+
mode: shared-runtime
|
|
227
|
+
|
|
228
|
+
functions:
|
|
229
|
+
- name: getProduct
|
|
230
|
+
handler: src.handlers.get_product
|
|
231
|
+
triggers:
|
|
232
|
+
- type: http
|
|
233
|
+
path: /products/{id}
|
|
234
|
+
method: GET
|
|
235
|
+
|
|
236
|
+
- name: calculateTotal
|
|
237
|
+
handler: src.handlers.calculate_total
|
|
238
|
+
triggers: [] # Invoke-only function
|
|
239
|
+
|
|
240
|
+
- name: processFile
|
|
241
|
+
handler: src.handlers.process_file
|
|
242
|
+
triggers:
|
|
243
|
+
- type: s3
|
|
244
|
+
bucket: product-uploads
|
|
245
|
+
events: ["s3:ObjectCreated:*"]
|
|
246
|
+
prefix: images/
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Commands Reference
|
|
250
|
+
|
|
251
|
+
| Command | Description |
|
|
252
|
+
|---------|-------------|
|
|
253
|
+
| `onex init` | Initialize CLI configuration (interactive) |
|
|
254
|
+
| `onex validate` | Validate service.yml schema without deploying |
|
|
255
|
+
| `onex deploy` | Deploy service to platform |
|
|
256
|
+
| `onex dev` | Run service locally with hot-reload |
|
|
257
|
+
| `onex invoke` | Invoke service functions directly |
|
|
258
|
+
| `onex trace` | Track requests through platform with trace_id |
|
|
259
|
+
| `onex logs` | View service logs |
|
|
260
|
+
| `onex status` | Check service status and health |
|
|
261
|
+
| `onex provision` | Manually provision MongoDB resources |
|
|
262
|
+
|
|
263
|
+
## Development
|
|
264
|
+
|
|
265
|
+
### Architecture
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
onex-cli/
|
|
269
|
+
├── setup.py # Package configuration
|
|
270
|
+
├── README.md # This file
|
|
271
|
+
└── onex/
|
|
272
|
+
├── __init__.py
|
|
273
|
+
├── __main__.py # CLI entry point
|
|
274
|
+
├── config.py # Configuration management
|
|
275
|
+
├── utils.py # Shared utilities
|
|
276
|
+
├── commands/ # Command implementations
|
|
277
|
+
│ ├── deploy.py
|
|
278
|
+
│ ├── trace.py
|
|
279
|
+
│ ├── invoke.py
|
|
280
|
+
│ ├── validate.py
|
|
281
|
+
│ ├── logs.py
|
|
282
|
+
│ ├── status.py
|
|
283
|
+
│ ├── dev.py
|
|
284
|
+
│ ├── init.py
|
|
285
|
+
│ └── provision.py
|
|
286
|
+
└── schema/
|
|
287
|
+
├── service_descriptor.py → ../../platform-services/shared/schema/service_descriptor.py
|
|
288
|
+
└── validator.py
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Adding New Commands
|
|
292
|
+
|
|
293
|
+
1. Create command file in `onex/commands/`
|
|
294
|
+
2. Implement using Click decorators
|
|
295
|
+
3. Register in `onex/__main__.py`
|
|
296
|
+
|
|
297
|
+
Example:
|
|
298
|
+
|
|
299
|
+
```python
|
|
300
|
+
# onex/commands/newcommand.py
|
|
301
|
+
import click
|
|
302
|
+
from onex.config import get_config
|
|
303
|
+
from onex.utils import print_success, print_error
|
|
304
|
+
|
|
305
|
+
@click.command()
|
|
306
|
+
@click.option('--env', default='local', help='Environment')
|
|
307
|
+
def newcommand(env):
|
|
308
|
+
"""Description of new command"""
|
|
309
|
+
config = get_config(env)
|
|
310
|
+
# Implementation here
|
|
311
|
+
print_success("Command completed!")
|
|
312
|
+
|
|
313
|
+
# Register in onex/__main__.py
|
|
314
|
+
from onex.commands import newcommand
|
|
315
|
+
cli.add_command(newcommand.newcommand)
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Platform Integration
|
|
319
|
+
|
|
320
|
+
The CLI integrates with these platform services:
|
|
321
|
+
|
|
322
|
+
- **Deployment Controller** (8002) - Service deployment and versioning
|
|
323
|
+
- **Gateway** (8000) - HTTP routing and function invocation
|
|
324
|
+
- **Loki** (3100) - Log aggregation and trace queries
|
|
325
|
+
- **Service Registry** (8500) - Service discovery and health checks
|
|
326
|
+
|
|
327
|
+
## Schema Validation
|
|
328
|
+
|
|
329
|
+
The CLI uses the platform's official schema from:
|
|
330
|
+
```
|
|
331
|
+
platform-services/shared/schema/service_descriptor.py
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
This ensures service configurations are validated against the same schema used by the deployment controller.
|
|
335
|
+
|
|
336
|
+
## Troubleshooting
|
|
337
|
+
|
|
338
|
+
### Command not found: onex
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# Reinstall CLI in editable mode
|
|
342
|
+
pip install -e /path/to/onexerp-platform-NEW/onex-cli
|
|
343
|
+
|
|
344
|
+
# Verify installation
|
|
345
|
+
which onex
|
|
346
|
+
onex --version
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Import errors
|
|
350
|
+
|
|
351
|
+
The CLI imports schema definitions from the platform. Ensure the platform repository is available:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# The symlink should exist:
|
|
355
|
+
ls -la onex-cli/onex/schema/service_descriptor.py
|
|
356
|
+
# → points to ../../platform-services/shared/schema/service_descriptor.py
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Deployment failures
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# Validate service.yml first
|
|
363
|
+
onex validate
|
|
364
|
+
|
|
365
|
+
# Check platform health
|
|
366
|
+
onex status --env local
|
|
367
|
+
|
|
368
|
+
# View deployment logs
|
|
369
|
+
onex logs deployment-controller
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## License
|
|
373
|
+
|
|
374
|
+
MIT License - See platform repository for details.
|
|
375
|
+
|
|
376
|
+
## Support
|
|
377
|
+
|
|
378
|
+
- **Platform Developers**: Update CLI in `onexerp-platform-NEW/onex-cli/`
|
|
379
|
+
- **Service Developers**: Install CLI via `pip install -e ../onexerp-platform-NEW/onex-cli`
|
|
380
|
+
- **Issues**: Report in platform repository
|
|
381
|
+
|
|
382
|
+
## Related Documentation
|
|
383
|
+
|
|
384
|
+
- [Platform Architecture](../docs/platform-developers/TRIGGER_SYSTEM.md)
|
|
385
|
+
- [Service Development Guide](../docs/service-developers/QUICK_START.md)
|
|
386
|
+
- [Deployment Guide](../docs/service-developers/DEPLOYING_SERVICES.md)
|
|
387
|
+
- [Request Tracing](../docs/service-developers/REQUEST_TRACING.md)
|