Skip to content

Commit cb7fa1d

Browse files
g-linvillenjhale
andauthored
enhance: credential overrides: support multiple arguments (#593)
Signed-off-by: Grant Linville <[email protected]> Co-authored-by: Nick Hale <[email protected]>
1 parent 361ca9f commit cb7fa1d

File tree

11 files changed

+128
-127
lines changed

11 files changed

+128
-127
lines changed

docs/docs/03-tools/04-credential-tools.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ You can bypass credential tools and stored credentials by setting the `--credent
153153
need to be aware of which environment variables the credential tool sets. You can find this out by running the
154154
`gptscript credential --show-env-vars` command.
155155

156+
To override multiple credentials, specify the `--credential-override` argument multiple times.
157+
156158
### Format
157159

158160
:::info
@@ -171,10 +173,6 @@ The `--credential-override` argument must be formatted in one of the following t
171173
In this example, both `toolA` provides the variables `ENV_VAR_1` and `ENV_VAR_2`.
172174
This will set the environment variables `ENV_VAR_1` and `ENV_VAR_2` to the specific values `value1` and `value2`.
173175

174-
:::info
175-
To override more than one credential, use `;` as a separator. For example, `toolA:ENV_VAR_1=value1;toolB:ENV_VAR_2=value2`.
176-
:::
177-
178176
#### 2. Environment Variables
179177

180178
`toolA:ENV_VAR_1,ENV_VAR_2`

docs/docs/04-command-line-reference/gptscript.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ gptscript [flags] PROGRAM_FILE [INPUT...]
1919
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
2020
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
2121
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
22-
--credential-override string Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
22+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
2323
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
2424
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
2525
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")

docs/docs/04-command-line-reference/gptscript_eval.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ gptscript eval [flags]
2525
### Options inherited from parent commands
2626

2727
```
28-
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
29-
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
30-
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
31-
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
32-
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
33-
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
34-
--credential-override string Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
35-
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
36-
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
37-
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
38-
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
39-
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
40-
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
41-
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
42-
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
43-
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
44-
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
45-
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
46-
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
47-
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
48-
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
28+
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
29+
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
30+
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
31+
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
32+
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
33+
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
34+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
35+
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
36+
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
37+
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
38+
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
39+
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
40+
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
41+
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
42+
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
43+
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
44+
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
45+
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
46+
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
47+
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
48+
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
4949
```
5050

5151
### SEE ALSO

docs/docs/04-command-line-reference/gptscript_fmt.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ gptscript fmt [flags]
1919
### Options inherited from parent commands
2020

2121
```
22-
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
23-
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
24-
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
25-
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
26-
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
27-
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
28-
--credential-override string Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
29-
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
30-
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
31-
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
32-
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
33-
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
34-
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
35-
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
36-
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
37-
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
38-
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
39-
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
40-
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
41-
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
42-
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
22+
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
23+
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
24+
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
25+
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
26+
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
27+
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
28+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
29+
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
30+
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
31+
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
32+
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
33+
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
34+
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
35+
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
36+
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
37+
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
38+
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
39+
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
40+
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
41+
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
42+
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
4343
```
4444

4545
### SEE ALSO

docs/docs/04-command-line-reference/gptscript_parse.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ gptscript parse [flags]
1919
### Options inherited from parent commands
2020

2121
```
22-
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
23-
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
24-
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
25-
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
26-
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
27-
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
28-
--credential-override string Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
29-
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
30-
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
31-
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
32-
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
33-
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
34-
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
35-
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
36-
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
37-
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
38-
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
39-
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
40-
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
41-
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
42-
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
22+
--cache-dir string Directory to store cache (default: $XDG_CACHE_HOME/gptscript) ($GPTSCRIPT_CACHE_DIR)
23+
-C, --chdir string Change current working directory ($GPTSCRIPT_CHDIR)
24+
--color Use color in output (default true) ($GPTSCRIPT_COLOR)
25+
--config string Path to GPTScript config file ($GPTSCRIPT_CONFIG)
26+
--confirm Prompt before running potentially dangerous commands ($GPTSCRIPT_CONFIRM)
27+
--credential-context string Context name in which to store credentials ($GPTSCRIPT_CREDENTIAL_CONTEXT) (default "default")
28+
--credential-override strings Credentials to override (ex: --credential-override github.com/example/cred-tool:API_TOKEN=1234) ($GPTSCRIPT_CREDENTIAL_OVERRIDE)
29+
--debug Enable debug logging ($GPTSCRIPT_DEBUG)
30+
--debug-messages Enable logging of chat completion calls ($GPTSCRIPT_DEBUG_MESSAGES)
31+
--default-model string Default LLM model to use ($GPTSCRIPT_DEFAULT_MODEL) (default "gpt-4o")
32+
--disable-cache Disable caching of LLM API responses ($GPTSCRIPT_DISABLE_CACHE)
33+
--dump-state string Dump the internal execution state to a file ($GPTSCRIPT_DUMP_STATE)
34+
--events-stream-to string Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\.\pipe\my-pipe) ($GPTSCRIPT_EVENTS_STREAM_TO)
35+
-f, --input string Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT_FILE)
36+
--no-trunc Do not truncate long log messages ($GPTSCRIPT_NO_TRUNC)
37+
--openai-api-key string OpenAI API KEY ($OPENAI_API_KEY)
38+
--openai-base-url string OpenAI base URL ($OPENAI_BASE_URL)
39+
--openai-org-id string OpenAI organization ID ($OPENAI_ORG_ID)
40+
-o, --output string Save output to a file, or - for stdout ($GPTSCRIPT_OUTPUT)
41+
-q, --quiet No output logging (set --quiet=false to force on even when there is no TTY) ($GPTSCRIPT_QUIET)
42+
--workspace string Directory to use for the workspace, if specified it will not be deleted on exit ($GPTSCRIPT_WORKSPACE)
4343
```
4444

4545
### SEE ALSO

0 commit comments

Comments
 (0)