A template repository for digital service providers to publish their services on the UnitySVC platform.
Use this template to create your own service provider repository with automated validation and publishing workflows.
π Full Documentation | π Getting Started Guide | π CLI Reference
- Click the "Use this template" button at the top of this repository
- Choose a name for your repository (e.g.,
unitysvc-services-yourcompany
) - Clone your new repository locally
pip install unitysvc-services
See the CLI Reference for all available commands.
Replace the example data in the data/
directory with your actual service information:
Required changes:
- Update
data/seller.json
with your seller/marketplace information - Update
data/${provider}/provider.toml
with your company information - Update
data/${provider}/README.md
with your company description - Update
data/${provider}/docs/
with your actual documentation and code examples - Replace example services in
data/${provider}/services/
with your actual services
Recommended naming:
- Provider name: Use your company name (e.g., "acme-corp")
- Service names: Use descriptive names (e.g., "gpt-4-turbo", "claude-3-opus")
- Keep names lowercase with hyphens (e.g., "my-service-name")
See Data Structure Documentation for complete details on file organization and naming rules.
Before committing changes:
# Validate all files
unitysvc_services validate
# Format files to match requirements
unitysvc_services format
data/
βββ seller.json # Seller metadata (ONE per repo)
βββ ${provider_name}/ # Directory name must match provider name
βββ provider.toml # Provider metadata
βββ README.md # Provider documentation
βββ docs/ # Code examples and descriptions
β βββ code-example.py
β βββ code-example.js
β βββ code-example.sh
β βββ description.md
βββ services/ # Service definitions
βββ ${service_name}/ # Directory name must match service name
βββ service.json # Service offering (technical specs)
βββ listing-${seller}.json # Service listing (user-facing info)
Important:
- Directory names must match the
name
fields in their respective files - Only ONE seller file per repository
- Both service offerings and listings go under the same
services/${service_name}/
directory
See Data Structure Documentation for complete details.
This template includes three automated workflows to streamline your development process:
File: .github/workflows/validate-data.yml
Triggers: Every pull request and push to main
Automatically validates all data files to ensure:
- Schema compliance
- File references exist
- Directory name consistency
- Service name uniqueness
- Valid seller references
This prevents invalid data from being merged.
File: .github/workflows/format-check.yml
Triggers: Every pull request and push to main
Checks that all JSON and TOML files are properly formatted:
- JSON files have 2-space indentation
- Keys are sorted alphabetically
- Files end with newlines
- No trailing whitespace
Run unitysvc_services format
locally to auto-fix formatting issues.
File: .github/workflows/publish-data.yml
Triggers: Push to main branch (after PR merge)
Automatically publishes your data to the UnitySVC backend in the correct order:
- Providers
- Sellers
- Service Offerings
- Service Listings
Setup Required: Configure GitHub secrets (see below).
File: .github/workflows/populate-services.yml
Triggers:
- Daily at 2 AM UTC (scheduled)
- Manual trigger via GitHub Actions UI
Automatically updates service data by:
- Running
unitysvc_services populate
to execute provider-specific update scripts - Formatting generated files
- Creating a pull request with changes (if any)
How It Works:
The workflow scans your data/
directory for provider files with a services_populator
section:
# data/my-provider/provider.toml
[services_populator]
command = "populate_services.py"
[provider_access_info]
API_KEY = "your-provider-api-key"
API_ENDPOINT = "https://api.provider.com/v1"
The populate
command will:
- Find all providers with
services_populator
configured - Execute the specified command (e.g.,
populate_services.py
) - Pass environment variables from
provider_access_info
- Generate/update service files automatically
To Use This Workflow:
- Add a
services_populator
section to your provider.toml - Create a populate script that generates service data files
- Configure provider access credentials in
provider_access_info
- The workflow will run daily or can be triggered manually
See Automated Workflow Documentation for details on writing populate scripts.
Example Populate Script:
#!/usr/bin/env python3
"""Populate services from provider API."""
import os
import json
from pathlib import Path
# Get credentials from environment (injected from provider_access_info)
api_key = os.environ.get("API_KEY")
api_endpoint = os.environ.get("API_ENDPOINT")
# Fetch services from provider API
services = fetch_services(api_endpoint, api_key)
# Generate service files
for service in services:
service_dir = Path(f"services/{service['name']}")
service_dir.mkdir(parents=True, exist_ok=True)
# Write service offering
with open(service_dir / "service.json", "w") as f:
json.dump(generate_service_data(service), f, indent=2)
To enable automatic publishing when changes are merged to main
, configure the following GitHub secrets:
- Go to your repository on GitHub
- Click Settings tab
- In the left sidebar, click Secrets and variables β Actions
Click New repository secret and add the following:
- Description: The UnitySVC backend API URL
- Example values:
- Production:
https://api.unitysvc.com/api/v1
- Staging:
https://staging.unitysvc.com/api/v1
- Development:
https://main.devel.unitysvc.com/api/v1
- Production:
- Description: API key for authenticating with the UnitySVC backend
- How to obtain:
- Log in to the UnitySVC platform (username should match the "seller" in service listings)
- Navigate to Settings β API Keys
- Generate a new API key for your organization
- Copy the key (you won't be able to see it again)
After adding the secrets:
- Make a change to a file in the
data/
directory - Create a pull request
- Merge the pull request to
main
- Check the Actions tab to see the publishing workflow run
- Verify that data appears on your UnitySVC backend
# Create new data files
unitysvc_services init provider my-provider
unitysvc_services init seller my-marketplace
unitysvc_services init offering my-service
unitysvc_services init listing my-listing
# Validate data locally
unitysvc_services validate
# Format data files
unitysvc_services format
# List local data
unitysvc_services list providers
unitysvc_services list sellers
unitysvc_services list offerings
unitysvc_services list listings
# Publish manually (optional)
export UNITYSVC_BACKEND_URL="https://api.unitysvc.com/api/v1"
export UNITYSVC_API_KEY="your-api-key"
unitysvc_services publish providers
unitysvc_services publish sellers
unitysvc_services publish offerings
unitysvc_services publish listings
For complete CLI documentation, see CLI Reference.
Install pre-commit hooks to automatically validate and format files before each commit:
pip install pre-commit
pre-commit install
The hooks will automatically format JSON files and validate data on every commit.
- Create a new branch for your changes
- Make your changes to files in the
data/
directory - Run
unitysvc_services validate
to check your changes - Run
unitysvc_services format
to format files - Commit your changes (pre-commit hooks will run automatically)
- Push your branch and create a pull request
- Once approved and merged, data will be automatically published
For detailed information:
- Getting Started - Installation and first steps
- Data Structure - File organization rules
- Workflows - Manual and automated patterns
- CLI Reference - All commands and options
- File Schemas - Schema specifications
- Keep service names consistent: Use the same name across
service.json
,listing-*.json
, and directory names - Test locally first: Always run
unitysvc_services validate
before pushing - Use pre-commit hooks: They catch formatting and validation errors early
- Document your services: Good documentation helps users understand and adopt your services
- Publishing order matters: Always publish in order: providers β sellers β offerings β listings
For issues or questions:
- UnitySVC Services SDK: https://github.com/unitysvc/unitysvc-services
- Documentation: https://unitysvc-services.readthedocs.io
- Issues: Open an issue in this repository
This template is provided under the MIT License. Service data you add is subject to your own licensing terms.