A command-line interface tool for interacting with the OXS (Simplic) API, providing easy configuration management and HTTP request capabilities.
Build the project and ensure the executable is in your PATH or use it directly from the build output directory.
The OXS CLI follows a hierarchical command structure:
oxs <command> <subcommand> [options]
Where:
<command>is the main command group (e.g.,configure,http)<subcommand>is the specific action within that group (e.g.,env,get)[options]are command-specific parameters and flags
Before using the CLI, you need to set up your environment configuration. This creates a profile/section that stores your API credentials and settings.
oxs configure envThis will prompt you to:
- Select an API environment (staging or prod)
- Enter your account email address
- Enter your account password
- Select an organization from your available organizations
You can also provide all parameters directly:
oxs configure env --api prod --email your.email@example.com --password yourpassword --organization "Your Organization" --section default| Parameter | Short | Description | Default |
|---|---|---|---|
--api |
-a |
API environment to use (prod or staging) |
Interactive prompt |
--email |
-e |
Your account email address | Interactive prompt |
--password |
-p |
Your account password | Interactive prompt |
--organization |
-o |
Organization to use | Interactive selection |
--section |
-s |
Configuration section name | default |
You can create multiple configuration sections for different environments or organizations:
# Create a staging profile
oxs configure env --api staging --section staging
# Create a production profile
oxs configure env --api prod --section production
# Create a profile for a specific organization
oxs configure env --section myorg --organization "My Organization"Once configured, you can make HTTP requests to the OXS API using your stored credentials.
oxs http get --endpoint /organization-api/v1/organization --section default -f -o jsonoxs http <method> [options]
Where <method> can be:
get- HTTP GET requestpost- HTTP POST requestput- HTTP PUT requestpatch- HTTP PATCH requestdelete- HTTP DELETE request
| Parameter | Short | Description | Default | Required |
|---|---|---|---|---|
--endpoint |
-e |
API endpoint to call | - | Yes |
--section |
-s |
Configuration section to use | default |
No |
--body |
-b |
Request body content or file ($filename for file) |
- | No |
--headers |
-H |
Additional headers (Key:Value;Key2:Value2) |
- | No |
--format-only |
-f |
Return only response content, no headers/status | false |
No |
--output-format |
-o |
Output format (json, xml, text) |
json |
No |
Simple GET request:
oxs http get --endpoint /organization-api/v1/organizationGET request with specific section:
oxs http get --endpoint /organization-api/v1/organization --section productionGET request with clean JSON output:
oxs http get --endpoint /organization-api/v1/organization --section default -f -o jsonPOST request with inline body:
oxs http post --endpoint /api/v1/users --body '{"name":"John Doe","email":"john@example.com"}'POST request with file body:
oxs http post --endpoint /api/v1/users --body $user.jsonRequest with custom headers:
oxs http get --endpoint /api/v1/data --headers "X-Custom-Header:value;Accept:application/xml"Request with different output formats:
# JSON output (default)
oxs http get --endpoint /api/v1/data -o json
# XML output
oxs http get --endpoint /api/v1/data -o xml
# Plain text output
oxs http get --endpoint /api/v1/data -o textThe CLI supports multiple configuration sections, allowing you to manage different environments, organizations, or accounts:
- Each section stores API endpoint, credentials, organization details, and authentication tokens
- The default section is named
default - You can specify which section to use with the
--sectionparameter
Configuration files are stored in the .oxs folder in your user directory, with separate files for:
- General configuration (API endpoints, organization info)
- Secure credentials (authentication tokens)
# Use default configuration
oxs http get --endpoint /api/endpoint
# Use staging configuration
oxs http get --endpoint /api/endpoint --section staging
# Use production configuration
oxs http get --endpoint /api/endpoint --section production-
Configure your environment:
oxs configure env --section default
-
Test the connection:
oxs http get --endpoint /organization-api/v1/organization -f
-
Create additional profiles if needed:
oxs configure env --section staging --api staging
-
List organizations:
oxs http get --endpoint /organization-api/v1/organization -f -o json
-
Make API calls with clean output:
oxs http get --endpoint /your-endpoint --section default -f -o json
-
Switch between environments:
# Use staging oxs http get --endpoint /api/endpoint --section staging # Use production oxs http get --endpoint /api/endpoint --section production
- Invalid credentials: Re-run the configure command to update your credentials
- Section not found: Make sure you've created the configuration section first
- API endpoint errors: Verify the endpoint URL and your organization permissions
To update an existing configuration section, simply run the configure command again:
oxs configure env --section mysectionThis will overwrite the existing configuration for that section.
- Production:
https://oxs.simplic.io/ - Staging:
https://dev-oxs.simplic.io/
Choose the appropriate environment based on your needs. Production should be used for live data, while staging is suitable for testing and development.