diff --git a/main.go b/main.go index 273a0f3..da83d19 100644 --- a/main.go +++ b/main.go @@ -40,9 +40,10 @@ type cliConfig struct { } var ( - integration = os.Getenv("INTEGRATION") - env = os.Getenv("ENV") - scope = os.Getenv("SCOPE") + integration = os.Getenv("INTEGRATION") + env = os.Getenv("ENV") + scope = os.Getenv("SCOPE") + optionalScope = os.Getenv("OPTIONAL_SCOPE") ) func main() { @@ -100,6 +101,9 @@ func main() { if scope != "" { q.Set("scope", scope) } + if optionalScope != "" { + q.Set("optional_scope", optionalScope) + } u.RawQuery = q.Encode() req, err := http.NewRequest("GET", u.String(), nil) @@ -179,6 +183,9 @@ func main() { if scope != "" { q.Set("scope", scope) } + if optionalScope != "" { + q.Set("optional_scope", optionalScope) + } u.RawQuery = q.Encode() gs, err := gptscript.NewGPTScript(gptscript.GlobalOptions{}) diff --git a/tool.gpt b/tool.gpt index 471407f..cf3f089 100644 --- a/tool.gpt +++ b/tool.gpt @@ -2,5 +2,6 @@ Name: oauth2 Param: integration: Name of the integration to use Param: env: Name of the environment variable to set with the token Param: scope: Space-separated list of scopes to request +Param: optional_scope: (optional) Space-separated list of scopes to request (HubSpot-specific) #!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool