Skip to content

Repository files navigation

Babylon

Babylon Logo

License: MIT Cosmotech End-User-Documentation Documentation

Babylon is the official command-line interface for provisioning, configuring, and managing Cosmo Tech solutions and platforms. It provides a unified babylon command that abstracts the Cosmo Tech API, Azure resources, and BI tooling such as Superset and Power BI.

With Babylon, you can scaffold, deploy, configure, and tear down environments through a consistent CLI workflow without maintaining custom scripts or managing each underlying service independently.

Babylon CLI demo

Installation

Babylon requires Python 3.12+. Installing it inside a virtual environment is strongly recommended.

Using uv (recommended)

If you don't have uv installed yet, follow the official instructions.

uv venv
source .venv/bin/activate
uv pip install .

Using pip

python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install .

Development install

Install Babylon in editable mode with the development dependency group (ruff, pytest):

uv pip install -e . --group dev

Verify the installation:

babylon --version

Quick Start

# 1. Point Babylon at a context/tenant so it knows where to store state
babylon namespace use -c my-project -t my-tenant

# 2. Scaffold a new project (cloud provider + BI provider)
babylon init azure superset

# 3. Fill in project/variables.yaml with your environment values, then deploy
babylon apply project/

# 4. Inspect the deployed resources through the API
babylon api organizations get --oid <organization_id>

Usage

Every Babylon invocation follows the same pattern:

babylon [GLOBAL OPTIONS] <COMMAND> [SUBCOMMAND] [ARGS] [OPTIONS]

Global options

Option Description
-v, --verbosity Set the logging verbosity (e.g. DEBUG, INFO, WARNING).
-n, --dry-run Run commands in dry-run mode without applying changes.
--log-path PATH Directory where babylon.log is written (defaults to the current directory).
--kube-context TEXT Use a specific kubeconfig context instead of the current one.
--version Print the installed Babylon version and exit.
--help Show help for any command or subcommand.

Discover any command's options at any time:

babylon --help
babylon apply --help
babylon api organizations --help

CLI Commands

Babylon's commands are organized into two layers: high-level macros that orchestrate common workflows, and a lower-level API command tree for granular control.

Macros

Command Description
babylon init <cloud_provider> <bi_provider> Scaffold a new project structure (YAML manifests, variables file, dashboard folders, Terraform web app module).
babylon apply <deploy_dir> Deploy organizations, solutions, workspaces, and web apps described in <deploy_dir>.
babylon destroy Tear down the resources tracked in the current state (requires confirmation, or -y).
babylon namespace use Switch to (or create) a context/tenant namespace used to isolate project state.
babylon namespace get-contexts Show the currently active context and tenant.
babylon namespace get-all-states List local and remote state files available for the current namespace.

API

The babylon api group exposes the underlying Cosmo Tech API resources directly:

Command Description
babylon api organizations Manage organizations (create, get, update, delete).
babylon api solutions Manage solutions.
babylon api workspaces Manage workspaces.
babylon api datasets Manage datasets.
babylon api runners Manage runners.
babylon api runs Manage scenario runs.
babylon api about Retrieve API version and metadata information.

Dashboards

Command Description
babylon superset delete-assets Delete dashboard assets from a Superset instance.

Run babylon <group> --help to list every subcommand and its options — for example babylon api organizations --help.

Examples

Create and deploy a full project from scratch:

babylon namespace use -c demo -t sandbox
babylon init azure superset
# edit project/variables.yaml with your resource values
babylon apply project/

Deploy only the workspace, skipping the organization and solution:

babylon apply --include workspace project/

Deploy everything except the web app:

babylon apply --exclude webapp project/

Tear down a deployment without the confirmation prompt:

babylon destroy --yes

Get machine-readable output from an API command:

babylon api workspaces get --oid <organization_id> --wid <workspace_id> -o json

Run any command in dry-run mode to preview its effect:

babylon --dry-run apply project/

Configuration

Babylon stores per-project settings in a variables.yaml file (generated by babylon init) and tracks deployment state under a local namespace defined by babylon namespace use -c <context> -t <tenant>.

  • variables.yaml: resource-specific values (organization name, solution version, cloud provider settings, etc.) used to render the YAML manifests during apply.
  • State files: one state file per context/tenant, listed with babylon namespace get-all-states and inspected with babylon namespace get-contexts.
  • Logs: every run is logged to babylon.log in the directory given by --log-path (defaults to the current working directory).

Development

Contributions are welcome! A detailed contribution guide is available in the project documentation.

git clone git@github.com:Cosmo-Tech/Babylon.git
cd Babylon
uv venv
source .venv/bin/activate
uv pip install -e . --group dev

Run the test suite and linter before opening a pull request:

pytest
ruff check .

Release Process

To publish a new release:

  1. Ensure all planned features are merged into main (JIRA board).
  2. Verify that:
  3. Bump the version in Babylon/version.py following SemVer.
  4. Regenerate the lock file: uv lock.
  5. Tag the release: git tag -a -m "5.4.0" 5.4.0.
  6. Push the tag: git push origin tag 5.4.0.
  7. Write and publish release notes on GitHub Releases.

License

Babylon is released under the MIT License.

About

General CLI linking all services used in conjunction of the Cosmotech Platform

Topics

Resources

Stars

4 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages