You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you run a command that requires a version that isn't installed yet, dtvem will offer to install it automatically:
213
+
When you run a command that requires a version that isn't installed yet, dtvem will tell you how to install it:
214
214
215
215
```bash
216
216
$ python --version
217
-
⚠ Python 3.11.0 is not installed
218
-
→ Install it now? [Y/n]: y
219
-
→ Installing Python 3.11.0...
220
-
✓ Successfully installed Python 3.11.0
221
-
Python 3.11.0
217
+
✗ Python 3.11.0 is configured but not installed
218
+
→ To install, run: dtvem install python 3.11.0
222
219
```
223
220
224
-
This works seamlessly with bulk install - just clone a repo with a `.dtvem/runtimes.json` file and start using it. The first time you run a command, dtvem will offer to install the required version.
225
-
226
-
**Environment Variable Control:**
227
-
-`DTVEM_AUTO_INSTALL=false` - Disable auto-install in CI/automation
228
-
-`DTVEM_AUTO_INSTALL=true` - Auto-install without prompting
229
-
- Default - Interactive prompt
221
+
**Bulk Install from Config:**
222
+
Clone a repo with a `.dtvem/runtimes.json` file and run:
-`DTVEM_AUTO_INSTALL`: Control auto-install behavior when a configured version is missing
373
-
-`false` - Disable auto-install prompts (useful for CI/automation)
374
-
-`true` - Auto-install without prompting
375
-
- Not set - Interactive prompt (default)
376
370
377
371
## Supported Runtimes
378
372
@@ -462,31 +456,49 @@ Remove this installation? [y/N]: y
462
456
463
457
## Plugin System
464
458
465
-
dtvem uses an embedded plugin system with a registry pattern. Each runtime provider owns its shim definitions (executables it provides), making the architecture fully decentralized:
459
+
dtvem uses an embedded plugin system with a registry pattern. Each runtime provider owns its shim definitions (executables it provides), making the architecture fully decentralized.
460
+
461
+
### Provider Interfaces
462
+
463
+
Providers implement two interfaces - a lightweight `ShimProvider` for the shim binary, and the full `Provider` for the CLI:
466
464
467
465
```go
468
-
// Each runtime implements the Provider interface (19 methods)
469
-
typeProviderinterface {
466
+
// ShimProvider - minimal interface used by the shim binary
467
+
// Excludes heavy dependencies like net/http to keep shim fast and small
**Why two interfaces?** The shim binary runs on every `node`, `python`, `npm` command. By using `ShimProvider`, Go's linker eliminates unused code (like `net/http`), reducing shim size from ~10MB to ~4.5MB and improving startup time.
478
488
489
+
### Adding a New Runtime
490
+
491
+
1. Create `src/runtimes/<name>/provider.go`
492
+
2. Implement the `Provider` interface (which includes all `ShimProvider` methods)
493
+
3. Import in `src/main.go` and `src/cmd/shim/main.go`
494
+
495
+
```go
479
496
// Runtimes auto-register on startup
480
497
funcinit() {
481
498
runtime.Register(NewProvider())
482
499
}
483
500
```
484
501
485
-
**Adding a new runtime is as simple as:**
486
-
1. Create `src/runtimes/<name>/provider.go`
487
-
2. Implement the `Provider` interface (including `Shims()` and `ShouldReshimAfter()`)
488
-
3. Import in `src/main.go`
489
-
490
502
**That's it!** The shim mappings are automatically registered via the `Shims()` method, and automatic reshim detection works via `ShouldReshimAfter()`. No need to modify central mapping files.
0 commit comments