@lag0sai/connect
v0.1.6
Published
Connect a local machine to a Lag0s workspace — daemon for file operations, SQLite, and git over WebSocket
Maintainers
Readme
@lag0sai/connect
Connect a local machine to a Lag0s workspace.
This daemon runs on your machine and bridges your local filesystem to the Lag0s platform over WebSocket. It handles file operations, shell command execution, git operations, and SQLite database queries — all sandboxed to your workspace directory.
Install
npm install -g @lag0sai/connectSetup
lag0s-connect initThis walks you through:
- API URL — your Lag0s instance (default:
https://lag0s-api-t1d3.onrender.com) - Connection token — from Settings > Compute in the Lag0s dashboard
- Workspace directory — where your files live (default:
~/lag0s-workspace)
Config is saved to ~/.lag0s/connect.json (permissions restricted to owner).
Usage
# Start the daemon
lag0s-connect start
# Check status
lag0s-connect status
# Stop the daemon
lag0s-connect stopWhat it does
Once connected, the Lag0s platform can:
- Read/write files in your workspace directory
- Execute shell commands (sandboxed, with concurrency limits and timeouts)
- Run git operations (clone, status, commit, push, pull)
- Query SQLite/libSQL databases via the built-in database engine
- Index documents in The Library Catalog for search and entity spidering
All operations are sandboxed to your workspace directory — path traversal is blocked.
Security
- All file paths are resolved and validated against the workspace root before any filesystem access
- Shell commands run with sanitized environment variables (PATH, HOME, etc. cannot be overridden)
- Git URLs and refs are validated to prevent shell injection
- Command execution has configurable concurrency limits (default: 5) and timeouts (default: 60s, max: 5min)
- Connection token is stored with
chmod 600permissions - The daemon authenticates via SHA-256 token hash (token never stored server-side)
Requirements
- Node.js >= 18
- Git (for git operations)
License
MIT
