Skip to main content

Cập nhật

1

Pull code mới

cd video-automator-skills
git pull
2

Update Python deps

.venv/bin/pip install --upgrade -r tools/asset_index/requirements.txt
Nếu requirements.txt thêm dep mới, lệnh trên sẽ tự cài. Nếu pin version đổi, lệnh upgrade pin theo version mới.
3

Restart watcher service

Để watcher load code Python mới:
.venv/bin/python -m tools.asset_index.service stop
.venv/bin/python -m tools.asset_index.service start
schtasks /end /tn VideoAgentAssetIndex
schtasks /run /tn VideoAgentAssetIndex
systemctl --user restart video-agent-asset-index
4

Verify

cat .asset_index/state.json
pid phải > 0 và watcher_started_at phải gần thời điểm restart. Nếu fail → đọc logs/watcher.err.log.
Cập nhật code thường không yêu cầu rebuild DB. Nếu update đổi schema (hiếm), changelog sẽ note rõ migration step.

Migration sau khi đổi schema

Nếu thay đổi schema.sql (ví dụ thêm cột, đổi dim embedding):
  1. Backup DB:
    cp .asset_index/index.db .asset_index/index.db.bak
    
  2. Xoá DB:
    rm .asset_index/index.db
    
  3. Re-scan toàn bộ:
    .venv/bin/python -m tools.asset_index.watcher --scan-on-start
    
    Vì idempotency dựa trên SHA-256, mọi file sẽ được re-analyze + re-embed (tốn LLM call).

Gỡ cài đặt

Cách 1 — Uninstall.command / Uninstall.bat

Double-click setup/Uninstall.command. Script sẽ:
  1. Stop + remove launchd service.
  2. Hỏi xác nhận trước khi xoá .asset_index/, .venv/, .env.
  3. Giữ nguyên repo và mọi file nguồn.
Double-click setup\Uninstall.bat. Tương tự macOS — gỡ Task Scheduler entry, prompt xoá runtime files.

Cách 2 — Manual

1

Stop + uninstall service

.venv/bin/python -m tools.asset_index.service uninstall
Verify:
  • macOS: launchctl list | grep com.video-agent → không có output.
  • Windows: schtasks /query /tn VideoAgentAssetIndex → “Task does not exist”.
  • Linux: systemctl --user status video-agent-asset-index → not-found.
2

Xoá runtime files

rm -rf .asset_index/   # DB + state + logs
rm -rf .venv/          # virtualenv
rm -f .env             # API keys
3

Optional — xoá nguồn

Nếu muốn gỡ hoàn toàn:
cd ..
rm -rf video-automator-skills/
Xoá .env = mất API keys đã setup. Backup trước nếu muốn dùng lại sau.

Backup full repo

Để move sang máy khác:
tar --exclude=.venv --exclude=.asset_index --exclude=node_modules \
  -czf video-automator-backup.tar.gz video-automator-skills/
Trên máy mới: extract → chạy lại bootstrap → re-scan để rebuild index.

Kiểm tra dung lượng

DB + raw_assets có thể lớn nhanh. Check size:
du -sh .asset_index/ raw_assets/
Nếu DB > 1GB, cân nhắc:
  • Xoá file không còn cần trong raw_assets/ → re-scan để cleanup assets rows orphaned.
  • Vacuum DB:
    .venv/bin/python -c "import apsw; apsw.Connection('.asset_index/index.db').execute('VACUUM')"
    

Bước tiếp theo

Khắc phục sự cố

Lỗi sau khi update.

Đóng góp

Submit feedback / patch về repo.