Octopus Deploy Documentation

Create a project group

Last updated

This script demonstrates how to programmatically create a project group in Octopus Deploy.


Provide values for:

  • Octopus URL
  • Octopus API Key
  • Space ID of the space to use
  • Name of the project group to create


package main

import (


func main() {
	octopusURL := os.Args[1]
	space := os.Args[2]
	name := os.Args[3]

	fmt.Println("Enter Password Securely: ")
	apiKey, err := terminal.ReadPassword(0)

	if err != nil {

	APIKey := string(apiKey)

	octopusAuth(octopusURL, APIKey, space)
	CreateProjectGroup(octopusURL, APIKey, space, name)


func octopusAuth(octopusURL, APIKey, space string) *client.Client {
	client, err := client.NewClient(nil, octopusURL, APIKey, space)
	if err != nil {

	return client

func CreateProjectGroup(octopusURL, APIKey, space, name string) *model.ProjectGroup {
	client := octopusAuth(octopusURL, APIKey, space)
	ProjectGroup := model.NewProjectGroup(name)


	return ProjectGroup

Need support? We're here to help.