Skip to content

Commit 2e61828

Browse files
committed
docs: Add guide for connecting to existing synced vault
- Step-by-step instructions for new machine setup - Emphasizes NOT running `pass-cli init` first - Platform-specific config file creation (bash/PowerShell) - Common mistakes table with fixes - Explains what happens behind the scenes
1 parent f1bb5f5 commit 2e61828

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

docs/02-guides/sync-guide.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,100 @@ pass-cli list
222222
# Shows: github
223223
```
224224

225+
## Connecting to an Existing Synced Vault
226+
227+
If you already have pass-cli set up with sync on another device and want to connect from a new machine:
228+
229+
> **Important**: Do NOT run `pass-cli init` - this creates a new vault and overwrites your synced one on next push.
230+
231+
### Step-by-Step Setup
232+
233+
**1. Install pass-cli and rclone on the new machine**:
234+
235+
```bash
236+
# macOS
237+
brew tap arimxyer/homebrew-tap && brew install pass-cli rclone
238+
239+
# Windows
240+
scoop bucket add arimxyer https://github.com/arimxyer/scoop-bucket
241+
scoop install pass-cli rclone
242+
243+
# Linux
244+
# Install pass-cli from releases, then:
245+
sudo apt install rclone
246+
```
247+
248+
**2. Configure rclone with the same cloud account**:
249+
250+
```bash
251+
rclone config
252+
# Create remote with the SAME name as your other device (e.g., "gdrive")
253+
# Log in with the SAME cloud account
254+
```
255+
256+
**3. Verify you can see your existing vault**:
257+
258+
```bash
259+
rclone ls gdrive:.pass-cli
260+
# Should show: vault.enc, vault.enc.meta.json, etc.
261+
```
262+
263+
**4. Create the pass-cli config file manually**:
264+
265+
```bash
266+
# Create config directory
267+
mkdir -p ~/.pass-cli
268+
269+
# Create config file
270+
cat > ~/.pass-cli/config.yml << 'EOF'
271+
sync:
272+
enabled: true
273+
remote: "gdrive:.pass-cli"
274+
EOF
275+
```
276+
277+
On Windows (PowerShell):
278+
```powershell
279+
mkdir -Force ~\.pass-cli
280+
@"
281+
sync:
282+
enabled: true
283+
remote: "gdrive:.pass-cli"
284+
"@ | Out-File -FilePath ~\.pass-cli\config.yml -Encoding UTF8
285+
```
286+
287+
**5. Run any pass-cli command** - it will pull your vault:
288+
289+
```bash
290+
pass-cli list
291+
# Output:
292+
# Syncing vault...
293+
# Enter master password: ****
294+
# github
295+
# aws-prod
296+
# ...
297+
```
298+
299+
Use your **existing master password** from the original device.
300+
301+
### What Happens Behind the Scenes
302+
303+
1. pass-cli sees sync is enabled
304+
2. Calls `rclone sync <remote> <local>` (pull)
305+
3. Your vault downloads from cloud to `~/.pass-cli/`
306+
4. pass-cli prompts for master password
307+
5. Vault unlocks with your existing password
308+
6. You're connected!
309+
310+
### Common Mistakes
311+
312+
| Mistake | Result | Fix |
313+
|---------|--------|-----|
314+
| Running `pass-cli init` first | Creates new vault, may overwrite cloud on push | Delete local vault, follow steps above |
315+
| Different rclone remote name | Sync can't find remote | Use same remote name on all devices |
316+
| Wrong cloud account | Downloads empty or different vault | Reconfigure rclone with correct account |
317+
| Typo in remote path | "Remote not found" error | Check with `rclone listremotes` |
318+
225319
## Conflict Handling
226320

227321
Pass-CLI uses rclone's sync behavior which **overwrites** the destination with the source. This means:

0 commit comments

Comments
 (0)