Official CLI for deploying and managing services on OneXEOS Platform (Windows, macOS, Linux)
Project description
OneXEOS Platform CLI (onex)
Official CLI for deploying and managing services on the OneXEOS Platform
๐ Table of Contents
- Overview
- Installation
- Quick Start
- Commands
- VPN Setup
- Environment Management
- Configuration
- Development
- For Platform Developers
- Windows Support
- Troubleshooting
๐ Detailed Guides:
- Complete Setup Guide - Step-by-step for macOS/Linux/Windows
- Windows Compatibility Guide - Windows-specific details
- MCP Service Developer Guide - AI debugging with Claude Code
Overview
The onex CLI provides a unified interface for:
- ๐ One-command setup: VPN + login + .env generation (
onex init) - ๐ VPN management: Cross-platform WireGuard VPN setup (Mac, Linux, Windows)
- ๐ฆ Service deployment: Deploy to local/dev/staging/prod environments
- ๐ Visual debugging: VS Code debugging with breakpoints (
onex debug) - ๐ Request tracing: End-to-end request debugging with trace_id
- ๐ Monitoring: View logs, status, and health checks
- โก Hot reload: Auto-reload on code changes during development
- ๐ง Resource management: Provision MongoDB, Redis, Elasticsearch resources
Installation
For Service Developers (PyPI)
# Install from PyPI (recommended)
pip install onex-cli
# Or add to requirements.txt
onex-cli>=1.0.0
# Verify installation
onex --version
That's it! No platform repository access needed.
For Platform Developers
# Install from source (development)
cd onexeos-platform-NEW/onex-cli
pip install -e .
Quick Start
First-Time Setup (3 Steps)
# Step 1: Install CLI
pip install onex-cli
# Step 2: Initialize environment (VPN + login + .env)
onex init
# Step 3: Create your first service (NEW in v1.4.0!)
onex create
What onex init does:
- โ Sets up VPN from config file (if you have one)
- โ Auto-extracts credentials from VPN config (NEW in v1.1.0!)
- โ Logs into platform (no manual password entry!)
- โ Downloads credentials (MongoDB, Redis, JWT secrets)
- โ
Auto-generates
.envfile - โ Verifies connectivity
- โ Configures MCP for Claude Code (optional - NEW in v1.3.3!)
What onex create does (NEW in v1.4.0!):
- โ Interactive wizard to select template (REST API, Event-Driven, CRUD, Minimal)
- โ Generates complete service structure from template
- โ Validates service.yml automatically
- โ Shows next steps to deploy
You're ready to develop! ๐
NEW in v1.1.0: No more manual password entry! If your VPN config contains embedded credentials,
onex initwill automatically extract and use them for login.
NEW in v1.3.3: MCP (Model Context Protocol) integration allows Claude Code to debug your platform with natural language: "Is my platform healthy?", "Debug trace_id: abc123", "Show email-service logs"
Platform-Specific Setup Guides
Choose your operating system for detailed step-by-step instructions:
๐ Complete Setup Guide โ Comprehensive guide for all platforms
Quick links by platform:
- ๐ macOS Setup - Homebrew + wg-quick
- ๐ง Linux Setup - systemd + auto-install
- ๐ช Windows Setup - WireGuard GUI
Key differences:
- macOS/Linux: VPN managed via command-line (
wg-quick,systemctl) - Windows: VPN managed via WireGuard GUI application
All other commands are identical across platforms.
Deploy Your First Service
cd services/demo
onex deploy
Debug Locally with VS Code
# Start service with debugger
onex debug --service demo
# Output:
# ๐ VS Code debugging enabled on port 5678
# Press F5 in VS Code to attach debugger
#
# ๐ฆ Loading service: demo
# โ
Loaded demo: 7 routes
# ๐ก Access at: http://localhost:8001/docs
# Press F5 in VS Code โ Set breakpoints โ Make request
Commands
Core Commands
onex init # Setup VPN + login + .env (one command!)
onex create # Create new service from template (NEW v1.4.0!)
onex deploy # Deploy service to platform
onex debug --service <name> # Debug service locally (VS Code ready)
onex trace <trace_id> # Trace request through platform
onex logs <service> --follow # Stream service logs
onex status <service> # Check service health
All Commands
| Command | Description |
|---|---|
| Setup & Auth | |
onex init |
Initialize environment (VPN + login + .env) |
onex login |
Login to platform and download credentials |
onex logout |
Logout and remove stored credentials |
| Environment Switching (NEW v1.2.0) | |
onex switch <env> |
Switch environment (handles VPN + config) |
| VPN Management | |
onex vpn setup <file> |
Setup VPN from WireGuard config file |
onex vpn status |
Show VPN connection status |
onex vpn list |
List all configured VPNs |
| Environment Info | |
onex env |
Show active environment |
onex env list |
List all configured environments |
onex env show <env> |
Show environment details |
onex env sync |
Regenerate .env file |
| Service Scaffolding (NEW v1.4.0) | |
onex create |
Create new service from template (interactive) |
onex create -n <name> -t <template> |
Create service with specific template |
| Development | |
onex debug --service <name> |
Debug service locally (VS Code + hot reload) |
onex dev |
Run service locally with hot-reload (deprecated, use debug) |
| Deployment | |
onex deploy |
Deploy service to active environment |
onex validate |
Validate service.yml schema |
onex provision |
Manually provision MongoDB resources |
| Monitoring | |
onex logs <service> |
View service logs |
onex status <service> |
Check service status |
onex trace <trace_id> |
Debug request flow end-to-end |
| Invocation | |
onex invoke <service>:<fn> |
Invoke function directly |
| Platform | |
onex platform check |
Check platform health |
VPN Setup
NEW in v1.0.0: Built-in VPN management for dev/staging/prod access.
Automatic Setup (Recommended)
# One command does everything
onex init
# Prompts:
# - Do you have a VPN config file? [Y/n]: y
# - VPN config file path: ~/Downloads/alice-dev.conf
#
# Then automatically:
# โ
Installs WireGuard (if needed)
# โ
Imports config
# โ
Connects to VPN
# โ
Verifies connectivity
# โ
Logs into platform
# โ
Generates .env file
Manual VPN Management
# Setup VPN from config file
onex vpn setup ~/Downloads/alice-dev.conf
# Switch to dev environment (connects VPN + sets active)
onex switch dev
# Check VPN status
onex vpn status
# Switch to local (disconnects VPN)
onex switch local
Platform-Specific Instructions
macOS:
- Uses Homebrew + wg-quick
- Requires sudo for VPN operations
Linux:
- Auto-installs WireGuard (Ubuntu/Debian/CentOS/RHEL)
- Uses systemd for VPN management
Windows:
- GUI app recommended: https://www.wireguard.com/install/
- Or use manual import in WireGuard app
See service repository's docs/platform/VPN_SETUP_DEVELOPER.md for detailed guide.
Environment Management
Active Environment Concept
The active environment determines where commands deploy to:
# Show active environment
onex env
# โ
Active environment: local
# Switch to dev (connects VPN + sets active)
onex switch dev
# โ
Switched to: dev
# Now all commands use dev
onex deploy # Deploys to dev
onex logs # Shows dev logs
Available Environments
| Environment | Platform URL | VPN Required | Access |
|---|---|---|---|
local |
http://localhost:8000 | No | Full (contact platform team for setup) |
dev |
http://10.0.0.1:8000 | Yes | Deploy + Read |
staging |
http://10.0.1.1:8000 | Yes | Read only |
prod |
http://10.0.2.1:8000 | Yes | Read only |
Note: IP addresses are examples and can be customized for your deployment.
Login to Environment
# Login to local (no VPN needed)
onex login --env local
# Switch to dev (connects VPN + logs in if credentials embedded)
onex switch dev
# โ
Connects to VPN
# โ
Sets dev as active environment
# Or use onex init for complete setup
onex init --config-file ~/Downloads/alice-dev.conf
Platform Architecture
Access Methods
The OneXEOS platform provides three access methods:
1. Public Access (via Domain + SSL)
- Dev:
https://dev.onexeos.comโ Traefik โ Gateway โ Services - Staging:
https://staging.onexeos.comโ Traefik โ Gateway โ Services - Production:
https://onexeos.comโ Traefik โ Multi-Replica Gateway โ Services
2. VPN Access (Direct to Gateway)
- Dev:
http://10.0.0.1:8000(via VPN) - Staging:
http://10.0.1.1:8000(via VPN) - Production:
http://10.0.2.1:8000(via VPN)
3. Initial Login (Public Auth Service)
- All Environments:
http://103.17.141.76:8100(no VPN required) - Used during
onex initfor first-time authentication
Developer Workflow
# Step 1: Receive VPN config from DevOps
# Contains: Embedded credentials + Public auth URL + VPN config
# Step 2: Initialize environment
onex init --config-file alice-dev.conf
# โ
Parses VPN config
# โ
Authenticates via public auth (103.17.141.76:8100) - no VPN needed!
# โ
Prompts to connect VPN
# โ
Downloads credentials from gateway (10.0.0.1:8000) - requires VPN
# โ
Saves environment config
# Step 3: Deploy your service
onex deploy
# Uses VPN gateway (10.0.0.1:8000) for deployment
# Step 4: Access via domain (public) OR VPN (direct)
# Public: https://dev.onexeos.com/api/your-service/...
# Direct: http://10.0.0.1:8000/api/your-service/...
URL Reference
| Environment | Public (SSL) | VPN Gateway | Auth (Public) |
|---|---|---|---|
| Dev | https://dev.onexeos.com | http://10.0.0.1:8000 | http://103.17.141.76:8100 |
| Staging | https://staging.onexeos.com | http://10.0.1.1:8000 | http://103.17.141.76:8100 |
| Production | https://onexeos.com | http://10.0.2.1:8000 | http://103.17.141.76:8100 |
Configuration
Credential Storage
Credentials stored securely in ~/.onex/:
~/.onex/
โโโ environments.json # Environment credentials (MongoDB, Redis, JWT, etc.)
โโโ active-env # Currently active environment
Security:
- Never commit
.envfiles - Never share
~/.onex/directory - Files automatically created with restrictive permissions (600)
Auto-Generated .env File
When you run onex login or onex init, a .env file is automatically created in your service repository:
# MongoDB
MONGODB_URI=mongodb://user:pass@host:27017/db?authSource=admin
MONGODB_DATABASE=onexeos
# Redis
REDIS_URI=redis://:password@host:6379/0
# JWT
JWT_SECRET=<auto-downloaded-secret>
JWT_ALGORITHM=HS256
# Platform
PLATFORM_URL=http://10.0.0.1:8000
# Development
DEBUG=true
ENV=dev
Development
Debug Workflow
# Navigate to service directory
cd services/product
# Start debugging (VS Code ready!)
onex debug --service product
# Output:
# ๐ VS Code debugging enabled on port 5678
# Press F5 in VS Code to attach debugger
#
# ๐ฆ Loading service: product
# โ
POST /products โ src.handlers.create_product
# โ
GET /products/{id} โ src.handlers.get_product
#
# โ
Loaded product: 5 routes
# ๐ก Access at: http://localhost:8001/docs
# In VS Code:
# 1. Set breakpoints (click left margin)
# 2. Press F5 โ Select "Attach to Runtime"
# 3. Make request: curl http://localhost:8001/products/123
# 4. VS Code pauses at your breakpoints!
Features:
- โ Hot reload on code changes
- โ VS Code breakpoint debugging
- โ Interactive API docs at /docs
- โ Auto-registers routes with platform gateway
Request Tracing
Every request gets a unique trace_id:
# 1. Make request
curl -D /tmp/headers.txt http://localhost:8001/products/123
# 2. Extract trace_id from response header
grep x-trace-id /tmp/headers.txt
# x-trace-id: 550e8400-e29b-41d4-a716-446655440000
# 3. View complete request timeline
onex trace 550e8400-e29b-41d4-a716-446655440000
# Output shows Gateway โ Runtime โ Service flow:
# ๐ Querying trace: 550e8400-e29b-41d4-a716-446655440000
#
# โ
Found 12 log entries
# โฑ๏ธ Total Duration: 456ms
#
# ๐ฆ GATEWAY
# 14:23:45.123 INFO POST /products/123
# 14:23:45.145 INFO Forwarding to product service
#
# ๐ฆ RUNTIME
# 14:23:45.156 INFO Executing product:get_product
#
# ๐ฆ SERVICE
# 14:23:45.267 INFO Product found: 123
# 14:23:45.456 INFO POST /products/123 200 456ms
For Platform Developers
This CLI is maintained by the platform team.
Development Setup
cd onexeos-platform-NEW/onex-cli
pip install -e .
# Make changes to CLI
vim onex/commands/mycommand.py
# Test immediately (editable mode)
onex mycommand
Publishing to PyPI
See PUBLISHING.md for complete guide.
Quick reference:
# 1. Update version and changelog
vim setup.py CHANGELOG.md
# 2. Run verification script
./verify-package.sh
# 3. Build and test on TestPyPI
rm -rf dist/
python -m build
twine upload --repository testpypi dist/*
# 4. Test installation
pip install --index-url https://test.pypi.org/simple/ onex-cli
# 5. Publish to production PyPI
twine upload dist/*
# 6. Tag release
git tag -a v1.0.1 -m "Release 1.0.1"
git push origin v1.0.1
Adding New Commands
- Create command file in
onex/commands/:
# onex/commands/mycommand.py
import click
from onex.utils import print_success, print_error
@click.command()
@click.option('--env', default='local', help='Environment')
def mycommand(env):
"""Description of new command"""
print_success("Command completed!")
- Register in
onex/__main__.py:
from onex.commands import mycommand
cli.add_command(mycommand.mycommand)
- Test:
onex mycommand --help
Directory Structure
onex-cli/
โโโ setup.py # PyPI package configuration
โโโ MANIFEST.in # Package files to include
โโโ LICENSE # MIT License
โโโ CHANGELOG.md # Version history
โโโ PUBLISHING.md # Publishing guide
โโโ README.md # This file
โโโ onex/
โโโ __init__.py
โโโ __main__.py # CLI entry point
โโโ config.py # Configuration management
โโโ utils.py # Shared utilities
โโโ commands/ # Command implementations
โ โโโ debug.py # Debug service locally
โ โโโ deploy.py # Deploy to platform
โ โโโ dev.py # Development mode (deprecated)
โ โโโ env.py # Environment management
โ โโโ init.py # VPN + login + .env setup
โ โโโ invoke.py # Function invocation
โ โโโ login.py # Platform authentication
โ โโโ logout.py # Logout
โ โโโ logs.py # View service logs
โ โโโ platform.py # Platform management
โ โโโ provision.py # Resource provisioning
โ โโโ status.py # Service health
โ โโโ trace.py # Request tracing
โ โโโ validate.py # Schema validation
โ โโโ vpn.py # VPN management (NEW)
โโโ runtime/
โ โโโ local_runtime.py # Local service runtime
โโโ schema/
โ โโโ service_descriptor.py # Service schema
โโโ vpn/ # VPN module (NEW)
โโโ __init__.py
โโโ platform_detector.py # OS/environment detection
โโโ setup_vpn.py # VPN orchestration
โโโ wireguard_manager.py # WireGuard operations
Windows Support
Full Windows compatibility! The OneX CLI works perfectly on Windows 10/11 with PowerShell and Command Prompt.
Quick Start on Windows
# Install CLI
pip install onex-cli
# Verify installation
onex --version
# Setup MCP for Claude Code (optional)
onex mcp setup
Key Differences on Windows
| Feature | Windows | macOS/Linux |
|---|---|---|
| CLI Commands | โ Identical | โ Identical |
| MCP Setup | โ
onex mcp setup |
โ
onex mcp setup |
| VPN Setup | โ ๏ธ WireGuard GUI | โ
wg-quick CLI |
| Path Handling | โ Automatic | โ Automatic |
VPN on Windows: Use the WireGuard GUI application instead of command-line tools. Import your .conf file and activate the tunnel manually.
For complete Windows guide: See WINDOWS_COMPATIBILITY.md
Troubleshooting
Command not found: onex
# Reinstall from PyPI
pip install --upgrade onex-cli
# Verify installation
which onex
onex --version
Platform connection failed
# Check VPN connection
onex vpn status
# Reconnect if needed
onex switch dev
# Verify platform health
onex platform check
VPN setup failed
macOS:
# Install WireGuard via Homebrew
brew install wireguard-tools
# Try setup again
onex vpn setup ~/Downloads/alice-dev.conf
Linux:
# Ubuntu/Debian
sudo apt update
sudo apt install wireguard wireguard-tools
# CentOS/RHEL
sudo yum install epel-release
sudo yum install wireguard-tools
# Try setup again
onex vpn setup ~/Downloads/alice-dev.conf
Windows: Download WireGuard GUI: https://www.wireguard.com/install/
"Module not found" errors
# Reinstall dependencies
pip install --upgrade onex-cli
# Or reinstall everything
pip install -r requirements.txt --upgrade
Deployment failed
# Validate service.yml first
onex validate
# Check platform health
onex platform check
# View detailed logs
onex logs deployment-controller --follow
Version History
See CHANGELOG.md for detailed version history.
Current Version: 1.0.1
- โ VPN module (cross-platform support)
- โ
One-command setup (
onex init) - โ VS Code debugging with debugpy
- โ Auto-generated .env files
- โ Published to PyPI
- โ Comprehensive documentation
Support
For Service Developers
- Installation:
pip install onex-cli - Documentation: This README + service repo docs
- Issues: Contact platform team
For Platform Developers
- Development: Install from source (
pip install -e .) - Publishing: See PUBLISHING.md
- Issues: GitHub issues in platform repository
Related Documentation
Service Developers:
Platform Developers:
License
MIT License - See LICENSE file.
Links
- PyPI: https://pypi.org/project/onex-cli/
- GitHub: https://github.com/onexeos/onex-cli
- Issues: https://github.com/onexeos/onex-cli/issues
Maintained by: OneXEOS Platform Team Used by: Service Developers (no platform repo access needed!) Version: 1.0.1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onex_cli-1.7.4.tar.gz.
File metadata
- Download URL: onex_cli-1.7.4.tar.gz
- Upload date:
- Size: 129.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c52c7d98ca6236ea521fd42be752dc0fcafa803e20bb79785013d0dae034e925
|
|
| MD5 |
a6d13f54bd0c0972d961df01e430bcc9
|
|
| BLAKE2b-256 |
059226c241619757da73f1bef20d22038033530bcff60479ba2b1584956c1dd4
|
File details
Details for the file onex_cli-1.7.4-py3-none-any.whl.
File metadata
- Download URL: onex_cli-1.7.4-py3-none-any.whl
- Upload date:
- Size: 136.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f34a048ea1df2fb7f2019894560fb93b77eb612825898c0856bf1e85b6fc167
|
|
| MD5 |
2d56fa27e18fb551ccb3d70e3cb0942b
|
|
| BLAKE2b-256 |
e43010254f1931111e0c221938a7f2e072e62e40364069a7692bdd54da5f9f86
|