Skip to content

Commit 70fe5f5

Browse files
committed
feat: add support for customer URLs
1 parent d9a3d63 commit 70fe5f5

49 files changed

Lines changed: 534 additions & 1255 deletions

Some content is hidden

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

cmd/cmdutils/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
log "github.com/sirupsen/logrus"
66
"github.com/xavidop/voiceflow-cli/internal/global"
77
"github.com/xavidop/voiceflow-cli/internal/utils"
8+
voiceflowauth "github.com/xavidop/voiceflow-cli/internal/voiceflow"
89
)
910

1011
func CheckUpdate(output bool) {
@@ -55,4 +56,7 @@ func PreRun(command string) {
5556
if !global.SkipUpdate && command != "version" {
5657
CheckUpdate(false)
5758
}
59+
60+
// Populate custom URL overrides from environment variables
61+
voiceflowauth.SetVoiceflowURLOverrides()
5862
}

cmd/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func init() {
7070
rootCmd.PersistentFlags().StringVarP(&global.OpenAIAPIKey, "open-api-key", "z", "", "Open API Key (optional)")
7171
rootCmd.PersistentFlags().StringVar(&global.OpenAIBaseURL, "openai-base-url", "", "OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)")
7272
rootCmd.PersistentFlags().StringVarP(&global.VoiceflowSubdomain, "voiceflow-subdomain", "b", "", "Voiceflow Base URL (optional). Default: empty")
73+
rootCmd.PersistentFlags().StringVar(&global.VoiceflowAPIURL, "voiceflow-api-url", "", "Custom base URL for the Voiceflow API (creator-api), (optional)")
74+
rootCmd.PersistentFlags().StringVar(&global.VoiceflowRuntimeURL, "voiceflow-runtime-url", "", "Custom base URL for the Voiceflow general-runtime (optional)")
75+
rootCmd.PersistentFlags().StringVar(&global.VoiceflowAnalyticsURL, "voiceflow-analytics-url", "", "Custom base URL for the Voiceflow analytics API (optional)")
7376
rootCmd.PersistentFlags().BoolVarP(&global.SkipUpdate, "skip-update-check", "u", false, "Skip the check for updates check run before every command (optional)")
7477
rootCmd.PersistentFlags().StringVarP(&global.Output, "output-format", "o", "text", "Output Format. Options: text, json. Default: text (optional)")
7578
rootCmd.PersistentFlags().BoolVar(&global.ShowTesterMessages, "show-tester-messages", true, "Show tester agent messages in agent-to-agent tests (optional)")

docs/docs/cmd/voiceflow.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ voiceflow [flags]
2020
## Options
2121

2222
```
23-
-h, --help help for voiceflow
24-
-z, --open-api-key string Open API Key (optional)
25-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
26-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
27-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
28-
-v, --verbose verbose error output (with stack trace) (optional)
29-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
30-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
23+
-h, --help help for voiceflow
24+
-z, --open-api-key string Open API Key (optional)
25+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
26+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
27+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
28+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
29+
-v, --verbose verbose error output (with stack trace) (optional)
30+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
31+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
32+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
33+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
34+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
3135
```
3236

3337
## See also

docs/docs/cmd/voiceflow_agent.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ voiceflow agent [flags]
1515
## Options inherited from parent commands
1616

1717
```
18-
-z, --open-api-key string Open API Key (optional)
19-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
20-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
21-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
22-
-v, --verbose verbose error output (with stack trace) (optional)
23-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
24-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
18+
-z, --open-api-key string Open API Key (optional)
19+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
20+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
21+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
22+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
23+
-v, --verbose verbose error output (with stack trace) (optional)
24+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
25+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
26+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
27+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
28+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
2529
```
2630

2731
## See also

docs/docs/cmd/voiceflow_agent_export.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ voiceflow agent export [flags]
1818
## Options inherited from parent commands
1919

2020
```
21-
-z, --open-api-key string Open API Key (optional)
22-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
23-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
24-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
25-
-v, --verbose verbose error output (with stack trace) (optional)
26-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
27-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
21+
-z, --open-api-key string Open API Key (optional)
22+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
23+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
24+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
25+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
26+
-v, --verbose verbose error output (with stack trace) (optional)
27+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
28+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
29+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
30+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
31+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
2832
```
2933

3034
## See also

docs/docs/cmd/voiceflow_analytics.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ voiceflow analytics [flags]
1515
## Options inherited from parent commands
1616

1717
```
18-
-z, --open-api-key string Open API Key (optional)
19-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
20-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
21-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
22-
-v, --verbose verbose error output (with stack trace) (optional)
23-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
24-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
18+
-z, --open-api-key string Open API Key (optional)
19+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
20+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
21+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
22+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
23+
-v, --verbose verbose error output (with stack trace) (optional)
24+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
25+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
26+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
27+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
28+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
2529
```
2630

2731
## See also

docs/docs/cmd/voiceflow_analytics_fetch.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ voiceflow analytics fetch [flags]
2121
## Options inherited from parent commands
2222

2323
```
24-
-z, --open-api-key string Open API Key (optional)
25-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
26-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
27-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
28-
-v, --verbose verbose error output (with stack trace) (optional)
29-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
30-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
24+
-z, --open-api-key string Open API Key (optional)
25+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
26+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
27+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
28+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
29+
-v, --verbose verbose error output (with stack trace) (optional)
30+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
31+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
32+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
33+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
34+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
3135
```
3236

3337
## See also

docs/docs/cmd/voiceflow_completion.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ See each sub-command's help for details on how to use the generated script.
1717
## Options inherited from parent commands
1818

1919
```
20-
-z, --open-api-key string Open API Key (optional)
21-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
22-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
23-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
24-
-v, --verbose verbose error output (with stack trace) (optional)
25-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
26-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
20+
-z, --open-api-key string Open API Key (optional)
21+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
22+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
23+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
24+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
25+
-v, --verbose verbose error output (with stack trace) (optional)
26+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
27+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
28+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
29+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
30+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
2731
```
2832

2933
## See also

docs/docs/cmd/voiceflow_completion_bash.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ voiceflow completion bash
4040
## Options inherited from parent commands
4141

4242
```
43-
-z, --open-api-key string Open API Key (optional)
44-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
45-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
46-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
47-
-v, --verbose verbose error output (with stack trace) (optional)
48-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
49-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
43+
-z, --open-api-key string Open API Key (optional)
44+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
45+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
46+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
47+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
48+
-v, --verbose verbose error output (with stack trace) (optional)
49+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
50+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
51+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
52+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
53+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
5054
```
5155

5256
## See also

docs/docs/cmd/voiceflow_completion_fish.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ voiceflow completion fish [flags]
3131
## Options inherited from parent commands
3232

3333
```
34-
-z, --open-api-key string Open API Key (optional)
35-
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
36-
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
37-
-u, --skip-update-check Skip the check for updates check run before every command (optional)
38-
-v, --verbose verbose error output (with stack trace) (optional)
39-
-x, --voiceflow-api-key string Voiceflow API Key (optional)
40-
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
34+
-z, --open-api-key string Open API Key (optional)
35+
--openai-base-url string OpenAI API base URL override, e.g. https://eu.api.openai.com/v1 (optional)
36+
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
37+
--show-tester-messages Show tester agent messages in agent-to-agent tests (optional) (default true)
38+
-u, --skip-update-check Skip the check for updates check run before every command (optional)
39+
-v, --verbose verbose error output (with stack trace) (optional)
40+
--voiceflow-analytics-url string Custom base URL for the Voiceflow analytics API (optional)
41+
-x, --voiceflow-api-key string Voiceflow API Key (optional)
42+
--voiceflow-api-url string Custom base URL for the Voiceflow API (creator-api), (optional)
43+
--voiceflow-runtime-url string Custom base URL for the Voiceflow general-runtime (optional)
44+
-b, --voiceflow-subdomain string Voiceflow Base URL (optional). Default: empty
4145
```
4246

4347
## See also

0 commit comments

Comments
 (0)