Skip to content

feat: add user-defined command aliases via ~/.bernstein/aliases.yaml#265

Closed
TheCodingDragon0 wants to merge 2 commits into
sipyourdrink-ltd:mainfrom
TheCodingDragon0:feat/user-aliases-clean
Closed

feat: add user-defined command aliases via ~/.bernstein/aliases.yaml#265
TheCodingDragon0 wants to merge 2 commits into
sipyourdrink-ltd:mainfrom
TheCodingDragon0:feat/user-aliases-clean

Conversation

@TheCodingDragon0

Copy link
Copy Markdown
Contributor

Fixes #249

Extended the alias system to support user-defined aliases loaded from ~/.bernstein/aliases.yaml. User aliases override built-in ones. The �ernstein aliases command now shows whether each alias is built-in or user-defined.

Changes:

  • Added _load_user_aliases() to load aliases from YAML
  • Added _merge_aliases() called at module load time
  • Updated �liases_cmd to show source column (built-in vs user)
  • Graceful handling of missing/invalid YAML files

@kilo-code-bot

kilo-code-bot Bot commented Apr 6, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • src/bernstein/cli/aliases.py

Reviewed by grok-code-fast-1 · 93,256 tokens

@chernistry chernistry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Same Pyright strict-mode issues as #264 since this touches the same aliases.py file:

  1. Line 64yaml.safe_load() returns Any. Use data: object = yaml.safe_load(f) or {}
  2. Line 67 — unknown k/v types. Narrow the dict first: raw = data if isinstance(data, dict) else {}
  3. Line 76_USER_ALIASES uppercase = constant in Pyright. Rename to _user_aliases

See my review on #264 for full code snippets.

@sonarqubecloud

sonarqubecloud Bot commented Apr 6, 2026

Copy link
Copy Markdown

@chernistry

Copy link
Copy Markdown
Collaborator

Already merged as part of #264 — thanks!

@chernistry chernistry closed this Apr 6, 2026
@TheCodingDragon0

Copy link
Copy Markdown
Contributor Author

Pushed the Pyright fixes — see commit b4326db. Same fix as #264. Sorry for the timing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add user-defined command aliases via ~/.bernstein/aliases.yaml

2 participants