@prnv/tuck 1.4.1 → 1.5.1
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 +127 -90
- package/dist/index.js +969 -575
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="public/tuck.png" alt="tuck logo" width="
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<img src="public/tuck.png" alt="tuck logo" width="180">
|
|
3
|
+
|
|
4
|
+
# tuck
|
|
5
|
+
|
|
6
|
+
**The modern dotfiles manager**
|
|
7
|
+
|
|
8
|
+
Simple, fast, and beautiful. Manage your dotfiles with Git, sync across machines, and never lose your configs again.
|
|
8
9
|
|
|
9
10
|
[](https://www.npmjs.com/package/@prnv/tuck)
|
|
10
11
|
[](https://opensource.org/licenses/MIT)
|
|
11
12
|
[](https://github.com/Pranav-Karra-3301/tuck/actions/workflows/ci.yml)
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
[Website](https://tuck.sh) · [Install](#installation) · [Quick Start](#quick-start) · [Commands](#commands)
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
20
|
+
## Why tuck?
|
|
21
|
+
|
|
22
|
+
- **One command to rule them all** — `tuck init` scans your system, lets you pick what to track, and syncs to GitHub
|
|
23
|
+
- **Smart detection** — Auto-categorizes dotfiles (shell, git, editors, terminal, ssh, etc.)
|
|
24
|
+
- **Beautiful CLI** — Gorgeous prompts, spinners, and progress bars powered by @clack/prompts
|
|
25
|
+
- **Safe by default** — Creates backups before every operation, never overwrites without asking
|
|
26
|
+
- **Git-native** — Uses Git under the hood but hides the complexity
|
|
27
|
+
- **Cross-platform** — Works on macOS and Linux
|
|
21
28
|
|
|
22
29
|
## Installation
|
|
23
30
|
|
|
@@ -25,133 +32,166 @@
|
|
|
25
32
|
# npm
|
|
26
33
|
npm install -g @prnv/tuck
|
|
27
34
|
|
|
35
|
+
# Homebrew (macOS/Linux)
|
|
36
|
+
brew install prnv/tap/tuck
|
|
37
|
+
|
|
28
38
|
# pnpm
|
|
29
39
|
pnpm add -g @prnv/tuck
|
|
30
40
|
|
|
31
41
|
# yarn
|
|
32
42
|
yarn global add @prnv/tuck
|
|
33
|
-
|
|
34
|
-
# Homebrew (macOS)
|
|
35
|
-
brew tap pranav-karra-3301/tuck
|
|
36
|
-
brew install tuck
|
|
37
43
|
```
|
|
38
44
|
|
|
39
45
|
## Quick Start
|
|
40
46
|
|
|
47
|
+
### First time setup
|
|
48
|
+
|
|
41
49
|
```bash
|
|
42
|
-
#
|
|
50
|
+
# Interactive setup - scans your system, pick what to track, syncs to GitHub
|
|
43
51
|
tuck init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That's it! `tuck init` does everything:
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
1. Creates `~/.tuck` repository
|
|
57
|
+
2. Scans your system for dotfiles
|
|
58
|
+
3. Lets you select which to track
|
|
59
|
+
4. Creates a GitHub repo (optional)
|
|
60
|
+
5. Commits and pushes
|
|
47
61
|
|
|
48
|
-
|
|
49
|
-
tuck add ~/.zshrc ~/.gitconfig ~/.config/nvim
|
|
62
|
+
### Ongoing workflow
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
```bash
|
|
65
|
+
# Detect changes, find new dotfiles, commit, and push - all in one
|
|
52
66
|
tuck sync
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### On a new machine
|
|
53
70
|
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
```bash
|
|
72
|
+
# Apply dotfiles from any GitHub user
|
|
73
|
+
tuck apply username
|
|
74
|
+
|
|
75
|
+
# Or clone your own and restore
|
|
76
|
+
tuck init --from github.com/you/dotfiles
|
|
77
|
+
tuck restore --all
|
|
56
78
|
```
|
|
57
79
|
|
|
58
80
|
## Commands
|
|
59
81
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
| `tuck
|
|
65
|
-
| `tuck sync`
|
|
66
|
-
| `tuck
|
|
82
|
+
### Essential (what you'll use 99% of the time)
|
|
83
|
+
|
|
84
|
+
| Command | Description |
|
|
85
|
+
| ------------- | ----------------------------------------------------------------------- |
|
|
86
|
+
| `tuck init` | Set up tuck - scans for dotfiles, select what to track, syncs to GitHub |
|
|
87
|
+
| `tuck sync` | Detect changes + new files, commit, and push (pulls first if behind) |
|
|
88
|
+
| `tuck status` | See what's tracked, what's changed, and sync status |
|
|
89
|
+
|
|
90
|
+
### Managing Files
|
|
91
|
+
|
|
92
|
+
| Command | Description |
|
|
93
|
+
| --------------------- | ---------------------------------- |
|
|
94
|
+
| `tuck add <paths>` | Manually track specific files |
|
|
95
|
+
| `tuck remove <paths>` | Stop tracking files |
|
|
96
|
+
| `tuck scan` | Discover dotfiles without syncing |
|
|
97
|
+
| `tuck list` | List all tracked files by category |
|
|
98
|
+
| `tuck diff [file]` | Show what's changed |
|
|
99
|
+
|
|
100
|
+
### Syncing
|
|
101
|
+
|
|
102
|
+
| Command | Description |
|
|
103
|
+
| ----------- | ---------------- |
|
|
104
|
+
| `tuck push` | Push to remote |
|
|
67
105
|
| `tuck pull` | Pull from remote |
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
|
106
|
+
|
|
107
|
+
### Restoring
|
|
108
|
+
|
|
109
|
+
| Command | Description |
|
|
110
|
+
| ------------------- | ------------------------------------------------------ |
|
|
111
|
+
| `tuck apply <user>` | Apply dotfiles from a GitHub user (with smart merging) |
|
|
112
|
+
| `tuck restore` | Restore dotfiles from repo to system |
|
|
113
|
+
| `tuck undo` | Restore from Time Machine backup snapshots |
|
|
114
|
+
|
|
115
|
+
### Configuration
|
|
116
|
+
|
|
117
|
+
| Command | Description |
|
|
118
|
+
| -------------------- | ------------------------------- |
|
|
119
|
+
| `tuck config` | View/edit configuration |
|
|
120
|
+
| `tuck config wizard` | Interactive configuration setup |
|
|
73
121
|
|
|
74
122
|
## How It Works
|
|
75
123
|
|
|
76
|
-
|
|
124
|
+
tuck stores your dotfiles in `~/.tuck`, organized by category:
|
|
77
125
|
|
|
78
126
|
```
|
|
79
127
|
~/.tuck/
|
|
80
128
|
├── files/
|
|
81
|
-
│ ├── shell/ # .zshrc, .bashrc,
|
|
129
|
+
│ ├── shell/ # .zshrc, .bashrc, .profile
|
|
82
130
|
│ ├── git/ # .gitconfig, .gitignore_global
|
|
83
|
-
│ ├── editors/ # .vimrc, nvim
|
|
84
|
-
│ ├── terminal/ # .tmux.conf, alacritty
|
|
85
|
-
│ ├── ssh/ # ssh config
|
|
131
|
+
│ ├── editors/ # .vimrc, nvim, VS Code settings
|
|
132
|
+
│ ├── terminal/ # .tmux.conf, alacritty, kitty
|
|
133
|
+
│ ├── ssh/ # ssh config (never keys!)
|
|
86
134
|
│ └── misc/ # everything else
|
|
87
|
-
├── .tuckmanifest.json
|
|
88
|
-
|
|
89
|
-
└── README.md
|
|
135
|
+
├── .tuckmanifest.json
|
|
136
|
+
└── .tuckrc.json
|
|
90
137
|
```
|
|
91
138
|
|
|
92
|
-
|
|
93
|
-
1. The file is copied to `~/.tuck/files/shell/zshrc`
|
|
94
|
-
2. An entry is added to the manifest with the source path and checksum
|
|
95
|
-
3. Run `tuck sync` to commit and `tuck push` to upload
|
|
139
|
+
**The flow:**
|
|
96
140
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
tuck
|
|
100
|
-
tuck
|
|
141
|
+
```
|
|
142
|
+
~/.zshrc → ~/.tuck/files/shell/zshrc
|
|
143
|
+
~/.gitconfig → ~/.tuck/files/git/gitconfig
|
|
144
|
+
~/.config/nvim → ~/.tuck/files/editors/nvim
|
|
101
145
|
```
|
|
102
146
|
|
|
147
|
+
Run `tuck sync` anytime to detect changes and push. On a new machine, run `tuck apply username` to grab anyone's dotfiles.
|
|
148
|
+
|
|
103
149
|
## Configuration
|
|
104
150
|
|
|
105
|
-
|
|
151
|
+
Configure tuck via `~/.tuck/.tuckrc.json` or `tuck config wizard`:
|
|
106
152
|
|
|
107
153
|
```json
|
|
108
154
|
{
|
|
109
155
|
"repository": {
|
|
110
|
-
"path": "~/.tuck",
|
|
111
|
-
"defaultBranch": "main",
|
|
112
156
|
"autoCommit": true,
|
|
113
157
|
"autoPush": false
|
|
114
158
|
},
|
|
115
159
|
"files": {
|
|
116
160
|
"strategy": "copy",
|
|
117
|
-
"backupOnRestore": true
|
|
118
|
-
"backupDir": "~/.tuck-backups"
|
|
119
|
-
},
|
|
120
|
-
"ui": {
|
|
121
|
-
"colors": true,
|
|
122
|
-
"emoji": true,
|
|
123
|
-
"verbose": false
|
|
161
|
+
"backupOnRestore": true
|
|
124
162
|
}
|
|
125
163
|
}
|
|
126
164
|
```
|
|
127
165
|
|
|
128
166
|
### File Strategies
|
|
129
167
|
|
|
130
|
-
- **copy** (default)
|
|
131
|
-
- **symlink
|
|
168
|
+
- **copy** (default) — Files are copied. Run `tuck sync` to update the repo.
|
|
169
|
+
- **symlink** — Files are symlinked. Changes are instant but require more care.
|
|
170
|
+
|
|
171
|
+
## Security
|
|
132
172
|
|
|
133
|
-
|
|
173
|
+
tuck is designed with security in mind:
|
|
174
|
+
|
|
175
|
+
- **Never tracks private keys** — SSH keys, `.env` files, and credentials are blocked by default
|
|
176
|
+
- **Secret scanning** — Warns if files contain API keys or tokens
|
|
177
|
+
- **Placeholder support** — Replace secrets with `{{PLACEHOLDER}}` syntax
|
|
178
|
+
- **Local secrets** — Store actual values in `secrets.local.json` (never committed)
|
|
134
179
|
|
|
135
180
|
```bash
|
|
136
|
-
#
|
|
137
|
-
tuck
|
|
138
|
-
tuck restore --all
|
|
181
|
+
# Scan tracked files for secrets
|
|
182
|
+
tuck secrets scan
|
|
139
183
|
|
|
140
|
-
#
|
|
141
|
-
|
|
142
|
-
tuck restore --all
|
|
184
|
+
# Set a secret value locally
|
|
185
|
+
tuck secrets set API_KEY "your-actual-key"
|
|
143
186
|
```
|
|
144
187
|
|
|
145
188
|
## Hooks
|
|
146
189
|
|
|
147
|
-
Run custom commands before/after
|
|
190
|
+
Run custom commands before/after operations:
|
|
148
191
|
|
|
149
192
|
```json
|
|
150
193
|
{
|
|
151
194
|
"hooks": {
|
|
152
|
-
"preSync": "echo 'About to sync...'",
|
|
153
|
-
"postSync": "echo 'Sync complete!'",
|
|
154
|
-
"preRestore": "echo 'Backing up...'",
|
|
155
195
|
"postRestore": "source ~/.zshrc"
|
|
156
196
|
}
|
|
157
197
|
}
|
|
@@ -160,26 +200,23 @@ Run custom commands before/after sync or restore:
|
|
|
160
200
|
## Development
|
|
161
201
|
|
|
162
202
|
```bash
|
|
163
|
-
# Clone the repository
|
|
164
203
|
git clone https://github.com/Pranav-Karra-3301/tuck.git
|
|
165
204
|
cd tuck
|
|
166
|
-
|
|
167
|
-
# Install dependencies
|
|
168
205
|
pnpm install
|
|
169
|
-
|
|
170
|
-
# Build
|
|
171
206
|
pnpm build
|
|
172
|
-
|
|
173
|
-
# Run locally
|
|
174
|
-
node dist/index.js --help
|
|
175
|
-
|
|
176
|
-
# Run tests
|
|
177
207
|
pnpm test
|
|
178
|
-
|
|
179
|
-
# Lint
|
|
180
|
-
pnpm lint
|
|
181
208
|
```
|
|
182
209
|
|
|
210
|
+
## Contributing
|
|
211
|
+
|
|
212
|
+
Contributions are welcome! Please read our contributing guidelines and submit PRs to the `main` branch.
|
|
213
|
+
|
|
183
214
|
## License
|
|
184
215
|
|
|
185
|
-
MIT
|
|
216
|
+
MIT — see [LICENSE](LICENSE)
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
<div align="center">
|
|
221
|
+
<sub>Made with love in San Francisco and State College</sub>
|
|
222
|
+
</div>
|