Skip to content

feat: add /yolo meta command#258

Merged
stdrc merged 1 commit intomainfrom
rc/yolo-command
Nov 12, 2025
Merged

feat: add /yolo meta command#258
stdrc merged 1 commit intomainfrom
rc/yolo-command

Conversation

@stdrc
Copy link
Copy Markdown
Contributor

@stdrc stdrc commented Nov 12, 2025

Related Issue

Resolve #(issue_number)

Description

Signed-off-by: Richard Chien <stdrc@outlook.com>
Copilot AI review requested due to automatic review settings November 12, 2025 08:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a /yolo meta command to enable YOLO (auto-approve all actions) mode after the CLI has started, complementing the existing --yolo command-line flag that sets this mode on startup.

  • Implements the /yolo meta command as a kimi_soul_only command
  • Updates the CHANGELOG to document the new feature

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/kimi_cli/ui/shell/metacmd.py Adds the new yolo() async function that enables YOLO mode by calling set_yolo(True) on the approval system
CHANGELOG.md Documents the addition of the /yolo meta command in the Unreleased section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

async def yolo(app: ShellApp, args: list[str]):
"""Enable YOLO mode (auto approve all actions)"""
assert isinstance(app.soul, KimiSoul)

Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding logging for consistency with other meta commands like /init and /compact. For example:

logger.info("Running `/yolo`")
Suggested change
logger.info("Running `/yolo`")

Copilot uses AI. Check for mistakes.
Comment on lines +262 to +268
"""Enable YOLO mode (auto approve all actions)"""
assert isinstance(app.soul, KimiSoul)

app.soul._runtime.approval.set_yolo(True)
console.print("[green]✓[/green] Life is short, use YOLO!")


Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

[nitpick] The /yolo command only allows enabling YOLO mode but doesn't provide a way to disable it. Consider either:

  1. Making this command toggle YOLO mode on/off
  2. Adding a separate /no-yolo command to disable it
  3. Accepting an optional argument to control the state (e.g., /yolo on or /yolo off)

This would improve usability by allowing users to revert the setting without restarting the session.

Suggested change
"""Enable YOLO mode (auto approve all actions)"""
assert isinstance(app.soul, KimiSoul)
app.soul._runtime.approval.set_yolo(True)
console.print("[green]✓[/green] Life is short, use YOLO!")
"""Enable or disable YOLO mode (auto approve all actions)
Usage:
/yolo # enable YOLO mode
/yolo on # enable YOLO mode
/yolo off # disable YOLO mode
"""
assert isinstance(app.soul, KimiSoul)
# Determine desired state
if not args or (args[0].lower() in {"on", "enable"}):
app.soul._runtime.approval.set_yolo(True)
console.print("[green]✓[/green] Life is short, use YOLO!")
elif args[0].lower() in {"off", "disable"}:
app.soul._runtime.approval.set_yolo(False)
console.print("[yellow]YOLO mode disabled.[/yellow]")
else:
console.print("[red]Invalid argument. Use `/yolo [on|off]`.[/red]")

Copilot uses AI. Check for mistakes.
@stdrc stdrc merged commit 61fd641 into main Nov 12, 2025
11 checks passed
@stdrc stdrc deleted the rc/yolo-command branch November 12, 2025 08:31
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.

2 participants