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

# Getting started

> Install the CLI, create a script and see it run.

Scripts are TypeScript or JavaScript modules that run inside the cheat. The `spd` CLI creates
projects, compiles them and keeps the type definitions up to date.

## Install

<Steps>
  <Step title="Editor">
    [VS Code](https://code.visualstudio.com/) or [WebStorm](https://www.jetbrains.com/webstorm/).
    The CLI sets up types and the debugger for both. Projects also come with a `CLAUDE.md` and an
    API cheat sheet for [Claude Code](https://claude.ai/claude-code) and other assistants.
  </Step>

  <Step title="Node.js">
    [Node.js](https://nodejs.org/) LTS, for the TypeScript compiler. Plain JavaScript projects
    run without it, but you lose type checking.
  </Step>

  <Step title="Spurdo CLI">
    In PowerShell:

    ```powershell theme={null}
    irm https://api.spurdoverse.app/cdn/cli/install.ps1 | iex
    ```

    Restart the terminal, then check it with `spd --version`.
  </Step>
</Steps>

## Create a project

```bash theme={null}
spd new
```

It asks for a name, TypeScript or JavaScript, and a linter (Biome, ESLint or none), then creates
the project in `C:\Spurdo\scripts\` and installs what it needs.

```
C:\Spurdo\scripts\
├── types\            shared .d.ts files, updated by spd sync
└── my-script\
    ├── manifest.json
    ├── CLAUDE.md
    ├── src\index.ts  your code
    ├── dist\         compiled output, what the cheat runs
    └── data\         @native/fs root, created on first use
```

[manifest.json](/api/manifest) holds the name, entry file and permissions. The new project already
has a working example in `src/index.ts`: a menu page, an ESP element and enemy boxes. JavaScript
projects have no `dist\` folder, the cheat runs `src\index.js` directly.

## Run it

```bash theme={null}
cd C:\Spurdo\scripts\my-script
spd watch
```

`spd watch` recompiles on every save and the cheat reloads the script when its files change. In a
JavaScript project there's nothing to compile, just save.
`console.log` output and uncaught errors go to the cheat log, tagged with the script name.

A minimal script, to see the loop working:

```ts theme={null}
import render from "@native/render";
import game from "@native/game";

on("render", () => {
    render.text([20, 20], game.shortMapName ?? "not in a map", "#ffffff", { outline: true });
});

on("keydown", (e) => {
    if (e.code === "F6" && !e.repeat) console.log(`hello from ${script.name}`);
});
```

Logic goes in `tick`, drawing in `render`.

## Commands

| Command | |
| :- | :- |
| `spd new` | Create a project |
| `spd watch` | Recompile on every save |
| `spd build` | Compile once, fail on type errors |
| `spd lint` | Lint and fix `src/` with the linter picked at `spd new` |
| `spd sync` | Update the shared `types\` after a cheat update |
| `spd update` | Update the CLI |
| `spd docs` | Open these docs |

## Debugging

Turn on **Debug** for the script in the cheat's Scripts page (it reloads), then run the
**Attach to Spurdo** configuration in VS Code or WebStorm. It connects to `127.0.0.1:9229`, and
source maps are on, so breakpoints work in your `.ts` files.

## Next steps

<CardGroup cols={2}>
  <Card title="Build an ESP" icon="eye" href="/learn/building-esp">
    Builder elements, overlay boxes and a menu toggle, step by step.
  </Card>

  <Card title="Globals" icon="globe" href="/api/globals">
    Events, timers, `console`, `script`.
  </Card>

  <Card title="Render" icon="pen" href="/api/render">
    Drawing on the overlay.
  </Card>
</CardGroup>


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