SkillAgentSearch skills...

Gort

Gort is a chatbot framework designed from the ground up for chatops.

Install / Use

/learn @getgort/Gort

README

Gort

GoDoc Tests Go Report Card

Gort is a chatbot framework designed from the ground up for chatops.

Gort brings the power of the command line to the place you collaborate with your team: your chat window. Its open-ended command bundle support allows developers to implement functionality in the language of their choice, while powerful access control means you can collaborate around even the most sensitive tasks with confidence. A focus on extensibility and adaptability means that you can respond quickly to the unexpected, without your team losing visibility.

The official documentation can be found here: The Gort Guide.

History

Gort was initially conceived of as a Go re-implementation of Operable's Cog, and while it remains heavily inspired by Cog, Gort has largely gone its own way.

During our initial design discussion, we found that many of Cog’s features, however innovative, went largely unused, and the codebase had become difficult to extend and maintain. Additionally, its implementation language -- Elixir -- had relatively few proficient developers. The solution, which was discussed for many months on the Cog Slack workspace, was to rewrite Cog from scratch in Go, removing some of less-used functionality and reducing complexity in the process.

This gave us the opportunity to consider and possibly redefine what Cog was meant to be. To choose the features that make sense, and to discard those that don't. In this way, Gort can be described more as a “spiritual successor” to Cog than a faithful re-implementation.

Features

Gort's design philosophy emphasizes flexibility and security by allowing you to build commands in any language you want, using tooling you're already comfortable with, and can tightly control who can use them and how.

More specifically:

  • Commands can be implemented in any programming language
  • Users may trigger commands through Slack (or another chat provider)
  • Commands are packaged into bundles that can be installed in Gort
  • Users can be assigned to groups, roles can be assigned to groups, and permissions can be attached to roles
  • Supports a sophisticated identity and permission system to determine who can use commands
  • System and command output is highly customizable at the application, bundle, and even command level
  • Supports Slack and Discord as first class chat providers (with more on the way!)
  • All command and API activities are stored in a dedicated audit log for review

Each of these is described in more detail below.

Users may trigger commands through Slack (or another chat provider)

Users primarily interact with Gort through commands, which are triggered by a command character (! by default) but are otherwise conceptually identical to commands entered on the command line.

For example, using an echo command might look like the following:

Hello, Gort!

As shown, the output from successful commands is relayed back by Gort.

More information about commands can be found in the Gort Guide:

Commands can be implemented in any programming language

Gort commands are built as container images, which means you can build them in any language you're comfortable with.

What's more, because your executable receives all chat inputs exactly as if it was being typed on the command line, you can use any command line interpreter you want. Commands can even be implemented as Bash scripts, or using existing commands, like curl!

More information about writing commands can be found in the Gort Guide:

Commands are packaged into bundles that can be installed in Gort

In Gort, a set of one or more related commands can be installed as a "command bundle".

A bundle is represented in YAML, specifying which executable to use for each command and who is allowed to execute each commands.

A very simple bundle file is shown below.

---
gort_bundle_version: 1

name: echo
version: 0.0.1
image: ubuntu:20.04

author: Matt Titmus <matthew.titmus@gmail.com>
homepage: https://guide.getgort.io
description: A test bundle.
long_description: |-
  This is an example bundle. It lets you echo text using the "echo"
  command that's built into Ubuntu 20.04.

permissions:
  - can_echo

commands:
  echo:
    description: "Echos back anything sent to it."
    executable: [ "/bin/echo" ]
    rules:
      - must have echo:can_echo

This shows a bundle called echo, which defines a command (also called echo) and a permission called can_echo. Once installed, any user with the echo:can_echo permission can execute it in Slack.

More information about bundles can be found in the Gort Guide:

Organize users into groups, and permissions into roles

In Gort, users can be uniquely mapped to users in one or more chat providers. Gort users can be members of one or more groups, which in turn can have any number of roles that can be thought of as collections of granted permissions. For example, the user dave might be in a group called developers. This group may have a role attached named deployers that contains a number of permissions, including one called production_deploy.

More information about permissions and rules can be found in the Gort Guide:

Use a sophisticated identity and permission system to determine who can use commands

A sophisticated rule system can be applied for each command defining who can use it. These can be quite granular, and are even capable of making permissions decisions based on the values of specific flags or parameters.

Rules are assigned at the bundle level, and can be quite sophisticated. Below we have a subset of a bundle called deploy.

name: deploy
version: 0.0.1

permissions:
  - production_deploy

commands:
  deploy:
    description: "Deploys to the chosen environment."
    executable: [ "/bin/deploy" ]
    rules:
      - with arg[0] == "production" must have deploy:production_deploy

As you can see, the above example includes one command, also called deploy. Its one rule asserts that any user passing "production" as the parameter must have the production_deploy permission (from the deploy bundle).

More information about permissions and rules can be found in the Gort Guide:

System and command output is highly customizable

Gort provides a sophisticated templating system that allows you to control the presentation of any information sent to users, including system messages, as well as command output and error messages.

What's more, templates can be defined at the application level in the configuration, or at the bundle or even the command level in individual bundle configurations.

Gort templates use Go's template syntax to format output in a chat-agnostic way. For example, a very simple command template might look something like the following:

{{ text | monospace true }}{{ .Response.Out }}{{ endtext }}

This template emits the command's response (.Response.Out) as monospaced text, which may look something like the following:

Monospaced command output

A slightly more complicated template, this one a command error template (actually the default), is shown below.

{{ header | color "#FF0000" | title .Response.Title }}
{{ text }}The pipeline failed planning the invocation:{{ endtext }}
{{ text | monospace true }}{{ .Request.Bundle.Name }}:{{ .Request.Command.Name }} {{ .Request.Parameters }}{{ endtext }}
{{ text }}The specific error was:{{ endtext }}
{{ text | monospace true }}{{ .Response.Out }}{{ endtext }}

This one includes a header with a color and title, as well as some alternating monospaced and standard text. In this case, this will format a command error something like the following:

Pretty command error message

You'll notice some references to .Response: those are references to the response envelope, a data structure that's accessible from any template that makes available all of the data and metadata around one command request, execution, and response.

More information about audit logging can be found in the Gort Guide:

  • [Gort Guide: Output Format Templates](https://guide.getgort.io/en/latest/sections/te
View on GitHub
GitHub Stars399
CategoryOperations
Updated9d ago
Forks23

Languages

Go

Security Score

100/100

Audited on Mar 15, 2026

No findings