Skip to content

feat(cli): add /clear command to clear terminal screen#968

Merged
ErikBjare merged 1 commit intogptme:masterfrom
TimeToBuildBob:feat-clear-command
Dec 18, 2025
Merged

feat(cli): add /clear command to clear terminal screen#968
ErikBjare merged 1 commit intogptme:masterfrom
TimeToBuildBob:feat-clear-command

Conversation

@TimeToBuildBob
Copy link
Copy Markdown
Member

@TimeToBuildBob TimeToBuildBob commented Dec 17, 2025

Summary

Implements Issue #963 - adds a /clear command (with /cls alias) that clears the terminal screen using ANSI escape codes.

Changes

  • Added clear to the Actions type in commands.py
  • Added /clear command with /cls alias
  • Uses ANSI escape codes (\033[2J\033[H) for cross-platform terminal clearing

Features

  • /clear - clears the terminal screen
  • /cls - alias for Windows users familiar with that command

Testing

  • All existing tests pass (24 passed, 2 xfailed)
  • Command properly registered and visible in command list

Closes #963


Important

Adds /clear command and /cls alias in commands.py to clear the terminal screen using ANSI escape codes, ensuring cross-platform compatibility.

  • Behavior:
    • Adds /clear command and /cls alias in commands.py to clear the terminal screen using ANSI escape codes (\033[2J\033[H).
  • Commands:
    • Registers clear in Actions and action_descriptions in commands.py.
    • Implements cmd_clear() function in commands.py to execute the clear command.
  • Testing:
    • Confirms all existing tests pass (24 passed, 2 xfailed).

This description was created by Ellipsis for c0df4bf. You can customize this summary. It will automatically update as commits are pushed.

Implements Issue gptme#963 - adds a /clear command (with /cls alias) that clears
the terminal screen using ANSI escape codes.

Features:
- /clear command to clear the terminal
- /cls alias for Windows users familiar with that command
- Uses ANSI escape codes for cross-platform compatibility

Closes gptme#963
Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to c0df4bf in 1 minute and 0 seconds. Click for details.
  • Reviewed 35 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. gptme/commands.py:276
  • Draft comment:
    Good implementation of the clear command. Consider flushing stdout (e.g. sys.stdout.flush()) after printing the ANSI escape code to ensure immediate screen clearing in all environments.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. gptme/commands.py:280
  • Draft comment:
    Consider extracting the ANSI escape sequence into a named constant for improved readability and potential reuse.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_byHiaRdygjtizJJm

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@ErikBjare ErikBjare merged commit e0168db into gptme:master Dec 18, 2025
11 of 15 checks passed
@TimeToBuildBob TimeToBuildBob deleted the feat-clear-command branch March 23, 2026 10:52
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.

ClI feature clear command

2 participants