easy-command 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,6 +21,7 @@ Or install globally and configure your terminal in one command:
21
21
 
22
22
  ```bash
23
23
  npx easy-command -y --global
24
+ exec zsh -l
24
25
  ```
25
26
 
26
27
  ### GitHub
@@ -90,11 +91,11 @@ bash install.sh -y --no-chsh
90
91
  # Remove only the configuration block managed by easy-command
91
92
  bash install.sh --uninstall
92
93
 
93
- # Enable optional fuzzy search and Git aliases
94
- bash install.sh -y --with-fzf --with-git-aliases
94
+ # Enable optional fuzzy search
95
+ bash install.sh -y --with-fzf
95
96
  ```
96
97
 
97
- `zoxide` is installed by default. It enables `z <keyword>` directory jumping and `z add <directory>` (or `z a <directory>`) for manually recording a directory. Use `--without-zoxide` to disable it. `fzf` adds fuzzy history and file searching. Git aliases use the non-conflicting `ec-` prefix, such as `git ec-status`; existing aliases are never overwritten.
98
+ `zoxide` is installed by default. It enables `z <keyword>` directory jumping and `z add <directory>` (or `z a <directory>`) for manually recording a directory. Use `--without-zoxide` to disable it. `fzf` adds fuzzy history and file searching. Git aliases are added by default, including `git st`, `git br`, `git sw`, `git ci`, `git cam`, `git lg`, `git la`, `git lb`, and `git ec-status`; existing aliases are never overwritten. Use `--without-git-aliases` to skip or remove aliases managed by easy-command.
98
99
 
99
100
  For a unified interface, use `ec <keyword>` to jump, `ec add <directory>` (or `ec a <directory>`) to record a directory, `ec list` (or `ec l`) to view entries, and `ec del <directory>` (or `ec remove <directory>`) to remove one. `ec doctor`, `ec repair`, `ec update`, `ec install`, `ec uninstall`, and `ec --dry-run` run the matching easy-command maintenance operation. `z` remains available for zoxide compatibility.
100
101
 
@@ -130,13 +131,13 @@ bash install.sh -y
130
131
  For production, pin a release tag instead of running `main` directly:
131
132
 
132
133
  ```bash
133
- npx easy-command@2.0.4 -y
134
+ npx easy-command@2.0.6 -y
134
135
  ```
135
136
 
136
137
  Or, without npm:
137
138
 
138
139
  ```bash
139
- curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.4/install.sh | bash -s -- -y
140
+ curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.6/install.sh | bash -s -- -y
140
141
  ```
141
142
 
142
143
  ## License
package/README_CN.md CHANGED
@@ -21,6 +21,7 @@ easy-command -y
21
21
 
22
22
  ```bash
23
23
  npx easy-command -y --global
24
+ exec zsh -l
24
25
  ```
25
26
 
26
27
  ### GitHub 安装
@@ -90,11 +91,11 @@ bash install.sh -y --no-chsh
90
91
  # 仅删除 easy-command 管理的 .zshrc 配置区块
91
92
  bash install.sh --uninstall
92
93
 
93
- # 启用可选的模糊搜索和 Git 快捷操作
94
- bash install.sh -y --with-fzf --with-git-aliases
94
+ # 启用可选的模糊搜索
95
+ bash install.sh -y --with-fzf
95
96
  ```
96
97
 
97
- 默认安装 `zoxide`,可使用 `z <关键词>` 跳转目录,也支持 `z add <目录>` 或 `z a <目录>` 手动记录目录;使用 `--without-zoxide` 可关闭。`fzf` 提供历史命令和文件的模糊搜索;Git 快捷操作使用 `ec-` 前缀,例如 `git ec-status`,不会覆盖已有别名。
98
+ 默认安装 `zoxide`,可使用 `z <关键词>` 跳转目录,也支持 `z add <目录>` 或 `z a <目录>` 手动记录目录;使用 `--without-zoxide` 可关闭。`fzf` 提供历史命令和文件的模糊搜索;默认添加 Git 快捷操作,包括 `git st`、`git br`、`git sw`、`git ci`、`git cam`、`git lg`、`git la`、`git lb` 和 `git ec-status` 等,不会覆盖已有同名别名。使用 `--without-git-aliases` 可跳过或移除项目管理的快捷方式。
98
99
 
99
100
  统一入口使用 `ec`:`ec <关键词>` 跳转目录,`ec add <目录>` 或 `ec a <目录>` 记录目录,`ec list` 或 `ec l` 查看记录,`ec del <目录>` 或 `ec remove <目录>` 删除记录;`ec doctor`、`ec repair`、`ec update`、`ec install`、`ec uninstall` 和 `ec --dry-run` 执行对应的 easy-command 维护操作。为兼容 zoxide,原有 `z` 命令仍可使用。
100
101
 
@@ -130,13 +131,13 @@ bash install.sh -y
130
131
  生产环境建议固定到发布标签,而不是直接使用 `main`:
131
132
 
132
133
  ```bash
133
- npx easy-command@2.0.4 -y
134
+ npx easy-command@2.0.6 -y
134
135
  ```
135
136
 
136
137
  或者不使用 npm:
137
138
 
138
139
  ```bash
139
- curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.4/install.sh | bash -s -- -y
140
+ curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.6/install.sh | bash -s -- -y
140
141
  ```
141
142
 
142
143
  ## 许可
package/install.sh CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  set -Eeuo pipefail
4
4
 
5
- readonly VERSION='2.0.4'
5
+ readonly VERSION='2.0.6'
6
6
  readonly BEGIN_MARKER='# >>> easy-command zsh >>>'
7
7
  readonly END_MARKER='# <<< easy-command zsh <<<'
8
8
  readonly BASE_DIR_NAME='.easy-command'
@@ -13,7 +13,7 @@ CHANGE_LOGIN_SHELL=true
13
13
  DRY_RUN=false
14
14
  ENABLE_ZOXIDE=true
15
15
  ENABLE_FZF='auto'
16
- ENABLE_GIT_ALIASES='auto'
16
+ ENABLE_GIT_ALIASES=true
17
17
  GLOBAL_INSTALL=false
18
18
  TARGET_USER="${SUDO_USER:-${USER}}"
19
19
  TARGET_HOME=''
@@ -45,7 +45,7 @@ Options:
45
45
  --without-zoxide Do not install or enable zoxide.
46
46
  --with-fzf Enable optional fzf history and file searching.
47
47
  --without-fzf Disable fzf in the managed configuration.
48
- --with-git-aliases Add non-conflicting global Git aliases prefixed with ec-.
48
+ --with-git-aliases Add non-conflicting global Git aliases (default).
49
49
  --without-git-aliases
50
50
  Remove global Git aliases managed by easy-command.
51
51
  --uninstall Remove only the easy-command managed .zshrc block.
@@ -397,9 +397,29 @@ EOF
397
397
 
398
398
  configure_git_aliases() {
399
399
  local enabled
400
- enabled="$(resolve_option "$ENABLE_GIT_ALIASES" 'git-aliases')"
400
+ enabled="$ENABLE_GIT_ALIASES"
401
401
 
402
402
  local aliases=(
403
+ 'st=status'
404
+ 'br=branch'
405
+ 'bc=branch'
406
+ 'sw=switch'
407
+ 'cd=switch'
408
+ 'ch=checkout'
409
+ 'ck=checkout'
410
+ 'ci=commit'
411
+ 'ca=commit -a'
412
+ 'cam=commit -a -m'
413
+ 'co=commit'
414
+ 'rb=rebase'
415
+ 'rs=restore'
416
+ 'rt=remote'
417
+ 'mg=merge'
418
+ 'rh=reset HEAD'
419
+ 'last=log -1'
420
+ "lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
421
+ 'la=log --pretty=oneline --abbrev-commit'
422
+ 'lb=log --graph --pretty=oneline --abbrev-commit'
403
423
  'ec-status=status --short --branch'
404
424
  'ec-log=log --oneline --graph --decorate -12'
405
425
  'ec-last=log -1 --stat'
@@ -573,6 +593,9 @@ main() {
573
593
  write_zshrc_block
574
594
  configure_git_aliases
575
595
  info "Installed easy-command $VERSION for $TARGET_USER. Reconnect or run: exec zsh -l"
596
+ if "$GLOBAL_INSTALL"; then
597
+ info "Global CLI installed. After exec zsh -l, try: ec --help"
598
+ fi
576
599
  ;;
577
600
  repair)
578
601
  CHANGE_LOGIN_SHELL=false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-command",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Configure a polished Zsh terminal with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {