Skip to content

Commit 8d7de36

Browse files
authored
SWI-11010 Update Long + Example for Better Docs (#14)
* call docs * recording docs * transcription docs * app docs * site docs * location docs * vcp docs * account docs * auth docs * bxml docs * message docs * number docs * tnoption docs * fix auth switch * gofmt
1 parent 9335472 commit 8d7de36

53 files changed

Lines changed: 214 additions & 98 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/account/account.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ import "github.com/spf13/cobra"
66
var Cmd = &cobra.Command{
77
Use: "account",
88
Short: "Manage Bandwidth account registration",
9+
Long: "Register and provision Bandwidth accounts. These commands handle account onboarding and do not require an existing account to be selected.",
910
}

cmd/app/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ import "github.com/spf13/cobra"
66
var Cmd = &cobra.Command{
77
Use: "app",
88
Short: "Manage Bandwidth applications",
9+
Long: "Create, inspect, and manage Bandwidth applications. Applications hold the callback configuration that voice and messaging traffic is routed against, and are referenced by ID when sending messages or placing calls.",
910
}

cmd/app/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func init() {
3232
var createCmd = &cobra.Command{
3333
Use: "create",
3434
Short: "Create a new application",
35+
Long: "Creates a new voice or messaging application. The callback URL receives webhook events for traffic routed through the application. Use --if-not-exists to make the command idempotent, returning the existing application instead of erroring when one with the same name already exists.",
3536
Example: ` # Create a voice application
3637
band app create --name "My Voice App" --type voice --callback-url https://example.com/voice
3738

cmd/app/delete.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ func init() {
1414
}
1515

1616
var deleteCmd = &cobra.Command{
17-
Use: "delete [id]",
18-
Short: "Delete an application by ID",
19-
Args: cobra.ExactArgs(1),
20-
RunE: runDelete,
17+
Use: "delete [id]",
18+
Short: "Delete an application by ID",
19+
Long: "Permanently deletes an application by its ID. This cannot be undone.",
20+
Example: ` band app delete abc-123`,
21+
Args: cobra.ExactArgs(1),
22+
RunE: runDelete,
2123
}
2224

2325
func runDelete(cmd *cobra.Command, args []string) error {

cmd/app/get.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ func init() {
1717
var getCmd = &cobra.Command{
1818
Use: "get [id]",
1919
Short: "Get an application by ID",
20-
Args: cobra.ExactArgs(1),
21-
RunE: runGet,
20+
Long: "Returns the details of a single application by its ID, including its type and callback configuration.",
21+
Example: ` band app get abc-123
22+
band app get abc-123 --plain`,
23+
Args: cobra.ExactArgs(1),
24+
RunE: runGet,
2225
}
2326

2427
func runGet(cmd *cobra.Command, args []string) error {

cmd/app/list.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ func init() {
1616
var listCmd = &cobra.Command{
1717
Use: "list",
1818
Short: "List all applications",
19-
RunE: runList,
19+
Long: "Lists all applications on the account, both voice and messaging.",
20+
Example: ` band app list
21+
band app list --plain`,
22+
RunE: runList,
2023
}
2124

2225
func runList(cmd *cobra.Command, args []string) error {

cmd/app/peers.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ func init() {
1717
var peersCmd = &cobra.Command{
1818
Use: "peers [app-id]",
1919
Short: "List SIP peers (locations) associated with an application",
20-
Args: cobra.ExactArgs(1),
21-
RunE: runPeers,
20+
Long: "Lists the SIP peers (locations) associated with an application. Returns an empty list when no peers are associated.",
21+
Example: ` band app peers abc-123
22+
band app peers abc-123 --plain`,
23+
Args: cobra.ExactArgs(1),
24+
RunE: runPeers,
2225
}
2326

2427
func runPeers(cmd *cobra.Command, args []string) error {

cmd/auth/login.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
var Cmd = &cobra.Command{
2020
Use: "auth",
2121
Short: "Manage authentication credentials",
22+
Long: "Log in with Bandwidth OAuth2 client credentials, inspect your authentication status, and manage credential profiles and the active account.",
2223
}
2324

2425
func init() {

cmd/auth/logout.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ func init() {
1616
}
1717

1818
var logoutCmd = &cobra.Command{
19-
Use: "logout",
20-
Short: "Log out and remove stored credentials",
21-
RunE: runLogout,
19+
Use: "logout",
20+
Short: "Log out and remove stored credentials",
21+
Long: "Logs out by deleting stored secrets from the system keychain and removing the CLI config file. This affects all profiles, not just the active one.",
22+
Example: ` band auth logout`,
23+
RunE: runLogout,
2224
}
2325

2426
func runLogout(cmd *cobra.Command, args []string) error {

cmd/auth/profiles.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ func init() {
1515
}
1616

1717
var profilesCmd = &cobra.Command{
18-
Use: "profiles",
19-
Short: "List all credential profiles",
20-
RunE: runProfiles,
18+
Use: "profiles",
19+
Short: "List all credential profiles",
20+
Long: "Lists all configured credential profiles, marking the active one. Each profile holds its own client credentials, account, and environment.",
21+
Example: ` band auth profiles`,
22+
RunE: runProfiles,
2123
}
2224

2325
func runProfiles(cmd *cobra.Command, args []string) error {
@@ -70,10 +72,12 @@ func runProfiles(cmd *cobra.Command, args []string) error {
7072
}
7173

7274
var useCmd = &cobra.Command{
73-
Use: "use <profile>",
74-
Short: "Switch to a different credential profile",
75-
Args: cobra.ExactArgs(1),
76-
RunE: runUse,
75+
Use: "use <profile>",
76+
Short: "Switch to a different credential profile",
77+
Long: "Switches the active credential profile. Subsequent commands use the selected profile's credentials, account, and environment.",
78+
Example: ` band auth use admin`,
79+
Args: cobra.ExactArgs(1),
80+
RunE: runUse,
7781
}
7882

7983
func runUse(cmd *cobra.Command, args []string) error {

0 commit comments

Comments
 (0)