# What dvm.run is

> Overview of dvm.run and a first sandbox in Python, TypeScript, and Rust.

This is the Markdown of https://docs.dvm.run/. Every page of the dvm.run docs is served as Markdown at its address plus `.md`; the list of pages is https://docs.dvm.run/llms.txt.

dvm.run runs Docker images in sandboxes you create, drive, and stop through an API from Python, TypeScript, or Rust. Every sandbox runs on dvm, a deterministic virtual machine, and is recorded automatically. Once it exits, seek (replay the recording to a chosen moment) to any point in the run, step through events, and read files as they existed then.

## A first sandbox

* Python

  `python/examples/first_sandbox.py`

  ```python
  from dvm import Sandbox

  with Sandbox.create("python:3.12") as sandbox:
      result = sandbox.run(["python", "-c", "print('hello from a sandbox')"])
      print(result.exit_code, result.stdout.decode(), end="")

      sandbox.write_file("/tmp/notes.txt", b"written before the end\n")
      sandbox.end()

      point = sandbox.seek()
      print(point.read_file("/tmp/notes.txt").decode(), end="")
  ```

* TypeScript

  `js/examples/first-sandbox.ts`

  ```ts
  import { Sandbox } from "dvm-run";

  await using sandbox = await Sandbox.create("python:3.12");
  const result = await sandbox.run(["python", "-c", "print('hello from a sandbox')"]);
  console.log(result.exitCode, new TextDecoder().decode(result.stdout));

  await sandbox.writeFile("/tmp/notes.txt", new TextEncoder().encode("written before the end\n"));
  await sandbox.end();

  const point = await sandbox.seek();
  console.log(new TextDecoder().decode(await point.readFile("/tmp/notes.txt")));
  ```

* Rust

  `rust/dvm-run/examples/first_sandbox.rs`

  ```rust
  #[tokio::main]
  async fn main() -> dvm_run::Result<()> {
      let client = dvm_run::Client::from_env()?;
      let sandbox = client.create_sandbox("python:3.12").await?;
      sandbox
          .scope(async |sandbox| {
              let result = sandbox
                  .run(["python", "-c", "print('hello from a sandbox')"])
                  .await?;
              print!(
                  "{} {}",
                  result.exit_code,
                  String::from_utf8_lossy(&result.stdout)
              );
              sandbox
                  .write_file("/tmp/notes.txt", b"written before the end\n")
                  .await?;
              Ok(())
          })
          .await?;

      let point = sandbox.seek_end().await?;
      let notes = point.read_file("/tmp/notes.txt").await?;
      print!("{}", String::from_utf8_lossy(&notes));
      Ok(())
  }
  ```

This creates a sandbox from `python:3.12`, waits for it to start, runs a command, prints its exit code and output, and writes a file. Closing its input ends the sandbox. Seeking to the end returns a point (a recorded moment in the run) where you can read that file back.

Install an SDK and set an API key to run it:



```sh
pip install dvm-run        # Python 3.12 or newer
npm install dvm-run        # Node 22.12 or newer
cargo add dvm-run tokio --features tokio/macros,tokio/rt-multi-thread
export DVM_API_KEY=...     # a key from the panel, or run `dvm-run login`
```

Follow [Getting in](/start/access/) to get an account and API key.

## Where next

[Getting in](/start/access/)Sign in, join the waitlist, and get an API key.

[For coding agents](/start/agents/)Shortest path to a working sandbox, plus Markdown docs.

[Sessions](/guides/sessions/)Run commands and transfer files.

[Inspecting a finished run](/guides/inspect/)Seek to a point, step through events, and read files.
