Commit Graph

7 Commits

  • feat: allow switching approval modes when prompted to approve an edit/command (#400)
    Implements https://github.com/openai/codex/issues/392
    
    When the user is in suggest or auto-edit mode and gets an approval
    request, they now have an option in the `Shell Command` dialog to:
    `Switch approval mode (v)`
    
    That option brings up the standard `Switch approval mode` dialog,
    allowing the user to switch into the desired mode, then drops them back
    to the `Shell Command` dialog's `Allow command?` prompt, allowing them
    to approve the current command and let the agent continue doing the rest
    of what it was doing without interruption.
    ```
    ╭────────────────────────────────────────────────────────
    │Shell Command
    │                          
    │$ apply_patch << 'PATCH'    
    │*** Begin Patch                      
    │*** Update File: foo.txt          
    │@@ -1 +1 @@                         
    │-foo                                          
    │+bar                                         
    │*** End Patch                         
    │PATCH                                    
    │                                                
    │                                                
    │Allow command?                   
    │                                                
    │    Yes (y)                                
    │    Explain this command (x) 
    │    Edit or give feedback (e)  
    │    Switch approval mode (v)
    │    No, and keep going (n)    
    │    No, and stop for now (esc)
    ╰────────────────────────────────────────────────────────╭────────────────────────────────────────────────────────
    │ Switch approval mode      
    │ Current mode: suggest  
    │                                          
    │                                          
    │                                          
    │ ❯ suggest                        
    │   auto-edit                       
    │   full-auto                        
    │ type to search · enter to confirm · esc to cancel 
    ╰────────────────────────────────────────────────────────
    ```
  • fix: /bug report command, thinking indicator (#381)
    - Fix `/bug` report command
    - Fix thinking indicator
  • feat: shell command explanation option (#173)
    # Shell Command Explanation Option
    
    ## Description
    This PR adds an option to explain shell commands when the user is
    prompted to approve them (Fixes #110). When reviewing a shell command,
    users can now select "Explain this command" to get a detailed
    explanation of what the command does before deciding whether to approve
    or reject it.
    
    ## Changes
    - Added a new "EXPLAIN" option to the `ReviewDecision` enum
    - Updated the command review UI to include an "Explain this command (x)"
    option
    - Implemented the logic to send the command to the LLM for explanation
    using the same model as the agent
    - Added a display for the explanation in the command review UI
    - Updated all relevant components to pass the explanation through the
    component tree
    
    ## Benefits
    - Improves user understanding of shell commands before approving them
    - Reduces the risk of approving potentially harmful commands
    - Enhances the educational aspect of the tool, helping users learn about
    shell commands
    - Maintains the same workflow with minimal UI changes
    
    ## Testing
    - Manually tested the explanation feature with various shell commands
    - Verified that the explanation is displayed correctly in the UI
    - Confirmed that the user can still approve or reject the command after
    viewing the explanation
    
    ## Screenshots
    
    ![improved_shell_explanation_demo](https://github.com/user-attachments/assets/05923481-29db-4eba-9cc6-5e92301d2be0)
    
    
    ## Additional Notes
    The explanation is generated using the same model as the agent, ensuring
    consistency in the quality and style of explanations.
    
    ---------
    
    Signed-off-by: crazywolf132 <crazywolf132@gmail.com>
  • feat: add command history persistence (#152)
    This PR adds a command history persistence feature to Codex CLI that:
    
    1. **Stores command history**: Commands are saved to
    `~/.codex/history.json` and persist between CLI sessions.
    2. **Navigates history**: Users can use the up/down arrow keys to
    navigate through command history, similar to a traditional shell.
    3. **Filters sensitive data**: Built-in regex patterns prevent commands
    containing API keys, passwords, or tokens from being saved.
    4. **Configurable**: Added configuration options for history size,
    enabling/disabling history, and custom regex patterns for sensitive
    content.
    5. **New command**: Added `/clearhistory` command to clear command
    history.
    
      ## Code Changes
    
    - Added `src/utils/storage/command-history.ts` with functions for
    history management
      - Extended config system to support history settings
      - Updated terminal input components to use persistent history
      - Added help text for the new `/clearhistory` command
      - Added CLAUDE.md file for guidance when working with the codebase
    
      ## Testing
    
      - All tests are passing
    - Core functionality works with both input components (standard and
    multiline)
    - History navigation behaves correctly at line boundaries with the
    multiline editor
  • fix: typos in prompts and comments (#195)
    Used Codex and https://github.com/crate-ci/typos to identify + fix typos
    
    Signed-off-by: Jatan Loya <jatanloya@gmail.com>
  • fix: correct typos in thinking texts (transcendent & parroting) (#108)
    Ran codex on its own source code to find mistakes & commit, even though
    they are commented out.
  • Initial commit
    Signed-off-by: Ilan Bigio <ilan@openai.com>