Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create an account",
Long: "Create an account in Octopus Deploy",
Example: heredoc.Docf("$ %s account create", constants.ExecutableName),
Example: heredoc.Docf("%s account create", constants.ExecutableName),
RunE: func(cmd *cobra.Command, args []string) error {
return nil // TODO
},
Expand Down
12 changes: 7 additions & 5 deletions cmd/gen-docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ navOrder: {{.Position}}
import SamplesInstance from 'src/shared-content/samples/samples-instance.include.md';

{{.Command.Long}}
` + "\n```" + `{{define "T1"}}Usage:{{if .Runnable}}
` + "\n```text" + `{{define "T1"}}Usage:{{if .Runnable}}
Copy link
Copy Markdown
Author

@flin-8 flin-8 Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MD040 fenced-code-language - Fenced code blocks should have a language specified

{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}

Expand Down Expand Up @@ -233,15 +233,16 @@ Use "{{.CommandPath}} [command] --help" for more information about a command.{{e
## Examples

<SamplesInstance />
` + "\n```" + `
` + "\n```bash" + `
{{ .Command.Example }}
` + "\n```\n" + `
{{- end }}

## Learn more

- [Octopus CLI](/docs/octopus-rest-api/cli)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)`
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
`
Copy link
Copy Markdown
Author

@flin-8 flin-8 Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MD047 single-trailing-newline - Files should end with a single newline character


const indexTemplate = `---
layout: src/layouts/Default.astro
Expand All @@ -263,7 +264,8 @@ The Octopus CLI is built and maintained by the Octopus Deploy team, but it is al

## Commands {#octopusCommandLine-Commands}

` + "\n`octopus` supports the following commands:\n" +
` + "`octopus` supports the following commands:" +
Copy link
Copy Markdown
Author

@flin-8 flin-8 Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MD012 no-multiple-blanks - Multiple consecutive blank lines

`
{{range .Pages}}
- **[{{.Title}}]({{.RelativePath}})**: {{.Command.Short}}.{{end}}`
- **[{{.Title}}]({{.RelativePath}})**: {{.Command.Short}}.{{end}}
`
2 changes: 1 addition & 1 deletion pkg/cmd/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewCmdAccount(f factory.Factory) *cobra.Command {
Use: "account <command>",
Short: "Manage accounts",
Long: "Manage accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account list", constants.ExecutableName),
Example: heredoc.Docf("%s account list", constants.ExecutableName),
Annotations: map[string]string{
annotations.IsInfrastructure: "true",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewCmdAws(f factory.Factory) *cobra.Command {
Use: "aws <command>",
Short: "Manage AWS accounts",
Long: "Manage AWS accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account aws list", constants.ExecutableName),
Example: heredoc.Docf("%s account aws list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/account/aws/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package create

import (
"fmt"
"github.com/OctopusDeploy/cli/pkg/cmd"
"os"

"github.com/OctopusDeploy/cli/pkg/cmd"

"github.com/OctopusDeploy/cli/pkg/util"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"

Expand Down Expand Up @@ -67,7 +68,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create an AWS account",
Long: "Create an AWS account in Octopus Deploy",
Example: heredoc.Docf("$ %s account aws create", constants.ExecutableName),
Example: heredoc.Docf("%s account aws create", constants.ExecutableName),
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/aws/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List AWS accounts",
Long: "List AWS accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account aws list", constants.ExecutableName),
Example: heredoc.Docf("%s account aws list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, _ []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/azure-oidc/azure-oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewCmdAzureOidc(f factory.Factory) *cobra.Command {
Use: "azure-oidc <command>",
Short: "Manage Azure OpenID Connect accounts",
Long: "Manage Azure OpenID Connect accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account azure-oidc list", constants.ExecutableName),
Example: heredoc.Docf("%s account azure-oidc list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/account/azure-oidc/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package create

import (
"fmt"
"os"
"strings"

"github.com/OctopusDeploy/cli/pkg/cmd"
"github.com/OctopusDeploy/cli/pkg/cmd/account/shared"
"github.com/OctopusDeploy/cli/pkg/question"
"os"
"strings"

"github.com/OctopusDeploy/cli/pkg/util"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"
Expand Down Expand Up @@ -84,7 +85,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create an Azure OpenID Connect account",
Long: "Create an Azure OpenID Connect account in Octopus Deploy",
Example: heredoc.Docf("$ %s account azure-oidc create", constants.ExecutableName),
Example: heredoc.Docf("%s account azure-oidc create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/azure-oidc/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List Azure OpenID Connect accounts",
Long: "List Azure OpenID Connect accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account azure-oidc list", constants.ExecutableName),
Example: heredoc.Docf("%s account azure-oidc list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, args []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewCmdAzure(f factory.Factory) *cobra.Command {
Use: "azure <command>",
Short: "Manage Azure subscription accounts",
Long: "Manage Azure subscription accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account azure list", constants.ExecutableName),
Example: heredoc.Docf("%s account azure list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/account/azure/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package create

import (
"fmt"
"github.com/OctopusDeploy/cli/pkg/cmd"
"github.com/OctopusDeploy/cli/pkg/cmd/account/shared"
"os"
"strings"

"github.com/OctopusDeploy/cli/pkg/cmd"
"github.com/OctopusDeploy/cli/pkg/cmd/account/shared"

"github.com/OctopusDeploy/cli/pkg/util"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"

Expand Down Expand Up @@ -78,7 +79,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create an Azure subscription account",
Long: "Create an Azure subscription account in Octopus Deploy",
Example: heredoc.Docf("$ %s account azure create", constants.ExecutableName),
Example: heredoc.Docf("%s account azure create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/azure/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List Azure subscription accounts",
Long: "List Azure subscription accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account azure list", constants.ExecutableName),
Example: heredoc.Docf("%s account azure list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, args []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/account/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package create

import (
"fmt"

"github.com/AlecAivazis/survey/v2"
"github.com/MakeNowJust/heredoc/v2"
"github.com/OctopusDeploy/cli/pkg/cmd"
Expand Down Expand Up @@ -32,7 +33,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create an account",
Long: "Create an account in Octopus Deploy",
Example: heredoc.Docf("$ %s account create", constants.ExecutableName),
Example: heredoc.Docf("%s account create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(cmd *cobra.Command, args []string) error {
return createRun(f, cmd)
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/account/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package delete

import (
"fmt"

"github.com/MakeNowJust/heredoc/v2"
"github.com/OctopusDeploy/cli/pkg/apiclient"
"github.com/OctopusDeploy/cli/pkg/constants"
Expand All @@ -21,8 +22,8 @@ func NewCmdDelete(f factory.Factory) *cobra.Command {
Long: "Delete an account in Octopus Deploy",
Aliases: []string{"del", "rm", "remove"},
Example: heredoc.Docf(`
$ %[1]s account delete
$ %[1]s account rm
%[1]s account delete
%[1]s account rm
`, constants.ExecutableName),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/account/gcp/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package create
import (
b64 "encoding/base64"
"fmt"
"github.com/OctopusDeploy/cli/pkg/cmd"
"os"

"github.com/OctopusDeploy/cli/pkg/cmd"

"github.com/OctopusDeploy/cli/pkg/util"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"

Expand Down Expand Up @@ -66,7 +67,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create a Google Cloud account",
Long: "Create a Google Cloud account in Octopus Deploy",
Example: heredoc.Docf("$ %s account gcp create", constants.ExecutableName),
Example: heredoc.Docf("%s account gcp create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewCmdGcp(f factory.Factory) *cobra.Command {
Use: "gcp <command>",
Short: "Manage Google Cloud accounts",
Long: "Manage Google Cloud accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account gcp list", constants.ExecutableName),
Example: heredoc.Docf("%s account gcp list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/gcp/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List Google Cloud accounts",
Long: "List Google Cloud accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account gcp list", constants.ExecutableName),
Example: heredoc.Docf("%s account gcp list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, _ []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/account/generic-oidc/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package create

import (
"fmt"
"os"

"github.com/AlecAivazis/survey/v2"
"github.com/MakeNowJust/heredoc/v2"
"github.com/OctopusDeploy/cli/pkg/cmd"
Expand All @@ -18,7 +20,6 @@ import (
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/accounts"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"
"github.com/spf13/cobra"
"os"
)

type CreateFlags struct {
Expand Down Expand Up @@ -63,7 +64,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create an Generic OpenID Connect account",
Long: "Create an Generic OpenID Connect account in Octopus Deploy",
Example: heredoc.Docf("$ %s account generic-oidc create", constants.ExecutableName),
Example: heredoc.Docf("%s account generic-oidc create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/generic-oidc/generic-oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewCmdGenericOidc(f factory.Factory) *cobra.Command {
Use: "generic-oidc <command>",
Short: "Manage Generic OpenID Connect accounts",
Long: "Manage Generic OpenID Connect accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account generic-oidc list", constants.ExecutableName),
Example: heredoc.Docf("%s account generic-oidc list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/generic-oidc/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List Generic OpenID Connect accounts",
Long: "List Generic OpenID Connect accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account generic-oidc list", constants.ExecutableName),
Example: heredoc.Docf("%s account generic-oidc list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, args []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List accounts",
Long: "List accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account list", constants.ExecutableName),
Example: heredoc.Docf("%s account list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, _ []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/account/ssh/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package create
import (
b64 "encoding/base64"
"fmt"
"github.com/OctopusDeploy/cli/pkg/cmd"
"os"

"github.com/OctopusDeploy/cli/pkg/cmd"

"github.com/OctopusDeploy/cli/pkg/util"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"

Expand Down Expand Up @@ -69,7 +70,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create a SSH Key Pair account",
Long: "Create a SSH Key Pair account in Octopus Deploy",
Example: heredoc.Docf("$ %s account ssh create", constants.ExecutableName),
Example: heredoc.Docf("%s account ssh create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/ssh/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List SSH Key Pair accounts",
Long: "List SSH Key Pair accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account ssh list", constants.ExecutableName),
Example: heredoc.Docf("%s account ssh list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, _ []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewCmdSsh(f factory.Factory) *cobra.Command {
Use: "ssh <command>",
Short: "Manage SSH Key Pair accounts",
Long: "Manage SSH Key Pair accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account ssh list", constants.ExecutableName),
Example: heredoc.Docf("%s account ssh list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/account/token/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package create

import (
"fmt"
"github.com/OctopusDeploy/cli/pkg/cmd"
"os"

"github.com/OctopusDeploy/cli/pkg/cmd"

"github.com/OctopusDeploy/cli/pkg/util"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/environments"

Expand Down Expand Up @@ -63,7 +64,7 @@ func NewCmdCreate(f factory.Factory) *cobra.Command {
Use: "create",
Short: "Create a Token account",
Long: "Create a Token account in Octopus Deploy",
Example: heredoc.Docf("$ %s account token create", constants.ExecutableName),
Example: heredoc.Docf("%s account token create", constants.ExecutableName),
Aliases: []string{"new"},
RunE: func(c *cobra.Command, _ []string) error {
opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/token/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCmdList(f factory.Factory) *cobra.Command {
Use: "list",
Short: "List Token accounts",
Long: "List Token accounts in Octopus Deploy",
Example: heredoc.Docf("$ %s account token list", constants.ExecutableName),
Example: heredoc.Docf("%s account token list", constants.ExecutableName),
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, _ []string) error {
client, err := f.GetSpacedClient(apiclient.NewRequester(cmd))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/account/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewCmdToken(f factory.Factory) *cobra.Command {
Use: "token <command>",
Short: "Manage Token accounts",
Long: "Manage Token accounts in Octopus Deploy",
Example: fmt.Sprintf("$ %s account token list", constants.ExecutableName),
Example: fmt.Sprintf("%s account token list", constants.ExecutableName),
}

cmd.AddCommand(cmdList.NewCmdList(f))
Expand Down
Loading
Loading