Is there a way to copy files to/from the sprite? Couldn't see an option for that in the CLI
There's an FS API that shipped yesterday:
/fs/read?path=X | GET | Read file (supports Range headers)
/fs/write?path=X | PUT | Write file (body = raw bytes)
/fs/list?path=X | GET | List directory
/fs/delete?path=X | DELETE/POST | Delete files/dirs
/fs/rename | POST | Rename/move
/fs/copy | POST | Copy files/dirs
/fs/chmod | POST | Change permissions
/fs/chown | POST | Change ownership
/fs/watch | GET (WebSock) | Watch for filesystem changes
It'll get CLI support very soon.But I've just been using magic-wormhole for this.
I would love to just mount a directory via SFTP, so I can use my IDE alongside the far-away Claude. That would put this in the realm of daily use for development.
`cat file.txt | sprite exec -s <name> bash -c "cat > ~/file.txt"` is my go to.
I was trying to copy a directory and used:
Pull from sprite to local: sprite exec -s my-sprite sh -c "tar -czf - /home/sprite/<my_dir>" | tar -xzf - -C ./
Push from local to sprite: COPYFILE_DISABLE=1 tar -czf - <my_dir> | sprite exec -s my-sprite sh -c "tar -xzf - -C /home/sprite/"