zshify 14.0.0 → 15.0.0
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 +172 -45
- package/bin/script.zsh +6 -11
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -1,80 +1,207 @@
|
|
|
1
|
-
# Zshify
|
|
1
|
+
# Zshify
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**A minimalistic touch to your Zsh prompt!**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
📦 `Zero dependencies` / `One command install` / `Fast and lightweight`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
[](https://twitter.com/nrjdalal_dev)
|
|
10
|
+
[](https://github.com/nrjdalal/zshify)
|
|
11
|
+
|
|
12
|
+
> #### A minimalistic, one command installation to customize your Zsh prompt with colors, git info, and useful functions.
|
|
13
|
+
|
|
14
|
+
<img src="zshify.png">
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Table of Contents
|
|
19
|
+
|
|
20
|
+
- [Quick Start](#-quick-start)
|
|
21
|
+
- [Features](#-features)
|
|
22
|
+
- [Advanced Experience](#-advanced-experience)
|
|
23
|
+
- [What's Included](#-whats-included)
|
|
24
|
+
- [Prompt](#prompt)
|
|
25
|
+
- [Additional Tools](#additional-tools)
|
|
26
|
+
- [Functions](#️-functions)
|
|
27
|
+
- [File & Directory](#file--directory)
|
|
28
|
+
- [Git Workflow](#git-workflow)
|
|
29
|
+
- [Git Dangerous](#git-dangerous-with-confirmation)
|
|
30
|
+
- [GitHub & Project Setup](#github--project-setup)
|
|
31
|
+
- [Aliases](#️-aliases)
|
|
32
|
+
- [Enhancements](#️-enhancements)
|
|
33
|
+
- [Background Tasks](#-background-tasks)
|
|
34
|
+
- [User Config](#-user-config)
|
|
35
|
+
- [Uninstall](#-uninstall)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🚀 Quick Start
|
|
10
40
|
|
|
11
41
|
```zsh
|
|
12
42
|
npx zshify
|
|
13
43
|
```
|
|
14
44
|
|
|
15
|
-
|
|
45
|
+
or
|
|
16
46
|
|
|
17
|
-
|
|
47
|
+
```zsh
|
|
48
|
+
/bin/zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nrjdalal/zshify/refs/heads/main/bin/script.zsh)"
|
|
49
|
+
```
|
|
18
50
|
|
|
19
|
-
|
|
51
|
+
Yeah that's it, no downloads, no hassle. A minimalistic installation for a minimalistic package.
|
|
20
52
|
|
|
21
|
-
|
|
53
|
+
---
|
|
22
54
|
|
|
23
|
-
|
|
24
|
-
- Don't you need some additional features / useful aliases and functions are added as default.
|
|
55
|
+
## 🔥 Features
|
|
25
56
|
|
|
26
|
-
|
|
57
|
+
- 🎨 Minimal, informative prompt with colors
|
|
58
|
+
- 🔀 Git branch, ahead/behind counts, and stash count
|
|
59
|
+
- 📦 Package dependency counts for Node.js projects
|
|
60
|
+
- ⏱️ Command execution time
|
|
61
|
+
- 📁 Useful [file and directory functions](#file--directory)
|
|
62
|
+
- 🛠️ [Git workflow shortcuts](#git-workflow) with safety guards
|
|
27
63
|
|
|
28
|
-
|
|
64
|
+
---
|
|
29
65
|
|
|
30
|
-
|
|
66
|
+
## 📖 Advanced Experience
|
|
31
67
|
|
|
32
|
-
|
|
68
|
+
To enrich your terminal experience, install these tools via [Homebrew](https://brew.sh):
|
|
33
69
|
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
70
|
+
```zsh
|
|
71
|
+
brew install \
|
|
72
|
+
bat btop fd fzf ripgrep zoxide \ # recommended tools
|
|
73
|
+
zsh-autosuggestions \ # fish-like suggestions
|
|
74
|
+
zsh-history-substring-search \ # history search with up/down
|
|
75
|
+
zsh-syntax-highlighting # command highlighting
|
|
37
76
|
```
|
|
38
77
|
|
|
39
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🔍 What's Included
|
|
40
81
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
82
|
+
### Prompt
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
┌─ username
|
|
86
|
+
│ ┌─ current directory
|
|
87
|
+
│ │ ┌─ git branch
|
|
88
|
+
│ │ │
|
|
89
|
+
nrjdalal ~/project main 💠3 📦5 ↑1 ↓2 ≡1 0.123s
|
|
90
|
+
> │ │ │ │ │ │
|
|
91
|
+
│ │ │ │ └─ stash count └─ elapsed time
|
|
92
|
+
│ │ │ └─ behind remote
|
|
93
|
+
│ │ └─ ahead of remote
|
|
94
|
+
│ └─ dependencies
|
|
95
|
+
└─ devDependencies
|
|
46
96
|
```
|
|
47
97
|
|
|
48
|
-
###
|
|
98
|
+
### Additional Tools
|
|
99
|
+
|
|
100
|
+
These are available when installed via the [brew command above](#-advanced-experience):
|
|
101
|
+
|
|
102
|
+
| Command | Description |
|
|
103
|
+
| -------------- | ------------------------------------------------------------------------------------------- |
|
|
104
|
+
| `btop` | interactive system monitor — [btop](https://github.com/aristocratos/btop) |
|
|
105
|
+
| `cat <file>` | syntax-highlighted output — [bat](https://github.com/sharkdp/bat) |
|
|
106
|
+
| `fd <pattern>` | fast file search, respects `.gitignore` — [fd](https://github.com/sharkdp/fd) |
|
|
107
|
+
| `fzf` | interactive fuzzy finder (`Ctrl+T`, `Alt+C`) — [fzf](https://github.com/junegunn/fzf) |
|
|
108
|
+
| `rg <pattern>` | fast text search in files — [ripgrep](https://github.com/BurntSushi/ripgrep) |
|
|
109
|
+
| `z <dir>` | smart cd that learns frequent directories — [zoxide](https://github.com/ajeetdsouza/zoxide) |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 🛠️ Functions
|
|
49
114
|
|
|
50
|
-
|
|
51
|
-
# creates a directory recursively if it doesn't exists and switch to it
|
|
52
|
-
mkcd "newProject" || mkcd "newProject/subProject"
|
|
115
|
+
### File & Directory
|
|
53
116
|
|
|
54
|
-
|
|
55
|
-
|
|
117
|
+
| Command | Description |
|
|
118
|
+
| ----------------------- | ----------------------------------------------------------------- |
|
|
119
|
+
| `cdx <dir>` | create a directory and cd into it |
|
|
120
|
+
| `killport <port\|name>` | kill processes by port or name |
|
|
121
|
+
| `ls` | show hidden files with color and sorting when called without args |
|
|
122
|
+
| `rename <name>` | rename current or existing directory |
|
|
123
|
+
| `rm` | clear directory contents with safeguards for home/desktop |
|
|
56
124
|
|
|
57
|
-
|
|
58
|
-
g "commit message"
|
|
125
|
+
### Git Workflow
|
|
59
126
|
|
|
60
|
-
|
|
61
|
-
|
|
127
|
+
| Command | Description |
|
|
128
|
+
| -------------- | ---------------------------------------------- |
|
|
129
|
+
| `b <branch>` | switch to, track, or create a git branch |
|
|
130
|
+
| `g "message"` | add, commit with conventional prefix, and push |
|
|
131
|
+
| `ga` | stage all changes |
|
|
132
|
+
| `gc "message"` | commit with auto-prefixed message |
|
|
133
|
+
| `pop [name]` | pop latest stash or pop by name |
|
|
134
|
+
| `stash [name]` | stash changes or list stashes if clean |
|
|
135
|
+
| `unstash` | list and clear all stashes |
|
|
62
136
|
|
|
63
|
-
|
|
64
|
-
mkrepo || mkrepo --public
|
|
137
|
+
### Git Dangerous (with confirmation)
|
|
65
138
|
|
|
66
|
-
|
|
67
|
-
|
|
139
|
+
| Command | Description |
|
|
140
|
+
| ------------- | ------------------------------------------ |
|
|
141
|
+
| `git-main` | migrate default branch from master to main |
|
|
142
|
+
| `only-commit` | squash all history into a single commit |
|
|
143
|
+
| `reset [ref]` | hard reset and force push |
|
|
144
|
+
| `undo` | discard last commit and force push |
|
|
68
145
|
|
|
69
|
-
|
|
70
|
-
rename "newName"
|
|
146
|
+
### GitHub & Project Setup
|
|
71
147
|
|
|
72
|
-
|
|
73
|
-
|
|
148
|
+
| Command | Description |
|
|
149
|
+
| ------------------- | ------------------------------------------------------------- |
|
|
150
|
+
| `clone <repo>` | clone a GitHub repository via [`gh`](https://cli.github.com) |
|
|
151
|
+
| `mkrepo [--public]` | init repo, commit, and create GitHub repository |
|
|
152
|
+
| `next` | scaffold a Next.js project from template |
|
|
153
|
+
| `switch [account]` | switch GitHub account via [`gh auth`](https://cli.github.com) |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## ⌨️ Aliases
|
|
158
|
+
|
|
159
|
+
| Alias | Command |
|
|
160
|
+
| ----------------------- | -------------------- |
|
|
161
|
+
| `add` | `ga` |
|
|
162
|
+
| `c` | `cursor .` |
|
|
163
|
+
| `commit` | `gc` |
|
|
164
|
+
| `cr` | `cursor -r .` |
|
|
165
|
+
| `mkcd` | `cdx` |
|
|
166
|
+
| `showdesk` / `hidedesk` | toggle desktop icons |
|
|
167
|
+
| `trash` | `rm` |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## ⚙️ Enhancements
|
|
172
|
+
|
|
173
|
+
- `git` is wrapped to prevent accidental operations in `$HOME` or `~/Desktop`
|
|
174
|
+
- `git checkout -b <branch>` auto-switches if the branch already exists
|
|
175
|
+
- `npm` and `npx` are aliased to [`bun`](https://bun.sh) and `bunx` when bun is available (use `--real` to bypass)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 🔄 Background Tasks
|
|
180
|
+
|
|
181
|
+
Zshify runs a daily background task (via `background.zsh`) that:
|
|
182
|
+
|
|
183
|
+
- Executes the profile setup script (`profile.zsh`)
|
|
184
|
+
- Logs activity to `~/.logs/.brewlog`
|
|
185
|
+
- View logs with `brewlog`, clear with `brewlog clear`
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 👤 User Config
|
|
190
|
+
|
|
191
|
+
Add your personal configuration to `~/.zshify/config/user.zsh` — it's sourced last and won't be overwritten on updates.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🗑️ Uninstall
|
|
196
|
+
|
|
197
|
+
**Soft uninstall** — remove from shell but keep files (preserves `user.zsh` config):
|
|
198
|
+
|
|
199
|
+
```zsh
|
|
200
|
+
sed -i '' '/source ~\/.zshify\/config\//d' ~/.zshrc && exec zsh
|
|
74
201
|
```
|
|
75
202
|
|
|
76
|
-
|
|
203
|
+
**Hard uninstall** — remove everything:
|
|
77
204
|
|
|
78
|
-
```
|
|
79
|
-
|
|
205
|
+
```zsh
|
|
206
|
+
sed -i '' '/source ~\/.zshify\/config\//d' ~/.zshrc && rm -rf ~/.zshify && exec zsh
|
|
80
207
|
```
|
package/bin/script.zsh
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
#!/bin/zsh
|
|
2
2
|
|
|
3
|
-
command git -v &>/dev/null
|
|
3
|
+
echo && command git -v &>/dev/null
|
|
4
4
|
|
|
5
5
|
if [ $? -ne 0 ]; then
|
|
6
|
-
echo
|
|
7
|
-
echo "Git is not available. Please Xcode Command Line Tools first\!"
|
|
6
|
+
echo "Git is not available. Please Xcode Command Line Tools first!"
|
|
8
7
|
xcode-select --install &>/dev/null
|
|
9
8
|
echo
|
|
10
9
|
return 1
|
|
11
10
|
fi
|
|
12
11
|
|
|
13
12
|
if ! command -v brew &>/dev/null; then
|
|
14
|
-
echo
|
|
15
|
-
echo "You cannot brew without the brew, right? Install brew first\!"
|
|
13
|
+
echo "You can not brew without the homebrew. Installing homebrew!"
|
|
16
14
|
echo
|
|
17
15
|
echo "--- $(tput setaf 6)/bin/bash -c \"\$(curl -fsSL https://rdt.li/homebrew)\"$(tput sgr0) ---"
|
|
18
|
-
grep 'eval "$(/opt/homebrew/bin/brew shellenv)"' ~/.zshrc &>/dev/null || echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>~/.zshrc
|
|
19
16
|
echo
|
|
20
|
-
|
|
17
|
+
grep 'eval "$(/opt/homebrew/bin/brew shellenv)"' ~/.zshrc &>/dev/null || echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>~/.zshrc
|
|
21
18
|
fi
|
|
22
19
|
|
|
23
20
|
TEMP_DIR=$(mktemp -d)
|
|
24
21
|
|
|
25
22
|
git clone https://github.com/nrjdalal/zshify "$TEMP_DIR" &>/dev/null
|
|
26
|
-
curl -s https://raw.githubusercontent.com/nrjdalal/pglaunch/main/bin/fx.sh | cat >"$TEMP_DIR/config/postgres.zsh"
|
|
27
23
|
rsync -a --delete "$TEMP_DIR"/ ~/.zshify/
|
|
28
24
|
|
|
29
|
-
for config in prompt background fx alias plugins user
|
|
25
|
+
for config in prompt background fx alias plugins user; do
|
|
30
26
|
grep "source ~/.zshify/config/${config}.zsh" ~/.zshrc &>/dev/null || echo "source ~/.zshify/config/${config}.zsh" >>~/.zshrc
|
|
31
27
|
done
|
|
32
28
|
|
|
33
|
-
echo
|
|
34
|
-
echo "-------------- $(tput setaf 2)zshify successfully installed\!$(tput sgr0) --------------"
|
|
29
|
+
echo "-------------- $(tput setaf 2)zshify successfully installed!$(tput sgr0) --------------"
|
|
35
30
|
echo
|
|
36
31
|
echo "It is recommended to reload the shell, run $(tput setaf 3)exec zsh$(tput sgr0) to do so"
|
|
37
32
|
echo
|
package/package.json
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zshify",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "A minimalistic touch to your prompt!",
|
|
5
|
-
"bin": {
|
|
6
|
-
"prompt": "bin/script.zsh"
|
|
7
|
-
},
|
|
8
|
-
"author": "Neeraj Dalal",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/nrjdalal/zshify.git"
|
|
12
|
-
},
|
|
13
5
|
"homepage": "https://github.com/nrjdalal/zshify#readme",
|
|
14
|
-
"bugs":
|
|
15
|
-
"url": "https://github.com/nrjdalal/zshify/issues"
|
|
16
|
-
},
|
|
6
|
+
"bugs": "https://github.com/nrjdalal/zshify/issues",
|
|
17
7
|
"license": "MIT",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Neeraj Dalal",
|
|
10
|
+
"email": "admin@nrjdalal.com",
|
|
11
|
+
"url": "https://nrjdalal.com"
|
|
12
|
+
},
|
|
13
|
+
"repository": "nrjdalal/zshify",
|
|
14
|
+
"funding": "https://github.com/sponsors/nrjdalal",
|
|
15
|
+
"bin": "bin/script.zsh",
|
|
18
16
|
"keywords": [
|
|
19
17
|
"zsh",
|
|
20
18
|
"zshell",
|
|
@@ -25,6 +23,9 @@
|
|
|
25
23
|
"minimal",
|
|
26
24
|
"fast",
|
|
27
25
|
"prompt",
|
|
28
|
-
"theme"
|
|
26
|
+
"theme",
|
|
27
|
+
"cli",
|
|
28
|
+
"command-line",
|
|
29
|
+
"macos"
|
|
29
30
|
]
|
|
30
31
|
}
|