diff --git a/cmd/account/account.go b/cmd/account/account.go index 22e4f97..68fe876 100644 --- a/cmd/account/account.go +++ b/cmd/account/account.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "account", Short: "Manage Bandwidth account registration", + Long: "Register and provision Bandwidth accounts. These commands handle account onboarding and do not require an existing account to be selected.", } diff --git a/cmd/app/app.go b/cmd/app/app.go index 6d5ad45..d55b28b 100644 --- a/cmd/app/app.go +++ b/cmd/app/app.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "app", Short: "Manage Bandwidth applications", + 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.", } diff --git a/cmd/app/create.go b/cmd/app/create.go index 02551ca..a1f71d3 100644 --- a/cmd/app/create.go +++ b/cmd/app/create.go @@ -32,6 +32,7 @@ func init() { var createCmd = &cobra.Command{ Use: "create", Short: "Create a new application", + 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.", Example: ` # Create a voice application band app create --name "My Voice App" --type voice --callback-url https://example.com/voice diff --git a/cmd/app/delete.go b/cmd/app/delete.go index 05f2468..86db18d 100644 --- a/cmd/app/delete.go +++ b/cmd/app/delete.go @@ -14,10 +14,12 @@ func init() { } var deleteCmd = &cobra.Command{ - Use: "delete [id]", - Short: "Delete an application by ID", - Args: cobra.ExactArgs(1), - RunE: runDelete, + Use: "delete [id]", + Short: "Delete an application by ID", + Long: "Permanently deletes an application by its ID. This cannot be undone.", + Example: ` band app delete abc-123`, + Args: cobra.ExactArgs(1), + RunE: runDelete, } func runDelete(cmd *cobra.Command, args []string) error { diff --git a/cmd/app/get.go b/cmd/app/get.go index 6dbf623..4c8c7c6 100644 --- a/cmd/app/get.go +++ b/cmd/app/get.go @@ -17,8 +17,11 @@ func init() { var getCmd = &cobra.Command{ Use: "get [id]", Short: "Get an application by ID", - Args: cobra.ExactArgs(1), - RunE: runGet, + Long: "Returns the details of a single application by its ID, including its type and callback configuration.", + Example: ` band app get abc-123 + band app get abc-123 --plain`, + Args: cobra.ExactArgs(1), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/app/list.go b/cmd/app/list.go index 7c0ddbe..6a28086 100644 --- a/cmd/app/list.go +++ b/cmd/app/list.go @@ -16,7 +16,10 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List all applications", - RunE: runList, + Long: "Lists all applications on the account, both voice and messaging.", + Example: ` band app list + band app list --plain`, + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/app/peers.go b/cmd/app/peers.go index 82ba2f0..53a02ef 100644 --- a/cmd/app/peers.go +++ b/cmd/app/peers.go @@ -17,8 +17,11 @@ func init() { var peersCmd = &cobra.Command{ Use: "peers [app-id]", Short: "List SIP peers (locations) associated with an application", - Args: cobra.ExactArgs(1), - RunE: runPeers, + Long: "Lists the SIP peers (locations) associated with an application. Returns an empty list when no peers are associated.", + Example: ` band app peers abc-123 + band app peers abc-123 --plain`, + Args: cobra.ExactArgs(1), + RunE: runPeers, } func runPeers(cmd *cobra.Command, args []string) error { diff --git a/cmd/auth/login.go b/cmd/auth/login.go index 2e4af3f..c6ac6d4 100644 --- a/cmd/auth/login.go +++ b/cmd/auth/login.go @@ -19,6 +19,7 @@ import ( var Cmd = &cobra.Command{ Use: "auth", Short: "Manage authentication credentials", + Long: "Log in with Bandwidth OAuth2 client credentials, inspect your authentication status, and manage credential profiles and the active account.", } func init() { diff --git a/cmd/auth/logout.go b/cmd/auth/logout.go index e3729cd..60b4c3a 100644 --- a/cmd/auth/logout.go +++ b/cmd/auth/logout.go @@ -16,9 +16,11 @@ func init() { } var logoutCmd = &cobra.Command{ - Use: "logout", - Short: "Log out and remove stored credentials", - RunE: runLogout, + Use: "logout", + Short: "Log out and remove stored credentials", + 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.", + Example: ` band auth logout`, + RunE: runLogout, } func runLogout(cmd *cobra.Command, args []string) error { diff --git a/cmd/auth/profiles.go b/cmd/auth/profiles.go index 53480eb..6c403f4 100644 --- a/cmd/auth/profiles.go +++ b/cmd/auth/profiles.go @@ -15,9 +15,11 @@ func init() { } var profilesCmd = &cobra.Command{ - Use: "profiles", - Short: "List all credential profiles", - RunE: runProfiles, + Use: "profiles", + Short: "List all credential profiles", + Long: "Lists all configured credential profiles, marking the active one. Each profile holds its own client credentials, account, and environment.", + Example: ` band auth profiles`, + RunE: runProfiles, } func runProfiles(cmd *cobra.Command, args []string) error { @@ -70,10 +72,12 @@ func runProfiles(cmd *cobra.Command, args []string) error { } var useCmd = &cobra.Command{ - Use: "use ", - Short: "Switch to a different credential profile", - Args: cobra.ExactArgs(1), - RunE: runUse, + Use: "use ", + Short: "Switch to a different credential profile", + Long: "Switches the active credential profile. Subsequent commands use the selected profile's credentials, account, and environment.", + Example: ` band auth use admin`, + Args: cobra.ExactArgs(1), + RunE: runUse, } func runUse(cmd *cobra.Command, args []string) error { diff --git a/cmd/auth/status.go b/cmd/auth/status.go index 7198c80..8828388 100644 --- a/cmd/auth/status.go +++ b/cmd/auth/status.go @@ -21,7 +21,10 @@ func init() { var statusCmd = &cobra.Command{ Use: "status", Short: "Show current authentication status", - RunE: runStatus, + Long: "Shows the active profile's authentication status, including client ID, active account, environment, and (for Bandwidth Build accounts) capabilities. Use --plain for machine-readable JSON.", + Example: ` band auth status + band auth status --plain`, + RunE: runStatus, } // statusJSON is the structured output shape returned when --plain is set. diff --git a/cmd/auth/switch.go b/cmd/auth/switch.go index 80938d0..87d417d 100644 --- a/cmd/auth/switch.go +++ b/cmd/auth/switch.go @@ -19,9 +19,8 @@ func init() { var switchCmd = &cobra.Command{ Use: "switch [account-id]", Short: "Switch the active account", - Long: `Switch between accounts accessible to your credentials. - - band auth switch # interactive selection + Long: `Switch between accounts accessible to your credentials.`, + Example: ` band auth switch # interactive selection band auth switch 9901303 # switch directly`, Args: cobra.MaximumNArgs(1), RunE: runSwitch, diff --git a/cmd/bxml/gather.go b/cmd/bxml/gather.go index 3e464ec..3a4c897 100644 --- a/cmd/bxml/gather.go +++ b/cmd/bxml/gather.go @@ -24,8 +24,11 @@ func init() { var gatherCmd = &cobra.Command{ Use: "gather", Short: "Generate a Gather BXML verb", - Args: cobra.NoArgs, - RunE: runGather, + Long: "Generates a Response containing a Gather verb that collects DTMF digits and posts them to --url. Use --prompt to speak a message before gathering and --max-digits to cap input length.", + Example: ` band bxml gather --url https://example.com/voice/gather + band bxml gather --url https://example.com/voice/gather --prompt "Press 1 for sales." --max-digits 1`, + Args: cobra.NoArgs, + RunE: runGather, } func runGather(cmd *cobra.Command, args []string) error { diff --git a/cmd/bxml/raw.go b/cmd/bxml/raw.go index deb4160..771942d 100644 --- a/cmd/bxml/raw.go +++ b/cmd/bxml/raw.go @@ -13,10 +13,12 @@ func init() { } var rawCmd = &cobra.Command{ - Use: "raw ", - Short: "Validate and pretty-print a BXML string", - Args: cobra.ExactArgs(1), - RunE: runRaw, + Use: "raw ", + Short: "Validate and pretty-print a BXML string", + Long: "Validates a BXML string by round-tripping it through an XML parser and prints it back indented. Exits with an error if the input is not well-formed XML.", + Example: ` band bxml raw ""`, + Args: cobra.ExactArgs(1), + RunE: runRaw, } func runRaw(cmd *cobra.Command, args []string) error { diff --git a/cmd/bxml/record.go b/cmd/bxml/record.go index 4f81827..34db603 100644 --- a/cmd/bxml/record.go +++ b/cmd/bxml/record.go @@ -21,8 +21,11 @@ func init() { var recordCmd = &cobra.Command{ Use: "record", Short: "Generate a Record BXML verb", - Args: cobra.NoArgs, - RunE: runRecord, + Long: "Generates a Response containing a Record verb. Use --url to receive the recording-complete event and --max-duration to limit the recording length in seconds.", + Example: ` band bxml record + band bxml record --url https://example.com/voice/recorded --max-duration 30`, + Args: cobra.NoArgs, + RunE: runRecord, } func runRecord(cmd *cobra.Command, args []string) error { diff --git a/cmd/bxml/speak.go b/cmd/bxml/speak.go index f8b8b9c..7ea16c9 100644 --- a/cmd/bxml/speak.go +++ b/cmd/bxml/speak.go @@ -18,6 +18,7 @@ func init() { var speakCmd = &cobra.Command{ Use: "speak ", Short: "Generate a SpeakSentence BXML verb", + Long: "Generates a Response containing a SpeakSentence verb for the given text. Use --voice to select a specific Bandwidth voice.", Example: ` band bxml speak "Hello, welcome to Bandwidth." band bxml speak --voice julie "Press 1 for sales." band bxml speak "Goodbye." > hangup.xml`, diff --git a/cmd/bxml/transfer.go b/cmd/bxml/transfer.go index 8bfea87..7f0a81d 100644 --- a/cmd/bxml/transfer.go +++ b/cmd/bxml/transfer.go @@ -17,8 +17,11 @@ func init() { var transferCmd = &cobra.Command{ Use: "transfer ", Short: "Generate a Transfer BXML verb", - Args: cobra.ExactArgs(1), - RunE: runTransfer, + Long: "Generates a Response containing a Transfer verb to the given phone number. Use --caller-id to set the caller ID presented on the transferred leg.", + Example: ` band bxml transfer +19195551234 + band bxml transfer +19195551234 --caller-id +19198675309`, + Args: cobra.ExactArgs(1), + RunE: runTransfer, } func runTransfer(cmd *cobra.Command, args []string) error { diff --git a/cmd/call/call.go b/cmd/call/call.go index fd8990f..fe8dbfe 100644 --- a/cmd/call/call.go +++ b/cmd/call/call.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "call", Short: "Manage Bandwidth voice calls", + Long: "Create, inspect, and control voice calls. Place outbound calls, redirect calls to new BXML, hang up active calls, and look up call state.", } diff --git a/cmd/call/get.go b/cmd/call/get.go index deecabc..9599627 100644 --- a/cmd/call/get.go +++ b/cmd/call/get.go @@ -17,8 +17,11 @@ func init() { var getCmd = &cobra.Command{ Use: "get [callId]", Short: "Get the state of a call", - Args: cobra.ExactArgs(1), - RunE: runGet, + Long: "Returns the current state and details of a single call, including its direction, endpoints, and timing. Use the callId returned when the call was created.", + Example: ` band call get c-123-abc + band call get c-123-abc --plain`, + Args: cobra.ExactArgs(1), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/call/hangup.go b/cmd/call/hangup.go index c54bdde..77859f7 100644 --- a/cmd/call/hangup.go +++ b/cmd/call/hangup.go @@ -15,10 +15,12 @@ func init() { } var hangupCmd = &cobra.Command{ - Use: "hangup [callId]", - Short: "Hang up an active call", - Args: cobra.ExactArgs(1), - RunE: runHangup, + Use: "hangup [callId]", + Short: "Hang up an active call", + Long: "Ends an active call by transitioning it to the completed state. Has no effect on calls that have already disconnected.", + Example: ` band call hangup c-123-abc`, + Args: cobra.ExactArgs(1), + RunE: runHangup, } func runHangup(cmd *cobra.Command, args []string) error { diff --git a/cmd/call/list.go b/cmd/call/list.go index f7f7b74..56d60d5 100644 --- a/cmd/call/list.go +++ b/cmd/call/list.go @@ -16,7 +16,10 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List active and recent calls", - RunE: runList, + Long: "Lists calls for the account, including active calls and recently completed ones. Bandwidth retains call records for a limited window, so older calls may not appear.", + Example: ` band call list + band call list --plain`, + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/call/update.go b/cmd/call/update.go index 46300d4..cc4fa78 100644 --- a/cmd/call/update.go +++ b/cmd/call/update.go @@ -19,10 +19,12 @@ func init() { } var updateCmd = &cobra.Command{ - Use: "update [callId]", - Short: "Redirect an active call to a new URL", - Args: cobra.ExactArgs(1), - RunE: runUpdate, + Use: "update [callId]", + Short: "Redirect an active call to a new URL", + Long: "Redirects an active call to fetch new BXML from the given URL. Bandwidth POSTs to the redirect URL and replaces the call's current instructions with the response.", + Example: ` band call update c-123-abc --redirect-url https://example.com/voice/next`, + Args: cobra.ExactArgs(1), + RunE: runUpdate, } func runUpdate(cmd *cobra.Command, args []string) error { diff --git a/cmd/location/create.go b/cmd/location/create.go index 0b0db85..1f1b980 100644 --- a/cmd/location/create.go +++ b/cmd/location/create.go @@ -28,7 +28,12 @@ func init() { var createCmd = &cobra.Command{ Use: "create", Short: "Create a new location (SIP peer) under a sub-account", - RunE: runCreate, + Long: "Creates a new location (SIP peer) within the given sub-account. Use --if-not-exists to make the command idempotent, returning the existing location instead of erroring when one with the same name already exists.", + Example: ` band location create --site 12345 --name "Primary SIP" + + # Idempotent — safe to re-run + band location create --site 12345 --name "Primary SIP" --if-not-exists`, + RunE: runCreate, } func runCreate(cmd *cobra.Command, args []string) error { diff --git a/cmd/location/list.go b/cmd/location/list.go index 0cc8fb5..83f5058 100644 --- a/cmd/location/list.go +++ b/cmd/location/list.go @@ -20,7 +20,10 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List all locations (SIP peers) under a sub-account", - RunE: runList, + Long: "Lists all locations (SIP peers) within the given sub-account.", + Example: ` band location list --site 12345 + band location list --site 12345 --plain`, + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/location/location.go b/cmd/location/location.go index ec1683d..17373b2 100644 --- a/cmd/location/location.go +++ b/cmd/location/location.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "location", Short: "Manage locations (SIP peers) under sub-accounts", + Long: "Create and list locations (SIP peers) within a sub-account. Locations define the SIP endpoints that route voice traffic for the numbers assigned to them.", } diff --git a/cmd/message/get.go b/cmd/message/get.go index c04a2a4..94a6316 100644 --- a/cmd/message/get.go +++ b/cmd/message/get.go @@ -18,8 +18,10 @@ var getCmd = &cobra.Command{ Use: "get [messageId]", Short: "Get message metadata by ID", Long: "Retrieves metadata for a specific message. Note: Bandwidth does not store message content — only metadata (timestamps, direction, segment count) is returned.", - Args: cobra.ExactArgs(1), - RunE: runGet, + Example: ` band message get 1234567890abcdefghij + band message get 1234567890abcdefghij --plain`, + Args: cobra.ExactArgs(1), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/message/media/delete.go b/cmd/message/media/delete.go index 759e100..f5e96bf 100644 --- a/cmd/message/media/delete.go +++ b/cmd/message/media/delete.go @@ -14,10 +14,12 @@ func init() { } var deleteCmd = &cobra.Command{ - Use: "delete ", - Short: "Delete a media file", - Args: cobra.ExactArgs(1), - RunE: runDelete, + Use: "delete ", + Short: "Delete a media file", + Long: "Permanently deletes a media file by its ID. Any MMS that still references its URL will no longer be able to fetch it.", + Example: ` band message media delete my-campaign-image.jpg`, + Args: cobra.ExactArgs(1), + RunE: runDelete, } func runDelete(cmd *cobra.Command, args []string) error { diff --git a/cmd/message/media/get.go b/cmd/message/media/get.go index 12eb382..3764c8a 100644 --- a/cmd/message/media/get.go +++ b/cmd/message/media/get.go @@ -18,10 +18,12 @@ func init() { } var getCmd = &cobra.Command{ - Use: "get ", - Short: "Download a media file", - Args: cobra.ExactArgs(1), - RunE: runGet, + Use: "get ", + Short: "Download a media file", + Long: "Downloads a media file by its ID and writes it to the given file path.", + Example: ` band message media get my-campaign-image.jpg --output image.jpg`, + Args: cobra.ExactArgs(1), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/message/media/list.go b/cmd/message/media/list.go index ebe49a1..436002e 100644 --- a/cmd/message/media/list.go +++ b/cmd/message/media/list.go @@ -16,7 +16,10 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List uploaded media files", - RunE: runList, + Long: "Lists the media files uploaded to the account's media store.", + Example: ` band message media list + band message media list --plain`, + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/message/media/media.go b/cmd/message/media/media.go index 668b0e0..706664b 100644 --- a/cmd/message/media/media.go +++ b/cmd/message/media/media.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "media", Short: "Manage MMS media files", + Long: "Upload, list, download, and delete the media files served for MMS. Uploaded media is hosted by Bandwidth and referenced by URL when sending an MMS with 'message send --media'.", } diff --git a/cmd/message/message.go b/cmd/message/message.go index 8e880fe..8908651 100644 --- a/cmd/message/message.go +++ b/cmd/message/message.go @@ -10,6 +10,7 @@ import ( var Cmd = &cobra.Command{ Use: "message", Short: "Send and manage SMS/MMS messages", + Long: "Send SMS and MMS messages, look up message metadata, and manage the media files used in MMS. Delivery is asynchronous — status arrives via webhook callbacks on your messaging application.", } func init() { diff --git a/cmd/number/list.go b/cmd/number/list.go index 6ae6b82..144f02d 100644 --- a/cmd/number/list.go +++ b/cmd/number/list.go @@ -29,10 +29,8 @@ var listCmd = &cobra.Command{ Long: `Lists phone numbers on the active account. By default, returns only numbers in service (ready to route calls or send -messages). Pass --status to include numbers in other states. - -Examples: - band number list # default: only in-service +messages). Pass --status to include numbers in other states.`, + Example: ` band number list # default: only in-service band number list --status Inservice,InAccount # include numbers just ordered band number list --status Aging # numbers being released`, RunE: runList, diff --git a/cmd/number/number.go b/cmd/number/number.go index 4b9864f..549813f 100644 --- a/cmd/number/number.go +++ b/cmd/number/number.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "number", Short: "Manage Bandwidth phone numbers", + Long: "Search, order, activate, inspect, and release phone numbers. Numbers are referenced in E.164 format (e.g. +19195551234) throughout these commands.", } diff --git a/cmd/number/release.go b/cmd/number/release.go index d67c127..8604c71 100644 --- a/cmd/number/release.go +++ b/cmd/number/release.go @@ -15,10 +15,12 @@ func init() { } var releaseCmd = &cobra.Command{ - Use: "release [number]", - Short: "Release a phone number", - Args: cobra.ExactArgs(1), - RunE: runRelease, + Use: "release [number]", + Short: "Release a phone number", + Long: "Releases (disconnects) a phone number from the account. The number enters an aging period before it becomes available again. This cannot be undone.", + Example: ` band number release +19195551234`, + Args: cobra.ExactArgs(1), + RunE: runRelease, } func runRelease(cmd *cobra.Command, args []string) error { diff --git a/cmd/recording/delete.go b/cmd/recording/delete.go index 28f4916..873c093 100644 --- a/cmd/recording/delete.go +++ b/cmd/recording/delete.go @@ -14,10 +14,12 @@ func init() { } var deleteCmd = &cobra.Command{ - Use: "delete ", - Short: "Delete a recording", - Args: cobra.ExactArgs(2), - RunE: runDelete, + Use: "delete ", + Short: "Delete a recording", + Long: "Permanently deletes a recording's metadata and media. This cannot be undone.", + Example: ` band recording delete c-123-abc r-456-def`, + Args: cobra.ExactArgs(2), + RunE: runDelete, } func runDelete(cmd *cobra.Command, args []string) error { diff --git a/cmd/recording/download.go b/cmd/recording/download.go index 35483e9..8219304 100644 --- a/cmd/recording/download.go +++ b/cmd/recording/download.go @@ -19,10 +19,12 @@ func init() { } var downloadCmd = &cobra.Command{ - Use: "download ", - Short: "Download a recording to a file", - Args: cobra.ExactArgs(2), - RunE: runDownload, + Use: "download ", + Short: "Download a recording to a file", + Long: "Downloads a recording's audio media and writes it to the given file path. The file is written owner-only (0600) since recordings may contain sensitive call audio.", + Example: ` band recording download c-123-abc r-456-def --output recording.wav`, + Args: cobra.ExactArgs(2), + RunE: runDownload, } func runDownload(cmd *cobra.Command, args []string) error { diff --git a/cmd/recording/get.go b/cmd/recording/get.go index 21e6200..3835886 100644 --- a/cmd/recording/get.go +++ b/cmd/recording/get.go @@ -17,8 +17,11 @@ func init() { var getCmd = &cobra.Command{ Use: "get ", Short: "Get metadata for a specific recording", - Args: cobra.ExactArgs(2), - RunE: runGet, + Long: "Returns metadata for a single recording, including its duration, channels, status, and media URL. Use 'recording download' to fetch the audio itself.", + Example: ` band recording get c-123-abc r-456-def + band recording get c-123-abc r-456-def --plain`, + Args: cobra.ExactArgs(2), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/recording/list.go b/cmd/recording/list.go index f7c1462..ccf709a 100644 --- a/cmd/recording/list.go +++ b/cmd/recording/list.go @@ -17,8 +17,11 @@ func init() { var listCmd = &cobra.Command{ Use: "list ", Short: "List recordings for a call", - Args: cobra.ExactArgs(1), - RunE: runList, + Long: "Lists all recordings produced during a single call, identified by its callId. Returns an empty list if the call has no recordings.", + Example: ` band recording list c-123-abc + band recording list c-123-abc --plain`, + Args: cobra.ExactArgs(1), + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/recording/recording.go b/cmd/recording/recording.go index 466cee7..74386a0 100644 --- a/cmd/recording/recording.go +++ b/cmd/recording/recording.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "recording", Short: "Manage call recordings", + Long: "List, inspect, download, and delete recordings produced by voice calls. Recordings are tied to the call that created them, so most commands take a callId.", } diff --git a/cmd/site/create.go b/cmd/site/create.go index 0e79add..438ef39 100644 --- a/cmd/site/create.go +++ b/cmd/site/create.go @@ -27,7 +27,13 @@ func init() { var createCmd = &cobra.Command{ Use: "create", Short: "Create a new sub-account", - RunE: runCreate, + Long: "Creates a new sub-account under the active account. Use --if-not-exists to make the command idempotent, returning the existing sub-account instead of erroring when one with the same name already exists.", + Example: ` band subaccount create --name "Production" + band subaccount create --name "Production" --description "Prod traffic" + + # Idempotent — safe to re-run + band subaccount create --name "Production" --if-not-exists`, + RunE: runCreate, } func runCreate(cmd *cobra.Command, args []string) error { diff --git a/cmd/site/delete.go b/cmd/site/delete.go index c025381..90a9f2d 100644 --- a/cmd/site/delete.go +++ b/cmd/site/delete.go @@ -14,10 +14,12 @@ func init() { } var deleteCmd = &cobra.Command{ - Use: "delete [id]", - Short: "Delete a sub-account by ID", - Args: cobra.ExactArgs(1), - RunE: runDelete, + Use: "delete [id]", + Short: "Delete a sub-account by ID", + Long: "Permanently deletes a sub-account by its numeric ID. This cannot be undone.", + Example: ` band subaccount delete 12345`, + Args: cobra.ExactArgs(1), + RunE: runDelete, } func runDelete(cmd *cobra.Command, args []string) error { diff --git a/cmd/site/get.go b/cmd/site/get.go index fd4f6d9..71e3742 100644 --- a/cmd/site/get.go +++ b/cmd/site/get.go @@ -17,8 +17,11 @@ func init() { var getCmd = &cobra.Command{ Use: "get [id]", Short: "Get a sub-account by ID", - Args: cobra.ExactArgs(1), - RunE: runGet, + Long: "Returns the details of a single sub-account by its numeric ID.", + Example: ` band subaccount get 12345 + band subaccount get 12345 --plain`, + Args: cobra.ExactArgs(1), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/site/list.go b/cmd/site/list.go index b0c844a..976026d 100644 --- a/cmd/site/list.go +++ b/cmd/site/list.go @@ -16,7 +16,10 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List all sub-accounts", - RunE: runList, + Long: "Lists all sub-accounts under the active account.", + Example: ` band subaccount list + band subaccount list --plain`, + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/tnoption/get.go b/cmd/tnoption/get.go index c5e4a81..e2a156c 100644 --- a/cmd/tnoption/get.go +++ b/cmd/tnoption/get.go @@ -16,6 +16,7 @@ func init() { var getCmd = &cobra.Command{ Use: "get ", Short: "Get the status of a TN Option Order", + Long: "Returns the status and details of a single TN Option Order by its order ID.", Example: ` band tnoption get ddbdc72e-dc27-490c-904e-d0c11291b095`, Args: cobra.ExactArgs(1), RunE: runGet, diff --git a/cmd/tnoption/list.go b/cmd/tnoption/list.go index 42bcec5..f7ae945 100644 --- a/cmd/tnoption/list.go +++ b/cmd/tnoption/list.go @@ -24,6 +24,7 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List TN Option Orders", + Long: "Lists TN Option Orders for the account. Filter by order status with --status or by phone number with --tn.", Example: ` band tnoption list band tnoption list --status COMPLETE band tnoption list --tn +19195551234`, diff --git a/cmd/transcription/create.go b/cmd/transcription/create.go index 16dcf14..74a3fb7 100644 --- a/cmd/transcription/create.go +++ b/cmd/transcription/create.go @@ -25,8 +25,14 @@ func init() { var createCmd = &cobra.Command{ Use: "create ", Short: "Request a transcription for a recording", - Args: cobra.ExactArgs(2), - RunE: runCreate, + Long: "Requests a transcription for a recording. Transcription runs asynchronously; use --wait to poll until the transcript has content, or fetch it later with 'transcription get'.", + Example: ` band transcription create c-123-abc r-456-def + + # Block until the transcript is ready + band transcription create c-123-abc r-456-def --wait + band transcription create c-123-abc r-456-def --wait --timeout 120s`, + Args: cobra.ExactArgs(2), + RunE: runCreate, } func runCreate(cmd *cobra.Command, args []string) error { diff --git a/cmd/transcription/get.go b/cmd/transcription/get.go index 312c9a2..22b8396 100644 --- a/cmd/transcription/get.go +++ b/cmd/transcription/get.go @@ -17,8 +17,11 @@ func init() { var getCmd = &cobra.Command{ Use: "get ", Short: "Get the transcription for a recording", - Args: cobra.ExactArgs(2), - RunE: runGet, + Long: "Returns the transcription for a recording. The transcript must already have been requested with 'transcription create' and finished processing.", + Example: ` band transcription get c-123-abc r-456-def + band transcription get c-123-abc r-456-def --plain`, + Args: cobra.ExactArgs(2), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/transcription/transcription.go b/cmd/transcription/transcription.go index e51cb57..f78a54f 100644 --- a/cmd/transcription/transcription.go +++ b/cmd/transcription/transcription.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "transcription", Short: "Manage call recording transcriptions", + Long: "Request and retrieve text transcriptions of call recordings. Transcription is asynchronous — request it for a recording, then fetch the result once it's ready.", } diff --git a/cmd/vcp/delete.go b/cmd/vcp/delete.go index fb1cde7..589c9ef 100644 --- a/cmd/vcp/delete.go +++ b/cmd/vcp/delete.go @@ -14,10 +14,12 @@ func init() { } var deleteCmd = &cobra.Command{ - Use: "delete ", - Short: "Delete a Voice Configuration Package", - Args: cobra.ExactArgs(1), - RunE: runDelete, + Use: "delete ", + Short: "Delete a Voice Configuration Package", + Long: "Permanently deletes a Voice Configuration Package by its ID. This cannot be undone.", + Example: ` band vcp delete abc-123-def`, + Args: cobra.ExactArgs(1), + RunE: runDelete, } func runDelete(cmd *cobra.Command, args []string) error { diff --git a/cmd/vcp/get.go b/cmd/vcp/get.go index f94d9ff..8aea199 100644 --- a/cmd/vcp/get.go +++ b/cmd/vcp/get.go @@ -17,8 +17,11 @@ func init() { var getCmd = &cobra.Command{ Use: "get ", Short: "Get a Voice Configuration Package", - Args: cobra.ExactArgs(1), - RunE: runGet, + Long: "Returns the details of a single Voice Configuration Package by its ID.", + Example: ` band vcp get abc-123-def + band vcp get abc-123-def --plain`, + Args: cobra.ExactArgs(1), + RunE: runGet, } func runGet(cmd *cobra.Command, args []string) error { diff --git a/cmd/vcp/list.go b/cmd/vcp/list.go index ea2f1bd..a4487b6 100644 --- a/cmd/vcp/list.go +++ b/cmd/vcp/list.go @@ -16,7 +16,10 @@ func init() { var listCmd = &cobra.Command{ Use: "list", Short: "List Voice Configuration Packages", - RunE: runList, + Long: "Lists all Voice Configuration Packages on the account.", + Example: ` band vcp list + band vcp list --plain`, + RunE: runList, } func runList(cmd *cobra.Command, args []string) error { diff --git a/cmd/vcp/numbers.go b/cmd/vcp/numbers.go index 1fb4c17..5efe6f5 100644 --- a/cmd/vcp/numbers.go +++ b/cmd/vcp/numbers.go @@ -17,8 +17,11 @@ func init() { var numbersCmd = &cobra.Command{ Use: "numbers ", Short: "List phone numbers assigned to a VCP", - Args: cobra.ExactArgs(1), - RunE: runNumbers, + Long: "Lists all phone numbers currently assigned to a Voice Configuration Package.", + Example: ` band vcp numbers abc-123-def + band vcp numbers abc-123-def --plain`, + Args: cobra.ExactArgs(1), + RunE: runNumbers, } func runNumbers(cmd *cobra.Command, args []string) error { diff --git a/cmd/vcp/vcp.go b/cmd/vcp/vcp.go index 439747d..6259f4c 100644 --- a/cmd/vcp/vcp.go +++ b/cmd/vcp/vcp.go @@ -6,4 +6,5 @@ import "github.com/spf13/cobra" var Cmd = &cobra.Command{ Use: "vcp", Short: "Manage Voice Configuration Packages (Universal Platform)", + Long: "Create, inspect, and manage Voice Configuration Packages (VCPs) on the Universal Platform. VCPs define voice routing and settings for groups of phone numbers, and can be linked to a voice application for HTTP callbacks.", }