Skip to content

Add uninstall command to cleanly remove widget from shell config #87

@noahgift

Description

@noahgift

Feature Request

Add aprender-shell uninstall command to cleanly remove the widget from shell config.

Current State

Users must manually edit ~/.zshrc to remove the widget block.

Proposed Command

aprender-shell uninstall [--zsh] [--bash] [--fish]

Behavior

  1. Detect shell config file (~/.zshrc, ~/.bashrc, ~/.config/fish/config.fish)
  2. Find and remove the widget block (between marker comments)
  3. Optionally remove model file (~/.aprender-shell.model)
  4. Print confirmation

Implementation

Add marker comments to widget output:

# >>> aprender-shell widget >>>
_aprender_suggest() {
    ...
}
# <<< aprender-shell widget <<<

Then uninstall can safely remove everything between markers.

$ aprender-shell uninstall
Removed widget from ~/.zshrc
Removed model file ~/.aprender-shell.model
Done. Restart your shell or run: source ~/.zshrc

Flags

  • --keep-model: Don't delete the trained model
  • --dry-run: Show what would be removed without doing it

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions