feat(sample): add band sample run command - #52
Open
michaela-band wants to merge 2 commits into
Open
michaela-band wants to merge 2 commits into
michaela-band wants to merge 2 commits into
Conversation
Adds a new `band sample` command group that downloads and runs Bandwidth sample applications with credentials automatically sourced from the active band profile — no manual env var setup required. Commands: band sample list band sample run <name> --language <lang> [--call-to <number>] The run command clones the sample repo to ~/.band/samples/<name>-<lang>/, starts an ngrok tunnel, creates a Bandwidth voice application with the tunnel URLs, writes a populated .env file, installs language dependencies, and launches the app. Pass --call-to to automatically dial a number once the app is healthy. Supported samples (initial catalog): live-assistant python openai-live-websockets-python voice-gather python, node, java Also exports cmdutil.LoadRawCredentials so the sample command can surface client ID, client secret, and account ID for .env file generation without duplicating the config/keychain lookup logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ajrice6713
reviewed
Sep 25, 2026
| // ── ngrok ──────────────────────────────────────────────────────────────── | ||
| ngrokPath, err := exec.LookPath("ngrok") | ||
| if err != nil { | ||
| return fmt.Errorf("ngrok not found — install it with: brew install ngrok/ngrok/ngrok") |
There was a problem hiding this comment.
Suggested change
| return fmt.Errorf("ngrok not found — install it with: brew install ngrok/ngrok/ngrok") | |
| return fmt.Errorf("ngrok not found — install it with: brew install ngrok") |
too many ngrok's?
ajrice6713
reviewed
Sep 25, 2026
Comment on lines
+132
to
+135
| appID, err := ensureVoiceApp(ctx, dashClient, acctID, "band-sample-"+name, | ||
| publicURL+"/webhooks/bandwidth/voice/initiate", | ||
| publicURL+"/webhooks/bandwidth/voice/status", | ||
| ) |
There was a problem hiding this comment.
Probably need to double check that these URLs are the same across all sample apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
band samplecommand group withlistandrunsubcommandsband sample run <name> --language <lang>clones a sample app, wires up Bandwidth credentials from the active band profile, starts an ngrok tunnel, creates a voice application, writes a populated.env, installs dependencies, and launches the app — all from one command--call-to <number>flag automatically dials a number once the app is healthylive-assistant(python) andvoice-gather(python, node, java)cmdutil.LoadRawCredentialsfor surfacing raw client credentials to external processes (e.g. writing.envfiles) without duplicating config/keychain logicMotivation
New Bandwidth users on Build accounts currently have to manually clone sample repos, figure out which env vars to set, find their credentials across multiple dashboard pages, set up ngrok, and configure a voice application before they can run a single sample. This collapses that entire flow into one command.
Usage
Test plan
band sample listshows the catalog with supported languagesband sample run live-assistant --language python --openai-key <key> --transfer-to <num>clones repo, starts ngrok, creates voice app, installs deps, runs app--call-to <num>automatically dials after the app health check passes--language unsupportedreturns a clear error listing valid optionsband sample listhintband auth logout→band sample runreturns a clear "not logged in" error🤖 Generated with Claude Code