You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rootCmd.Flags().StringArrayVar(&addDirs, "add-dir", nil, "additional directories to include in session context")
163
170
rootCmd.Flags().StringArrayVar(&mcpServers, "mcp", nil, "MCP server command")
164
171
rootCmd.Flags().StringArrayVar(&toolsFlag, "tools", nil, `available tools: "" disables all tools, "default" enables all, or names like "Bash,Edit,Read"`)
165
-
rootCmd.Flags().StringArrayVar(&allowedToolsFlag, "allowedTools", nil, `comma or space-separated tool permission rules to allow (e.g. "Bash(git:*) Edit")`)
166
172
rootCmd.Flags().StringArrayVar(&allowedToolsFlag, "allowed-tools", nil, `comma or space-separated tool permission rules to allow (e.g. "Bash(git:*) Edit")`)
167
-
rootCmd.Flags().StringArrayVar(&disallowedToolsFlag, "disallowedTools", nil, `comma or space-separated tool permission rules to deny (e.g. "Bash(git:*) Edit")`)
168
173
rootCmd.Flags().StringArrayVar(&disallowedToolsFlag, "disallowed-tools", nil, `comma or space-separated tool permission rules to deny (e.g. "Bash(git:*) Edit")`)
rootCmd.Flags().BoolVar(&dangerouslySkipPermissions, "dangerously-skip-permissions", false, "bypass all permission checks")
@@ -190,6 +195,7 @@ func init() {
190
195
rootCmd.Flags().BoolVar(&refreshCatalogFlag, "refresh-catalog", false, "refresh the eyrie model catalog before starting")
191
196
rootCmd.Flags().BoolVar(&skipCatalogRefreshFlag, "no-auto-catalog-refresh", false, "disable automatic catalog refresh when cache is missing, empty, or stale")
192
197
rootCmd.Flags().BoolVar(&recoverFlag, "recover", false, "scan for interrupted sessions and offer to resume")
198
+
rootCmd.Flags().BoolVar(&allowProjectMCP, "allow-project-mcp", false, "allow MCP servers defined in project-level .hawk/settings.json (security risk)")
193
199
rootCmd.AddCommand(versionCmd)
194
200
rootCmd.AddCommand(setupCmd)
195
201
rootCmd.AddCommand(doctorCmd)
@@ -222,6 +228,38 @@ func init() {
222
228
rootCmd.AddCommand(recoverCmd)
223
229
}
224
230
231
+
// confirmDangerousSkipPermissions enforces a safety guard when --dangerously-skip-permissions is set.
232
+
// In a terminal, it prompts for interactive confirmation. In non-interactive mode (CI, scripts),
233
+
// it requires the HAWK_DANGEROUSLY_SKIP_PERMISSIONS=1 environment variable.
234
+
funcconfirmDangerousSkipPermissions() error {
235
+
ifisStdinTerminal() {
236
+
fmt.Fprint(os.Stderr, "Are you sure? This disables all safety checks [y/N]: ")
0 commit comments