Today, we're excited to announce that The Ops Platform SDK is now available for a wider range of programming languages, bringing a rich user experience to automations written in Python, Go, and shell scripts (e.g., Bash)!

Combined with our existing support for Node.js (JavaScript and TypeScript), we now offer a wide variety of options for developing workflow automation Ops (including Slack Ops) as code.

Improving our SDK language support serves one of the fundamental principles of The Ops Platform: meeting developers where they are so that they can automate their DevOps with the tools and languages they're familiar with.

The Ops SDK for Python

The first new language for our platform is Python (version 3.6+). As a longtime favourite of system administrators the world over, it was a natural choice for our initial expansion in language support. Python is also consistently rated as one of the most in-demand languages.

#!/usr/bin/env python3

import ctoai

ctoai.ux.print("Welcome to The Ops Platform with Python")

name = ctoai.prompt.input(
  name="name",
  message="What is your name?",
  default="Interested User"
)

ctoai.ux.print(f"Glad to meet you, {name}!")

Find our Python SDK documentation at https://cto.ai/docs/sdks/python and the open-source code at https://github.com/cto-ai/sdk-python.

The Ops SDK for Go

The next SDK language we're releasing today is Go (a.k.a. Golang). In recent years, projects such as Docker and Kubernetes have made it many DevOps engineers' preferred programming language. We love Go here at CTO.ai and use it to develop much of the backend that makes The Ops Platform work. We’re happy to now offer Go as an option for our users as well.

package main

import (
	"fmt"
	"github.com/cto-ai/sdk-go"
)

func main() {
	client := ctoai.NewClient()

	client.Ux.Print("Welcome to The Ops Platform with Go")
    name := client.Prompt.Input(
    	"name",
        "What is your name?",
        ctoai.OptInputDefault("Interested User"),
    )
    client.Ux.Print(fmt.Sprintf("Glad to meet you, %s!", name)
}

Find our Go SDK documentation at https://cto.ai/docs/sdks/go and the code at https://github.com/cto-ai/sdk-go.

The Ops Shell Client

In addition to the Python and Go SDKs, we're also releasing a shell client to access the same platform functions. This single program allows all of our interactions to be accessible from both shell scripts (such as Bash) and the shell-command functionality of unsupported languages.

#!/bin/bash

ctoai print Welcome to The Ops Platform in the shell

name=`ctoai prompt input -n name -m "What is your name?" --default="Interested User"`

ctoai print "Glad to meet you, $name!"

Documentation for the shell client can be found at https://cto.ai/docs/sdks/bash.

Multilanguage Ops Templates

Alongside the new SDKs and client, we have released a new version of The Ops CLI, with support for creating Ops in all of the supported languages. When you run ops init with the new CLI, it will ask you to select the language of your choice and then it will create a skeleton project for you in that language.

Summary

The Ops Platform SDK is now available in multiple programming languages: Node.js (inc. JavaScript and TypeScript), Python, Go, and shell scripts (e.g., Bash). This allows our users to choose the language that will make them most productive. We’re excited to offer this range of options and we’re looking forward to finding out what our community of developers will create.

In The Ops Platform registry, you’ll find open source Ops written in the various languages we support. Here are some examples:

Node.js:

Python:

  • Repo : Manage a user's repos on Bitbucket, Gitlab, or Github allowing users to archive, create, delete, and list their repos.
  • Static Site : An interactive Op that deploys a static site to a public S3 bucket.
  • Query MySQL : The Query MySQL Op is designed to allow users to conveniently make queries to a MySQL database.

Go:

  • AWS Beanstalk : Dynamically deploy applications to AWS Elastic Beanstalk. This Op also streamlines connections to the Amazon Relational Database Service (RDS) for use with deployed applications.