Project URL: Glitch :･ﾟ✧
doOtPull et al. in
(permalink to this version: snail-cli/index.js at v1.4.0 · wh0/snail-cli · GitHub)
The “OT” service is the part of Glitch that the web editor connects to, meaning:
- It can handle the “multiplayer” case where multiple collaborators type at the same time.
- Users on the real web editor can see changes immediately without you having to run
- You can use it to look at public projects without being a collaborator.
- It’s suitable for dealing with few, smallish text files.
I’ve written up a collection of command line tools:
pull (kind of like
ls (kind of like
These tools don’t connect for a significant length of time and work interactively; they instead take a quick look to find the file they need, send the change, and exit. As a result, the code is simplified in that it doesn’t have the logic to watch for changes and resolve merge conflicts, and its notion of correctness is only to the level of “it should do the right thing if nothing else is going on.”
Bonus note: some fancier safeguards from the web editor aren’t replicated, such making sure you’re not trying to move a directory into a subdirectory inside itself.