Skip to content

vault_clone

🚧 설계 단계 — 아직 구현 안 됨

이 페이지는 ainote 의 향후 기능을 미리 문서화한 것입니다. 현재 @ainote/mcp v1.1.x 에는 vault / sync 도구가 포함돼 있지 않습니다. 도구 호출 시 Tool not found 에러를 받게 됩니다.

기존 vault 를 로컬에 git clone. 또는 외부 git repo 를 ainote vault 로 등록.

시그니처

모드 A: ainote vault → 로컬

json
{
  "name": "personal",
  "destination": "/Users/seunghan/notes/personal"
}

모드 B: 외부 git → 새 vault

json
{
  "name": "obsidian-backup",
  "git_remote": "git@github.com:me/my-obsidian-vault.git",
  "destination": "/Users/seunghan/notes/obsidian-backup"
}

모드 A 예시 — 새 기기 셋업

ainote vault_clone — personal vault 를 ~/notes/personal 에

내부 동작:

bash
git clone https://api.ainote.dev/vaults/me/personal.git /Users/seunghan/notes/personal
cd /Users/seunghan/notes/personal
git config user.email "me@example.com"
git config user.name "Seunghan"

응답:

✅ /Users/seunghan/notes/personal
   123 files, 45 MB
   Last commit: 2026-05-07 14:32 (macmini-2026-04)

모드 B 예시 — Obsidian 마이그레이션

기존 Obsidian vault 를 GitHub 에 push 한 상태에서:

ainote vault_clone — name: obsidian, git_remote: git@github.com:me/obsidian.git,
destination: ~/Documents/obsidian

내부 동작:

  1. ainote 에 새 vault 등록 (name: obsidian)
  2. 외부 git remote 를 mirror 로 가져옴
  3. ainote 의 git URL 을 새 origin 으로 set
  4. 로컬에 clone

이후엔 vault_sync 로 양방향.

인증

ainote vault 는 사용자 MCP key 로 git auth:

Username: <email>
Password: <MCP key>

또는 SSH key 등록 (ainote.dev/settings/git).

git_remote 가 외부 (GitHub 등) 면 별도 인증 (SSH agent 추천).

destination 권장

  • 짧고 명시적 (~/notes/personal 좋음, ~/Documents/Random/Folder/Maybe/Vault 나쁨)
  • 백업 디렉토리 안 권장 (TimeMachine 무거워짐)
  • iCloud Drive 비추 — git 과 충돌

Obsidian 양방향 사용

clone 후 Obsidian 에서:

  1. "Open Vault as Folder" → ~/notes/obsidian
  2. .obsidian/ 폴더 자동 생성됨
  3. ainote 에도 같이 sync 되도록 .gitignore 조정:
# .gitignore (vault root)
.obsidian/workspace*
.obsidian/cache
.obsidian/plugins/*/data.json

설정 자체는 sync, 임시 캐시는 제외.

충돌

clone 시 destination 이 이미 존재:

  • 비어있음 → OK
  • 파일 있음 → 에러 (destination not empty)
  • 강제 덮어쓰기: force: true (위험)

에러

코드메시지해결
-32602vault not foundname 확인
-32602destination not empty빈 폴더 또는 force
-32603git auth failed키 등록 또는 SSH
-32603external repo unreachablegit_remote URL/권한 확인

다음

MIT License · ainote.dev