Description
Description
When running limactl shell --sync currently the whole working directory is synced to the guest system, and then also synced back. For projects with large genereated/dependency directories (eg. node_modules, vendor, build) this can make the initial sync slower, and make the sync-back noisier then necessary.
Especially in the AI agent use-case, we might also want to exclude certain folders being synced to the guest (eg. .git to exclude metadata).
Proposal
To allow the user to exclude a path a --sync-exclude flag could be introduced, which is then passed as --exclude to rsync. Making this flag repeatable would provide a lot of flexibility, while keeping the implementation simple as rsync also accepts multiple --exclude flags.
$ limactl shell --sync . --sync-exclude=node_modules --sync-exclude=.git default
Another option would be to introduce a .limasyncignore file, simlar to .dockerignore or .gitignore. This would need to reside in the root directory beeing synced, and could be passed to rsync as --exclude-from. The format would be the same as the rsync exclude file with one pattern per line.
eg.
node_modules
.git
vendor
build
dist
*.o
Implementation
The excludes could be appended to the additionalArgs when running the shell --sync command, and would also need to be apllied when running getRsyncStats as well as rsyncBack
Description
Description
When running
limactl shell --synccurrently the whole working directory is synced to the guest system, and then also synced back. For projects with large genereated/dependency directories (eg. node_modules, vendor, build) this can make the initial sync slower, and make the sync-back noisier then necessary.Especially in the AI agent use-case, we might also want to exclude certain folders being synced to the guest (eg. .git to exclude metadata).
Proposal
To allow the user to exclude a path a
--sync-excludeflag could be introduced, which is then passed as--excludeto rsync. Making this flag repeatable would provide a lot of flexibility, while keeping the implementation simple as rsync also accepts multiple--excludeflags.Another option would be to introduce a
.limasyncignorefile, simlar to.dockerignoreor.gitignore. This would need to reside in the root directory beeing synced, and could be passed to rsync as--exclude-from. The format would be the same as the rsync exclude file with one pattern per line.eg.
Implementation
The excludes could be appended to the
additionalArgswhen running theshell --synccommand, and would also need to be apllied when runninggetRsyncStatsas well asrsyncBack