Waypoint Plugin Sdk banner
hashicorp hashicorp

Waypoint Plugin Sdk

Development community

Description

Waypoint Plugin SDK enables building plugins for Waypoint: builders, deployment platforms, release managers, and more.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Waypoint Plugin SDK

This repository is a Go library that enables users to write custom [Waypoint](https://waypointproject.io) plugins. Waypoint supports plugins for builders, deployment platforms, release managers, and more. Waypoint plugins enable Waypoint to utilize any popular service providers as well as custom in-house solutions.

Plugins in Waypoint are separate binaries which communicate with the Waypoint application; the plugin communicates using gRPC, and while it is theoretically possible to build a plugin in any language supported by the gRPC framework. We recommend that the developers leverage the [Waypoint SDK](https://github.com/hashicorp/waypoint-plugin-sdk).

Simple Plugin Overview

To initialize the plugin SDK you use the `Main` function in the `sdk` package and register Components which provide callbacks for Waypoint during the various parts of the lifecycle.

package main

import (
  sdk "github.com/hashicorp/waypoint-plugin-sdk"
)

func main() {

  sdk.Main(sdk.WithComponents(
    // Comment out any components which are not
    // required for your plugin
    &builder.Builder{},
  ))

}

Components are Go structs which implement the various lifecycle interfaces in the Waypoint SDK. The following example shows a plugin which Waypoint can use for the build lifecycle. Creating a `build` plugin is as simple as implementing the interface `component.Builder` on a struct as shown in the following example.

package builder

import (
  "context"
  "fmt"

  "github.com/hashicorp/waypoint-plugin-sdk/terminal"
)

type Builder struct {}

func (b *Builder) BuildFunc() interface{} {
  // return a function which will be called by Waypoint
  return func(ctx context.Context, ui terminal.UI) (*Binary, error) {
  u := ui.Status()
  defer u.Close()
  u.Update("Building application")

  return &Binary{}, nil
  }
}

To pass values from one Waypoint component to another Waypoint component you return structs which implement `proto.Message`, gene