> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Quickstart

> Create a Mirage TypeScript workspace, mount RAM as a virtual filesystem, and run shell commands with @struktoai/mirage-node.

## Installation

Use a [supported Node release](https://docs.mirage.strukto.ai/typescript/install.md#quick-install), then install the runtime:

```bash theme={null}
pnpm add @struktoai/mirage-node
pnpm add -D tsx typescript
```

`npm install @struktoai/mirage-node` and `yarn add @struktoai/mirage-node` work too.

The packages require ECMAScript modules (ESM). In the same directory,
set `"type": "module"` in your `package.json`:

```bash theme={null}
npm pkg set type=module
```

## Create a Workspace

Start with the RAM VFS so you can try Mirage without credentials.

```ts quickstart.ts theme={null}
import { MountMode, RAMVFS, Workspace } from '@struktoai/mirage-node'

async function main(): Promise<void> {
  const ws = new Workspace({ '/data': new RAMVFS() }, { mode: MountMode.WRITE })
  await ws.shell(`echo '{"name": "alice"}' > /data/user.json`)

  const files = await ws.shell('ls /data')
  process.stdout.write(files.stdoutText)

  const name = await ws.shell('jq -r ".name" /data/user.json')
  process.stdout.write(name.stdoutText)

  const match = await ws.shell('grep alice /data/user.json')
  process.stdout.write(match.stdoutText)

  await ws.close()
}

main()
```

Run it; it lists `user.json`, prints `alice`, then prints the matching JSON
document:

```bash theme={null}
pnpm tsx quickstart.ts
```

Shell failures are returned in the result; check `exitCode` and `stderrText`
when needed. See the [in-app API reference](https://docs.mirage.strukto.ai/typescript/access/in-app.md#session-shell).

## Next Steps

* See [TypeScript Installation](https://docs.mirage.strukto.ai/typescript/install.md) for optional native peers (FUSE, Redis, Postgres, MongoDB, SSH, Email).
* Building for the browser? Start with the [Browser Quickstart](https://docs.mirage.strukto.ai/typescript/browser-quickstart.md).
* Configure [command output limits](https://docs.mirage.strukto.ai/home/core/output-limits.md) for large files and long-running commands.
* Browse [TypeScript Agents](https://docs.mirage.strukto.ai/typescript/agents/index.md) to wire Mirage into OpenAI Agents SDK, Vercel AI SDK, LangChain, Mastra, and more.
* Pick a real backend from the VFS section, such as [S3](https://docs.mirage.strukto.ai/typescript/setup/s3.md), [Slack](https://docs.mirage.strukto.ai/typescript/setup/slack.md), or [Discord](https://docs.mirage.strukto.ai/typescript/setup/discord.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.