SYNC-PROJECT(1)                   Project Sync Toolkit                   SYNC-PROJECT(1)

NAME
    sync-project.sh - Sync projects between remote servers and local machine

SYNOPSIS
    sync-project.sh [OPTIONS]

DESCRIPTION
    Downloads a project from a remote server and optionally generates helper
    scripts for ongoing synchronization. Uses tar for initial sync and rsync
    for subsequent syncs.

    Server project path defaults to ~/public_leo if left empty. Paths starting
    with ~ are automatically resolved to full paths via SSH.

    New servers are automatically trusted (StrictHostKeyChecking=accept-new).

OPTIONS
    -h, --help
        Display this help and exit.

    --files-only
        Quick sync mode. Downloads files only, excluding node_modules and
        vendor directories. Does not create helper scripts, sftp.json, or
        upload lazygit.

    --sftp-only
        Setup mode for SFTP workflow. Creates helper scripts but skips
        lazygit upload and .gitignore modifications.

    --git
        Git clone mode. Clones the repository from the remote server using
        SSH with password authentication. Uploads lazygit to the server and
        marks it as assume-unchanged (both locally and on server). Only
        generates ssh.sh helper script.

MODES
    Default mode:
        - Syncs terminal info (xterm-ghostty or xterm-kitty)
        - Downloads all project files
        - Creates .vscode/sftp.json
        - Generates all helper scripts
        - Uploads lazygit to server
        - Updates .gitignore

    --sftp-only mode:
        - Downloads all project files
        - Creates .vscode/sftp.json
        - Generates: local-remote.sh, remote-local.sh, sftp-watch.sh, ssh.sh
        - No lazygit, no .gitignore updates

    --files-only mode:
        - Downloads project files (excludes node_modules, vendor)
        - No helper scripts
        - No configuration files

    --git mode:
        - Clones git repository via SSH with password
        - Uploads lazygit to server
        - Marks lazygit as assume-unchanged (server + local)
        - Generates: ssh.sh only
        - No tar archive, no sftp.json, no other scripts

EXAMPLES
    Full setup with all scripts:
        ./sync-project.sh

    Quick file sync only:
        ./sync-project.sh --files-only

    SFTP workflow without git tools:
        ./sync-project.sh --sftp-only

    Clone git repository from server:
        ./sync-project.sh --git

GENERATED SCRIPTS
    remote-local.sh     Pull files from server
    local-remote.sh     Push files to server
    ssh.sh              SSH with --db, --git, --todo flags
    sftp-watch.sh       Continuous sync with watchexec
    watch-build.sh      Build and deploy automation
    split-conflicts.sh  Git conflict resolver

REQUIREMENTS
    sshpass, rsync, tar, ssh/scp
    Optional: watchexec (for watch scripts)

FILES
    .sync-credentials   Pre-defined config (optional)
    .vscode/sftp.json   VS Code SFTP config (generated)
