Overview
Weavers are ephemeral Kubernetes pods that provide isolated, remote development environments for running Loom REPL sessions. Each weaver runs a container with a full development environment and can optionally clone a git repository.Quick Start
Commands
new
Create a new remote weaver session.Container image to use for the weaver
Organization ID, slug, or name. Defaults to your personal organization if not specified.
Git repository to clone (public HTTPS URL)Example:
https://github.com/user/repoGit branch to checkout (requires
--repo)Example: main, develop, feature/new-apiEnvironment variables (repeatable)Format:
KEY=VALUEExample: -e NODE_ENV=production -e DEBUG=trueLifetime in hours (max: 48)Weaver will automatically terminate after this duration.
attach
Attach to a running weaver’s terminal.Weaver ID to attach to
- The connection uses WebSocket for bidirectional terminal I/O
- Press
Ctrl+Cor close terminal to detach - The weaver continues running after detach
- Reattach later with
loom attach <weaver-id>
ps
List all running weavers.Output as JSON
delete
Delete a weaver (terminates the pod).Weaver ID to delete
Architecture
Kubernetes Backend
Weavers run as Kubernetes pods in theloom-weavers namespace:
- Orchestration: Managed by
loom-server-weaverprovisioner - Networking: Each pod gets a cluster IP for WebSocket connections
- Storage: Ephemeral storage (data is lost when pod terminates)
- Resources: Configurable CPU/memory limits via server config
WebSocket Protocol
Attachment uses WebSocket for bidirectional terminal I/O:- Connection: CLI connects to
wss://server/api/weaver/<id>/attach - Authentication: Bearer token in
Authorizationheader - Stdin: Binary messages sent to pod’s stdin
- Stdout/Stderr: Binary messages received from pod
- Ping/Pong: Automatic keepalive
- Close: Graceful disconnection on Ctrl+C or EOF
Lifecycle
States:- Pending: Pod is being scheduled/started
- Running: Container is running and ready
- Succeeded: Container exited with code 0
- Failed: Container crashed or failed to start
- Unknown: Status cannot be determined
Organization Management
Personal Organization
Every user has a personal organization for individual weavers:Team Organizations
Create weavers in shared team organizations:- If it looks like a UUID → use as organization ID
- Otherwise → lookup by slug or name via API
Environment Variables
Pass environment variables to weavers:Git Integration
Clone Repository
Weavers can automatically clone a git repository on startup:- Repository must be public (HTTPS URL)
- Branch is optional (defaults to repository’s default branch)
- Clone happens during container initialization
Working Directory
When a repository is cloned:- Working directory:
/workspace/<repo-name> - Git repository is ready to use
- All tools operate within this workspace
Troubleshooting
Weaver Creation Fails
Image Pull Error:- Verify the image exists and is accessible
- Check image registry credentials are configured on server
- Use a public image for testing
Weaver Exits Immediately
Container has no long-running process:- Weaver images must run a persistent process (e.g.,
tail -f /dev/null, shell, or REPL) - Check container’s CMD/ENTRYPOINT is not a one-shot command
Connection Issues
WebSocket Connection Failed:- Check network connectivity to server
- Verify server allows WebSocket connections
- Check firewall allows WSS traffic
- Weaver may be starting up (wait for Running status)
- Check weaver status:
loom weaver ps
Debug with kubectl
Server operators can debug weavers directly:Server Configuration
Weaver behavior is configured server-side inloom-server config:
Security Considerations
Isolation
- Each weaver runs in an isolated Kubernetes pod
- Network policies can restrict pod-to-pod communication
- Resource limits prevent resource exhaustion
Authentication
- All weaver API calls require valid authentication token
- WebSocket connections verify token before allowing attachment
- Users can only access weavers in their authorized organizations
Secrets
Better approaches:- Use Kubernetes secrets (requires server-side configuration)
- Mount secrets as files in container
- Fetch secrets from secret manager at runtime
Best Practices
Resource Management
- Set appropriate TTL: Don’t waste resources on idle weavers
- Delete when done: Manually delete weavers you’re finished with
- Monitor usage: Use
loom weaver psto track active weavers
Container Images
- Use specific tags: Avoid
latestfor reproducibility - Keep images small: Faster startup times
- Include necessary tools: Git, text editors, language runtimes
- Set working directory: Use
WORKDIR /workspacein Dockerfile
Git Workflows
- Clone vs Manual: Use
--repofor quick setup, manual clone for flexibility - Branch naming: Use descriptive branch names for easy identification
- Commit often: Weaver storage is ephemeral
Related Pages
CLI Overview
Main CLI commands and setup
REPL Commands
Interactive session tools and usage