MCPcopy Index your code
hub / github.com/docker/docker-agent / addRuntimeConfigFlags

Function addRuntimeConfigFlags

cmd/root/flags.go:28–45  ·  view source on GitHub ↗
(cmd *cobra.Command, runConfig *config.RuntimeConfig)

Source from the content-addressed store, hash-verified

26)
27
28func addRuntimeConfigFlags(cmd *cobra.Command, runConfig *config.RuntimeConfig) {
29 addGatewayFlags(cmd, runConfig, userconfig.Load)
30 cmd.PersistentFlags().StringSliceVar(&runConfig.EnvFiles, "env-from-file", nil, "Set environment variables from file")
31 cmd.PersistentFlags().BoolVar(&runConfig.GlobalCodeMode, "code-mode-tools", false, "Provide a single tool to call other tools via Javascript")
32 cmd.PersistentFlags().StringVar(&runConfig.WorkingDir, "working-dir", "", "Set the working directory for the session (applies to tools and relative paths)")
33 cmd.PersistentFlags().StringArrayVar(&runConfig.HookPreToolUse, "hook-pre-tool-use", nil, "Add a pre-tool-use hook command that runs before every tool call (repeatable)")
34 cmd.PersistentFlags().StringArrayVar(&runConfig.HookPostToolUse, "hook-post-tool-use", nil, "Add a post-tool-use hook command that runs after every tool call (repeatable)")
35 cmd.PersistentFlags().StringArrayVar(&runConfig.HookSessionStart, "hook-session-start", nil, "Add a session-start hook command (repeatable)")
36 cmd.PersistentFlags().StringArrayVar(&runConfig.HookSessionEnd, "hook-session-end", nil, "Add a session-end hook command (repeatable)")
37 cmd.PersistentFlags().StringArrayVar(&runConfig.HookOnUserInput, "hook-on-user-input", nil, "Add an on-user-input hook command (repeatable)")
38 cmd.PersistentFlags().StringArrayVar(&runConfig.HookStop, "hook-stop", nil, "Add a stop hook command, fired when the model finishes responding (repeatable)")
39 cmd.PersistentFlags().StringVar(&runConfig.MCPOAuthRedirectURI, "mcp-oauth-redirect-uri", "",
40 "Public HTTPS URL to advertise as the OAuth `redirect_uri` for MCP servers "+
41 "running in unmanaged OAuth mode. When set, docker-agent drives the OAuth flow "+
42 "itself (PKCE + DCR + token exchange) and expects clients to return `{code, state}` "+
43 "via ResumeElicitation. When empty, the client is expected to perform the OAuth "+
44 "flow and return an access token (legacy behavior).")
45}
46
47func setupWorkingDirectory(workingDir string) error {
48 if workingDir == "" {

Callers 10

newAPICmdFunction · 0.85
newACPCmdFunction · 0.85
newNewCmdFunction · 0.85
newDebugCmdFunction · 0.85
newDebugOAuthLoginCmdFunction · 0.85
newChatCmdFunction · 0.85
newA2ACmdFunction · 0.85
newEvalCmdFunction · 0.85
newRunCmdFunction · 0.85
newMCPCmdFunction · 0.85

Calls 1

addGatewayFlagsFunction · 0.85

Tested by

no test coverage detected