@prnv/tuck 1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Pranav Karra
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,181 @@
1
+ # tuck
2
+
3
+ > Modern dotfiles manager with a beautiful CLI
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@prnv/tuck.svg)](https://www.npmjs.com/package/@prnv/tuck)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ [![CI](https://github.com/Pranav-Karra-3301/tuck/actions/workflows/ci.yml/badge.svg)](https://github.com/Pranav-Karra-3301/tuck/actions/workflows/ci.yml)
8
+
9
+ ## Features
10
+
11
+ - **Beautiful CLI** - Gorgeous prompts, spinners, and colors powered by @clack/prompts
12
+ - **Git-native** - Uses git under the hood but abstracts complexity
13
+ - **Organized** - Auto-categorizes your dotfiles (shell, git, editors, terminal, etc.)
14
+ - **Safe** - Never overwrites without confirmation, always creates backups
15
+ - **Fast** - Written in TypeScript, runs on Node.js 18+
16
+ - **Cross-platform** - Works on macOS and Linux
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ # npm
22
+ npm install -g @prnv/tuck
23
+
24
+ # pnpm
25
+ pnpm add -g @prnv/tuck
26
+
27
+ # yarn
28
+ yarn global add @prnv/tuck
29
+
30
+ # Homebrew (macOS)
31
+ brew tap pranav-karra-3301/tuck
32
+ brew install tuck
33
+ ```
34
+
35
+ ## Quick Start
36
+
37
+ ```bash
38
+ # Initialize tuck (interactive)
39
+ tuck init
40
+
41
+ # Or initialize with a remote repository
42
+ tuck init --from git@github.com:username/dotfiles.git
43
+
44
+ # Add your dotfiles
45
+ tuck add ~/.zshrc ~/.gitconfig ~/.config/nvim
46
+
47
+ # Sync changes to repository
48
+ tuck sync
49
+
50
+ # Push to remote
51
+ tuck push
52
+ ```
53
+
54
+ ## Commands
55
+
56
+ | Command | Description |
57
+ |---------|-------------|
58
+ | `tuck init` | Initialize tuck repository |
59
+ | `tuck add <paths>` | Track new dotfiles |
60
+ | `tuck remove <paths>` | Stop tracking dotfiles |
61
+ | `tuck sync` | Sync changes to repository |
62
+ | `tuck push` | Push to remote |
63
+ | `tuck pull` | Pull from remote |
64
+ | `tuck restore` | Restore dotfiles to system |
65
+ | `tuck status` | Show tracking status |
66
+ | `tuck list` | List tracked files |
67
+ | `tuck diff` | Show changes |
68
+ | `tuck config` | Manage configuration |
69
+
70
+ ## How It Works
71
+
72
+ Tuck stores your dotfiles in `~/.tuck` (configurable), organized by category:
73
+
74
+ ```
75
+ ~/.tuck/
76
+ ├── files/
77
+ │ ├── shell/ # .zshrc, .bashrc, etc.
78
+ │ ├── git/ # .gitconfig, .gitignore_global
79
+ │ ├── editors/ # .vimrc, nvim config
80
+ │ ├── terminal/ # .tmux.conf, alacritty config
81
+ │ ├── ssh/ # ssh config
82
+ │ └── misc/ # everything else
83
+ ├── .tuckmanifest.json # Tracks all managed files
84
+ ├── .tuckrc.json # Tuck configuration
85
+ └── README.md
86
+ ```
87
+
88
+ When you run `tuck add ~/.zshrc`:
89
+ 1. The file is copied to `~/.tuck/files/shell/zshrc`
90
+ 2. An entry is added to the manifest with the source path and checksum
91
+ 3. Run `tuck sync` to commit and `tuck push` to upload
92
+
93
+ When setting up a new machine:
94
+ ```bash
95
+ tuck init --from git@github.com:username/dotfiles.git
96
+ tuck restore --all
97
+ ```
98
+
99
+ ## Configuration
100
+
101
+ Tuck can be configured via `~/.tuck/.tuckrc.json`:
102
+
103
+ ```json
104
+ {
105
+ "repository": {
106
+ "path": "~/.tuck",
107
+ "defaultBranch": "main",
108
+ "autoCommit": true,
109
+ "autoPush": false
110
+ },
111
+ "files": {
112
+ "strategy": "copy",
113
+ "backupOnRestore": true,
114
+ "backupDir": "~/.tuck-backups"
115
+ },
116
+ "ui": {
117
+ "colors": true,
118
+ "emoji": true,
119
+ "verbose": false
120
+ }
121
+ }
122
+ ```
123
+
124
+ ### File Strategies
125
+
126
+ - **copy** (default): Files are copied to the repository. Changes in your system don't affect the repo until you run `tuck sync`.
127
+ - **symlink**: Files in your system are replaced with symlinks to the repository. Changes are immediate.
128
+
129
+ ## Restoring on a New Machine
130
+
131
+ ```bash
132
+ # Option 1: Clone and restore in one step
133
+ tuck init --from git@github.com:username/dotfiles.git
134
+ tuck restore --all
135
+
136
+ # Option 2: Clone manually
137
+ git clone git@github.com:username/dotfiles.git ~/.tuck
138
+ tuck restore --all
139
+ ```
140
+
141
+ ## Hooks
142
+
143
+ Run custom commands before/after sync or restore:
144
+
145
+ ```json
146
+ {
147
+ "hooks": {
148
+ "preSync": "echo 'About to sync...'",
149
+ "postSync": "echo 'Sync complete!'",
150
+ "preRestore": "echo 'Backing up...'",
151
+ "postRestore": "source ~/.zshrc"
152
+ }
153
+ }
154
+ ```
155
+
156
+ ## Development
157
+
158
+ ```bash
159
+ # Clone the repository
160
+ git clone https://github.com/Pranav-Karra-3301/tuck.git
161
+ cd tuck
162
+
163
+ # Install dependencies
164
+ pnpm install
165
+
166
+ # Build
167
+ pnpm build
168
+
169
+ # Run locally
170
+ node dist/index.js --help
171
+
172
+ # Run tests
173
+ pnpm test
174
+
175
+ # Lint
176
+ pnpm lint
177
+ ```
178
+
179
+ ## License
180
+
181
+ MIT - see [LICENSE](LICENSE)
@@ -0,0 +1,2 @@
1
+
2
+ export { }