Skip to content

feat: add custom execution command settings for CLI providers#686

Merged
arnestrickmann merged 11 commits intogeneralaction:mainfrom
Devdha:feature/custom-execution-command-for-each-tool-59u
Feb 12, 2026
Merged

feat: add custom execution command settings for CLI providers#686
arnestrickmann merged 11 commits intogeneralaction:mainfrom
Devdha:feature/custom-execution-command-for-each-tool-59u

Conversation

@Devdha
Copy link
Contributor

@Devdha Devdha commented Jan 22, 2026

Issue #685

Summary

Add the ability to customize CLI execution commands for each provider in Settings > Connections. Users can now override:

  • CLI command path
  • Resume flag
  • Default arguments
  • Auto-approve flag (e.g., --yolo for Codex instead of --full-auto)
  • Initial prompt flag

This addresses #659 and similar requests for custom CLI flags.

Changes

  • src/main/settings.ts - Add ProviderCustomConfig type and CRUD functions with cache-safe getters
  • src/main/ipc/connectionsIpc.ts - Add IPC handlers for get/update custom configs
  • src/main/preload.ts - Expose APIs to renderer
  • src/main/services/ptyManager.ts - Add parseShellArgs() for proper shell-style argument parsing (supports quoted strings)
  • src/renderer/components/CustomCommandModal.tsx - New modal with granular flag configuration and live preview
  • src/renderer/components/CliProvidersList.tsx - Add settings gear icon for detected providers
  • src/renderer/types/electron-api.d.ts - TypeScript definitions

Screenshots

CleanShot 2026-01-22 at 19 18 20 CleanShot 2026-01-22 at 18 46 09

- Add ProviderCustomConfig interface for storing custom CLI flags
- Add getProviderCustomConfig and getAllProviderCustomConfigs functions
- Add updateProviderCustomConfig function for CRUD operations
- Return shallow/deep copies from getter functions to prevent cache corruption
- Normalize custom config values in normalizeSettings function
- Add providers:getCustomConfig handler to retrieve single config
- Add providers:getAllCustomConfigs handler to retrieve all configs
- Add providers:updateCustomConfig handler to update/delete config
- Expose APIs to renderer via preload contextBridge
- Add ProviderCustomConfig and ProviderCustomConfigs types
- Add type definitions for getProviderCustomConfig
- Add type definitions for getAllProviderCustomConfigs
- Add type definitions for updateProviderCustomConfig
- Add parseShellArgs function for proper shell argument parsing
- Support single quotes, double quotes, and escape characters
- Apply custom provider config overrides at command execution time
- Use parseShellArgs for resumeFlag, defaultArgs, autoApproveFlag, initialPromptFlag
- Add CustomCommandModal component with granular flag configuration
- Add Escape key handler for modal dismissal
- Add settings button to detected providers in CliProvidersList
- Add command preview, reset to defaults, and save functionality
- Improve accessibility with aria-label on tooltip buttons
@Devdha
Copy link
Contributor Author

Devdha commented Jan 22, 2026

cc @JKamsker - This addresses your request in #659 for using --yolo with Codex. With this PR, you can customize the auto-approve flag (and other CLI flags) per provider in Settings > Connections.

@vercel
Copy link

vercel bot commented Jan 26, 2026

@Devdha is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@JKamsker
Copy link
Contributor

Imho thats not good UX. I mean, yes an "advanced mode" would be beneficial, but forcing the cli onto every user is a bad decision imho.

@Devdha
Copy link
Contributor Author

Devdha commented Jan 26, 2026

@JKamsker

Thanks for the feedback! I think there may be a misunderstanding.

This PR doesn't force anything. the default behavior remains exactly the same. The customize icon only appears for users who want to customize. If you never click it, nothing changes.
(I just wanted to use a agent with customized flag command. like new flag '--enable collab' in codex)

It's essentially an optional "advanced settings" panel hidden unless explicitly opened.

arnestrickmann and others added 2 commits February 12, 2026 11:13
Keep both providerConfigs (from PR) and terminal/defaultOpenInApp (from main).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@arnestrickmann
Copy link
Contributor

Thank you! @Devdha

@arnestrickmann
Copy link
Contributor

@greptile pls review

@greptile-apps
Copy link

greptile-apps bot commented Feb 12, 2026

Greptile Overview

Greptile Summary

This PR adds the ability to customize CLI execution commands for each provider in Settings > Connections, allowing users to override CLI paths, flags, and arguments.

Key Changes

  • Settings persistence: Added ProviderCustomConfig type and CRUD functions in settings.ts with proper normalization and cache-safe shallow/deep copies to prevent external mutation
  • Shell argument parsing: Implemented parseShellArgs() function in ptyManager.ts to handle shell-style argument parsing with quote support (single, double) and escape characters
  • Command construction: Integrated custom config resolution into PTY command building, where custom configs override provider defaults; empty strings disable flags
  • UI: New CustomCommandModal component with granular field configuration, live command preview, reset to defaults, and smart save (removes custom config if all fields match defaults)
  • IPC layer: Added three new handlers (getProviderCustomConfig, getAllProviderCustomConfigs, updateProviderCustomConfig) with standard error handling pattern

Issues Found

  • parseShellArgs() has two logical errors: (1) Trailing backslash at end of input is not handled correctly, (2) Unclosed quotes silently produce incomplete results without validation

Confidence Score: 4/5

  • This PR is generally safe to merge with minor fixes needed
  • The implementation follows established patterns in the codebase (IPC handlers, settings CRUD, shallow/deep copy for cache safety). However, the parseShellArgs() function has two logical issues with edge cases (trailing backslash, unclosed quotes) that should be fixed to prevent silent failures when users enter malformed input. The core feature is well-designed and the UI provides good guardrails.
  • Pay close attention to src/main/services/ptyManager.ts - fix the parseShellArgs() edge cases before merging

Important Files Changed

Filename Overview
src/main/settings.ts Added ProviderCustomConfig type and CRUD functions with proper normalization and cache-safe getters
src/main/ipc/connectionsIpc.ts Added IPC handlers for getting and updating provider custom configs with standard error handling
src/main/services/ptyManager.ts Added parseShellArgs function and integrated custom config resolution into command construction; uses same escaping pattern as existing code
src/renderer/components/CustomCommandModal.tsx New modal component with granular flag configuration, live preview, and reset functionality

Sequence Diagram

sequenceDiagram
    participant User
    participant CliAgentsList
    participant CustomCommandModal
    participant IPC
    participant Settings
    participant PtyManager

    User->>CliAgentsList: Click settings icon
    CliAgentsList->>CustomCommandModal: Open modal with providerId
    CustomCommandModal->>IPC: getProviderCustomConfig(providerId)
    IPC->>Settings: getProviderCustomConfig(providerId)
    Settings-->>IPC: config or undefined
    IPC-->>CustomCommandModal: { success, config }
    CustomCommandModal->>CustomCommandModal: Load form with config or defaults
    
    User->>CustomCommandModal: Edit fields
    CustomCommandModal->>CustomCommandModal: Update preview command
    
    User->>CustomCommandModal: Click Save
    CustomCommandModal->>IPC: updateProviderCustomConfig(providerId, config)
    IPC->>Settings: updateProviderCustomConfig(providerId, config)
    Settings->>Settings: Update settings.json
    Settings-->>IPC: success
    IPC-->>CustomCommandModal: { success }
    CustomCommandModal->>CliAgentsList: Close modal
    
    User->>CliAgentsList: Start agent task
    CliAgentsList->>PtyManager: startPty(options)
    PtyManager->>Settings: getProviderCustomConfig(providerId)
    Settings-->>PtyManager: custom config
    PtyManager->>PtyManager: parseShellArgs(customConfig.*)
    PtyManager->>PtyManager: Resolve flags (custom overrides defaults)
    PtyManager->>PtyManager: Build command with resolved flags
    PtyManager-->>CliAgentsList: PTY with custom command
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

arnestrickmann and others added 2 commits February 12, 2026 11:27
…seShellArgs

address greptile review feedback (greploop iteration 1)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@arnestrickmann arnestrickmann merged commit 7d0dc93 into generalaction:main Feb 12, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants