(cmd *cobra.Command, runConfig *config.RuntimeConfig)
| 26 | ) |
| 27 | |
| 28 | func 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 | |
| 47 | func setupWorkingDirectory(workingDir string) error { |
| 48 | if workingDir == "" { |
no test coverage detected