@liquisio/git-cli
v0.0.17
Published
Tool to connect Blocks Code to Github - [re]connect local code to remote with smart conflict detection
Maintainers
Readme
LQ CLI
Git reconnect tool for Wix Blocks. When your container resets and .git disappears, run one command to reconnect.
Beta Version
Looking for beta testers or any feedback. Please read this doc carefully before you start. Report issues or ask questions here
Quick Start
1. Install (paste in Wix Blocks terminal):
cd /user-code && npm install @liquisio/git-cli --cache=/tmp/.npm && export PATH="$PATH:./node_modules/.bin"Paste tip: Use
Ctrl+Shift+V(Windows/Linux) orCmd+Shift+V(Mac)
2. Create config at src/backend/lqcli.config.mjs:
export default {
git: {
name: 'Your Name',
email: '[email protected]',
user: 'github-username',
repo: 'repo-name',
},
};3. Create token at src/backend/.env:
LQCLI_TOKEN=github_pat_xxxxGet a token at github.com/settings/personal-access-tokens with Contents: Read and write permission.
4. Push or Pull your code:
lqcli push # Push local code to GitHub
lqcli pull # Pull GitHub code to local
lqcli status # Compare local vs remote (read-only)Done. Your .git is restored — use normal git commands until the next reset.
Before You Start
Backup your code before testing:
Option 1: Duplicate your Blocks app Test on the copy
Option 2: Download a backup Tar your src folder and download the file
tar -czvf /user-code/backup.tar.gz src/Then right-click backup.tar.gz in the VS Code file explorer → Download
Notes
- If you loose any files, there is no going back.
- The cli installation, status and push commands are safe as they do not touch your source code.
- Pull command is tricky, its a bit complex so lets take measures till we get to Version 1.
- I have about 350 tests which are doing a good job and I have now been using this tool for 2 weeks.
- Extra tip : I write minimal code in Widget's main source files and skip the
src/sitedirectory completely usingskipDirectories: ['site']setting in config file.
Commands
| Command | Description |
|---------|-------------|
| lqcli push | Push local code to GitHub |
| lqcli pull | Pull GitHub code to local |
| lqcli status | Compare local vs remote |
| lqcli restore | Restore from backup |
After Reconnection
Once you run lqcli push or lqcli pull, your .git is restored. Use standard git commands for the rest of your session:
git status # Check changes
git add . && git commit -m "x" # Commit
git push # Push to GitHub
git log # View historylqcli is only needed again when your container resets and .git disappears.
Limitations
Note: These limitations apply to lqcli only. After reconnection, all standard git commands work normally.
- Single branch — Works with one branch (default:
main) - GitHub only — No GitLab, Bitbucket, or self-hosted support
- Single directory sync — Only syncs
src/(configurable) - No merge — Uses reset/overwrite, not git merge
- All-or-nothing conflicts —
--ours/--theirsapplies to all files - Ephemeral backups — Stored in
/tmp, lost on reboot
See full documentation for all options and details.
