From 0795e55f0e7d2f2822bcd83eaf066eb99c67f858 Mon Sep 17 00:00:00 2001
From: Tolik Malibroda <54813212+tolikmalibroda@users.noreply.github.com>
Date: Mon, 2 Jun 2025 22:05:45 +0200
Subject: feat: Add --yolo mode that automatically accepts all tools executions
 (#695)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
---
 .../cli/src/ui/components/AutoAcceptIndicator.tsx  | 45 ++++++++++++++++++----
 1 file changed, 37 insertions(+), 8 deletions(-)

(limited to 'packages/cli/src/ui/components/AutoAcceptIndicator.tsx')

diff --git a/packages/cli/src/ui/components/AutoAcceptIndicator.tsx b/packages/cli/src/ui/components/AutoAcceptIndicator.tsx
index dc23d5e2..dbdb3e9a 100644
--- a/packages/cli/src/ui/components/AutoAcceptIndicator.tsx
+++ b/packages/cli/src/ui/components/AutoAcceptIndicator.tsx
@@ -7,12 +7,41 @@
 import React from 'react';
 import { Box, Text } from 'ink';
 import { Colors } from '../colors.js';
+import { ApprovalMode } from '@gemini-code/core';
 
-export const AutoAcceptIndicator: React.FC = () => (
-  <Box>
-    <Text color={Colors.AccentGreen}>
-      accepting edits
-      <Text color={Colors.SubtleComment}> (shift + tab to disable)</Text>
-    </Text>
-  </Box>
-);
+interface AutoAcceptIndicatorProps {
+  approvalMode: ApprovalMode;
+}
+
+export const AutoAcceptIndicator: React.FC<AutoAcceptIndicatorProps> = ({
+  approvalMode,
+}) => {
+  let textColor = '';
+  let textContent = '';
+  let subText = '';
+
+  switch (approvalMode) {
+    case ApprovalMode.AUTO_EDIT:
+      textColor = Colors.AccentGreen;
+      textContent = 'accepting edits';
+      subText = ' (shift + tab to toggle)';
+      break;
+    case ApprovalMode.YOLO:
+      textColor = Colors.AccentRed;
+      textContent = 'YOLO mode';
+      subText = ' (ctrl + y to toggle)';
+      break;
+    case ApprovalMode.DEFAULT:
+    default:
+      break;
+  }
+
+  return (
+    <Box>
+      <Text color={textColor}>
+        {textContent}
+        {subText && <Text color={Colors.SubtleComment}>{subText}</Text>}
+      </Text>
+    </Box>
+  );
+};
-- 
cgit v1.2.3

