Conversation
Signed-off-by: Richard Chien <stdrc@outlook.com>
There was a problem hiding this comment.
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
/yolometa 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) | ||
|
|
There was a problem hiding this comment.
[nitpick] Consider adding logging for consistency with other meta commands like /init and /compact. For example:
logger.info("Running `/yolo`")| logger.info("Running `/yolo`") |
| """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!") | ||
|
|
||
|
|
There was a problem hiding this comment.
[nitpick] The /yolo command only allows enabling YOLO mode but doesn't provide a way to disable it. Consider either:
- Making this command toggle YOLO mode on/off
- Adding a separate
/no-yolocommand to disable it - Accepting an optional argument to control the state (e.g.,
/yolo onor/yolo off)
This would improve usability by allowing users to revert the setting without restarting the session.
| """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]") |
Related Issue
Resolve #(issue_number)
Description