Skip to content

Add local repo scan import#7

Open
clyons wants to merge 1 commit into
ericblue:masterfrom
clyons:codex/local-repo-scan
Open

Add local repo scan import#7
clyons wants to merge 1 commit into
ericblue:masterfrom
clyons:codex/local-repo-scan

Conversation

@clyons
Copy link
Copy Markdown

@clyons clyons commented May 11, 2026

Purpose / Big Picture

A new VibeFocus user often already has a folder full of local git repositories, but the current setup path still expects them to create projects one at a time before the app becomes useful. This PR adds a fast, safe onboarding path from “I have a directory of repos” to “VibeFocus has my portfolio.”

The scan is intentionally lightweight: it creates or updates project records, stores local paths, infers GitHub remotes and basic metadata, and refreshes read-only git stats. It does not import commit logs during first scan, so the initial import stays quick; users can run Analytics sync later when they want heatmaps, velocity, streaks, and health history.

Summary

Adds a local git repository import path for fresh VibeFocus installs:

  • scans a backend-visible directory for git repos from Settings or make import-projects
  • creates or updates projects idempotently by local_path, github_url, then name
  • infers GitHub URLs from origin, local path, tech stack, description, status, priority, and lightweight git stats
  • keeps commit-log import out of scan so first import stays fast; Analytics sync remains the explicit path for heatmaps/velocity/history
  • shows clear Settings guidance for unconfigured or missing directories, including Docker mount cases
  • fixes the new-project drawer cache race and labels the Settings button distinctly from States/Categories

Fixes #1.

Notes

Local repo import works without an Anthropic API key. AI chat and analysis still require a configured Anthropic key when those features are used.

Local planning reference in the fork workspace: .agent/execplans/2026-05-11-local-repo-scan-onboarding.md.

Validation

  • make fe-build
  • cd backend && ./venv/bin/python -m py_compile main.py import_local_projects.py services/*.py routers/*.py
  • CLI empty-db smoke with no Anthropic key:
    • first run: 2 repos created, 0 commit rows imported
    • second run: same 2 repos updated, no duplicates
  • API empty-db smoke with no Anthropic key:
    • GET /api/data/scan-config reports configured temp repo root as ready
    • first POST /api/data/scan: created: 2, updated: 0, skipped: 0
    • second POST /api/data/scan: created: 0, updated: 2, skipped: 0
    • database count after both scans: 2 projects, 0 commit rows
  • Error smoke:
    • missing scan root returns scan_root_missing
    • unconfigured scan root returns scan_root_required

@clyons clyons marked this pull request as ready for review May 11, 2026 02:25
@clyons clyons changed the title [codex] Add local repo scan import Add local repo scan import May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bulk import for local git repositories

1 participant