Skip to content

Commit 74b25b4

Browse files
authored
Feature/alias command (#9)
* Refactor and expand alias management commands Refactors alias management into a dedicated file (alias.go), introduces a new alias_check.go for listing and clearing shell aliases, and adds a new 'alias-self' command for system-level aliasing. Adds interactive subcommands for alias CRUD, enable/disable, popular alias addition, and shell registration. Replaces repeated PIN confirmation logic with a reusable ConfirmWithPIN helper. Updates related commands to use the new confirmation flow and improves code organization. * Add popular alias management and refactor alias logic Introduces a new GetPopularAliases function in a dedicated file to provide a comprehensive set of popular aliases for Git, Docker, System, Go, Node, and Yarn. Refactors the alias add-popular command to use this new function. Updates documentation and changelog to reflect enhanced alias management, new subcommands, and command renames. Bumps CLI version to 1.1.0. * Refactor file handling and remove unused PIN generator Replaces direct calls to f.Close() with error-ignored closures in alias.go for improved error handling consistency. Removes the unused generatePIN function and related imports from alias_check.go to clean up the codebase.
1 parent 765751e commit 74b25b4

11 files changed

Lines changed: 1050 additions & 247 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v1.1.0] - 2025-11-24
9+
10+
### Added
11+
12+
- **Enhanced Alias Management:**
13+
- New `mayrlabs alias` command with comprehensive subcommands
14+
- `add-popular` - Add popular aliases for Git, Docker, System, Go, Node, etc.
15+
- `register/unregister` - Manage shell configuration integration
16+
- `disable/enable` - Toggle aliases without deleting them
17+
- `edit/rename` - Modify existing aliases
18+
- `remove` - Remove aliases with PIN confirmation
19+
20+
### Changed
21+
22+
- **Command Renames:**
23+
- Renamed `mayrlabs alias` to `mayrlabs alias-self` to avoid conflict with new alias manager
24+
- Renamed `mayrlabs alias-list` to `mayrlabs alias list`
25+
- Renamed `mayrlabs alias-clear` to `mayrlabs alias remove` (with multi-select)
26+
27+
- **Security:**
28+
- Refactored PIN confirmation logic into a shared utility for consistent security across commands
29+
830
## [v1.0.0] - 2025-10-27
931

1032
### 🎉 First Stable Release

README.md

Lines changed: 83 additions & 75 deletions
Large diffs are not rendered by default.

cmd/root.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88
var rootCmd = &cobra.Command{
99
Use: "mayrlabs",
1010
Short: "🧰 MayR Labs CLI - Streamline your development workflow",
11-
Long: `MayR Labs CLI is a lightweight, cross-platform command-line tool
12-
built with Go to streamline common development, configuration, and
11+
Long: `MayR Labs CLI is a lightweight, cross-platform command-line tool
12+
built with Go to streamline common development, configuration, and
1313
automation tasks across projects.
1414
15-
It provides developers with a unified interface for generating configs,
16-
formatting code, managing environments, handling CI/CD, and keeping
15+
It provides developers with a unified interface for generating configs,
16+
formatting code, managing environments, handling CI/CD, and keeping
1717
project structure consistent — all in seconds.`,
1818
Run: func(cmd *cobra.Command, args []string) {
1919
if len(args) == 0 {
@@ -51,6 +51,7 @@ func init() {
5151

5252
// New commands for v0.4.0
5353
rootCmd.AddCommand(commands.RollDiceCmd)
54+
rootCmd.AddCommand(commands.AliasSelfCmd)
5455
rootCmd.AddCommand(commands.AliasCmd)
5556
rootCmd.AddCommand(commands.UpgradeCmd)
5657
rootCmd.AddCommand(commands.Base64Cmd)

0 commit comments

Comments
 (0)