on main help sign in
rename to use toplevel permissions
commit70159438d46e6d02a3f3fcf62bf2e7795a002437 authorTai Groot <tai@taigrr.com> dateThu 24 Jul 2025, 00:02 (1 year ago) parentbc6fadc
2 files changed+10−5
internal/app/app.go+2−2 internal/config/config.go+8−3
internal/app/app.go+2−2
@@ -61,8 +61,8 @@ func New(ctx context.Context, conn *sql.DB, cfg *config.Config) (*App, error) {
6161 files := history.NewService(q, conn)
6262 skipPermissionsRequests := cfg.Options != nil && cfg.Options.SkipPermissionsRequests
6363 allowedCommands := []string{}
64− if cfg.Options != nil && cfg.Options.AllowedCommands != nil {
65− allowedCommands = cfg.Options.AllowedCommands
64+ if cfg.Permissions != nil && cfg.Permissions.AllowedTools != nil {
65+ allowedCommands = cfg.Permissions.AllowedTools
6666 }
6767
6868 app := &App{
internal/config/config.go+8−3
@@ -120,15 +120,18 @@ type TUIOptions struct {
120120 // Here we can add themes later or any TUI related options
121121}
122122
123+type Permissions struct {
124+ AllowedTools []string `json:"allowed_tools,omitempty"` // Tools that don't require permission prompts
125+}
126+
123127type Options struct {
124128 ContextPaths []string `json:"context_paths,omitempty"`
125129 TUI *TUIOptions `json:"tui,omitempty"`
126130 Debug bool `json:"debug,omitempty"`
127131 DebugLSP bool `json:"debug_lsp,omitempty"`
128132 DisableAutoSummarize bool `json:"disable_auto_summarize,omitempty"`
129− DataDirectory string `json:"data_directory,omitempty"` // Relative to the cwd
130− SkipPermissionsRequests bool `json:"-"` // Automatically accept all permissions (YOLO mode)
131− AllowedCommands []string `json:"allowed_commands,omitempty"` // Commands that don't require permission prompts
133+ DataDirectory string `json:"data_directory,omitempty"` // Relative to the cwd
134+ SkipPermissionsRequests bool `json:"-"` // Automatically accept all permissions (YOLO mode)
132135}
133136
134137type MCPs map[string]MCPConfig
@@ -245,6 +248,8 @@ type Config struct {
245248
246249 Options *Options `json:"options,omitempty"`
247250
251+ Permissions *Permissions `json:"permissions,omitempty"`
252+
248253 // Internal
249254 workingDir string `json:"-"`
250255 // TODO: most likely remove this concept when I come back to it