Updated context files

This commit is contained in:
2026-01-17 16:50:09 +02:00
parent f19eec605a
commit ca293b1b54
2 changed files with 100 additions and 7 deletions

View File

@@ -30,10 +30,12 @@ From your projects directory, run:
./sync-project.sh
```
Or for SFTP-only setup (skips lazygit and .gitignore modifications):
**Available flags:**
```bash
./sync-project.sh --sftp-only
./sync-project.sh -h # Show help manual
./sync-project.sh --files-only # Quick sync (files only, no scripts)
./sync-project.sh --sftp-only # SFTP setup (no lazygit, no .gitignore updates)
```
## What the Script Does
@@ -42,16 +44,21 @@ When you run `sync-project.sh`, it will:
1. **Ask for configuration:**
- Server user@host (e.g., `user@example.com`)
- Server project path (e.g., `/home/user/public_html`)
- Local folder path (e.g., `my-project`)
- SSH password
- Server project path (defaults to `~/public_leo`, supports `~` paths)
- Local folder path (e.g., `my-project`)
2. **Sync your project:**
2. **Prepare the connection:**
- Auto-accepts new server host keys (first-time connections work seamlessly)
- Resolves `~` paths to full paths via SSH
- Syncs terminal info for ghostty/kitty terminals (full sync only)
3. **Sync your project:**
- Creates a tar archive on the remote server
- Downloads and extracts it to your local folder
- Cleans up temporary files
3. **Generate configuration and scripts:**
4. **Generate configuration and scripts:**
- Creates `.vscode/sftp.json` for VS Code SFTP extension
- Generates helper scripts with your credentials pre-configured
- Adds scripts to `.gitignore` (unless using `--sftp-only`)
@@ -94,18 +101,21 @@ After running the sync script, you'll have these helper scripts in your project:
**What it does:**
- Opens an SSH connection to your server
- Changes directory to your project path
- Supports `--db` flag for MySQL port forwarding
- Multiple operation modes via flags
**Usage:**
```bash
./ssh.sh # Normal SSH connection
./ssh.sh --db # SSH with MySQL port forwarding (local:3306 -> remote:3306)
./ssh.sh --git # Launch lazygit on server, sync changes back when done
./ssh.sh --todo # Search for TODO markers in project files
```
**Use cases:**
- Run commands on the server
- Check logs
- Access remote database via localhost:3306
- Git operations via lazygit
### `sftp-watch.sh`
**Purpose:** Continuous bidirectional sync
@@ -139,6 +149,32 @@ After running the sync script, you'll have these helper scripts in your project:
- Automatic deployment of compiled assets
- Continuous integration during development
## Sync Modes
### Default Mode
Full setup with all features:
- 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`
### `--files-only` Mode
Quick sync for when you just need the files:
- Downloads project files (excludes `node_modules`, `vendor`)
- No helper scripts generated
- No configuration files created
- No lazygit upload
### `--sftp-only` Mode
Lightweight setup for SFTP workflows:
- Downloads all project files
- Creates `.vscode/sftp.json`
- Generates: `local-remote.sh`, `remote-local.sh`, `sftp-watch.sh`, `ssh.sh`
- No lazygit upload
- No `.gitignore` modifications
## Requirements
- **bash** - Shell scripting