YGG Command Line Interface
Project description
YGG CLI
Command line interface for the YGG platform.
Installation
cd cli
pip install -e .
Or install directly:
pip install -e /path/to/ygg/cli
Configuration
The CLI requires the YGG_API_KEY environment variable to be set. The API key must have *:*:admin:* permissions.
export YGG_API_KEY="ygg_api_..."
Optionally, set the base URL:
export YGG_BASE_URL="https://api.ygg.com" # Default: http://localhost:9000
Usage
Environment Management
Export environment as .env format:
ygg env <project_id> <env>
Example:
ygg env proj_123 dev
# Outputs:
# DATABASE_URL=postgres://...
# API_KEY=secret123
Import environment from stdin:
cat .env | ygg env <project_id> <env>
Example:
cat .env | ygg env proj_123 prod
Database Schema Export
Export database schema in B3 format:
ygg db <project_id> <env>
Example:
ygg db proj_123 dev
# Outputs B3 schema format (see get_schema_compact.py for format details)
API Endpoints
The CLI expects the following endpoints to be implemented in the Go server:
GET /v1/cli/projects/{project_id}/envs/{env}/export- Export environment as .env format (text/plain)POST /v1/cli/projects/{project_id}/envs/{env}/import- Import environment from .env format (text/plain)GET /v1/cli/projects/{project_id}/db/{env}/schema- Export database schema in B3 format (text/plain)
If these endpoints are not available, the CLI will fall back to:
GET /v1/projects/{project_id}/envs/{env}- Get environment (converted to .env format client-side)PATCH /v1/projects/{project_id}/envs/{env}- Update environment (parsed from .env format client-side)
Requirements
- Python 3.7+
requestslibrary
Notes
- All computations should be done in the Go server. The Python CLI is a thin client that makes HTTP requests.
- The API key must have
*:*:admin:*permissions to work. - The key only works for a specific account.
Project details
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 ygg_cli-0.1.0.tar.gz.
File metadata
- Download URL: ygg_cli-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d89dfd10f79eee17673dbfabd939094f4a5c823ec57555409dda9732a82b7cd
|
|
| MD5 |
b1ba6a92781163378362dbc0623aecb7
|
|
| BLAKE2b-256 |
94cac39d01d662dff355b0492fe6833c44f99d6216e177872fb820ee04c2aa74
|
File details
Details for the file ygg_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ygg_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7479ed09a958618dcf405fd8af743ec414fd589dc1c54b7c954146ee4cf33f76
|
|
| MD5 |
ac2260f64688a9bce7b4e44af22e7b02
|
|
| BLAKE2b-256 |
bb67b62ba263abe7980a74870bc8e16b506e5e2478a4dbf8c503271065978313
|