Platforms Module

June 24, 2025 ยท View on GitHub

Overview

This module handles the discovery, management, and installation of platform adapters.

Adding Adapters from GitHub

You can add adapters directly from a GitHub repository using the CLI.

Steps:

  1. Run the following command from the project root:
python3 -m platforms.cli add <GITHUB_URL>

Replace <GITHUB_URL> with the URL of the GitHub repository containing the adapter.

Example:

python3 -m platforms.cli add https://github.com/example/adapter-repo.git

This will clone the repository, register the adapter, and make it available for use.

Removing Adapters

You can remove an adapter by its name using the CLI.

Steps:

  1. Run the following command from the project root:
python3 -m platforms.cli remove <ADAPTER_NAME>

Replace <ADAPTER_NAME> with the name of the adapter you want to remove.

Example:

python3 -m platforms.cli remove example-adapter

This will unregister the adapter and remove it from the system.

Updating Adapters

You can update adapters by pulling the latest changes from their Git repositories using the CLI.

Steps:

  1. Run the following command from the project root:
python3 -m platforms.cli update [ADAPTER_NAME] [--install]
  • Replace [ADAPTER_NAME] with the name of the adapter you want to update. If omitted, all adapters will be updated.
  • Use the --install flag to reinstall dependencies after updating.

Examples:

Update a specific adapter:

python3 -m platforms.cli update example-adapter

Update all adapters and reinstall dependencies:

python3 -m platforms.cli update --install

This will pull the latest changes for the specified adapter(s) and optionally reinstall dependencies.

Developing New Adapters

You can develop new adapters by cloning the template repository and following its instructions.

Steps:

  1. Clone the template repository:
git clone https://github.com/smswithoutborders/platform-adapter-template.git
  1. Navigate to the cloned repository:
cd platform-adapter-template
  1. Follow the instructions in the repository's README to implement your custom adapter.

  2. Once your adapter is ready, you can add it to the system using the CLI as described in the Adding Adapters from GitHub section.