> For the complete documentation index, see [llms.txt](https://cjays-organization.gitbook.io/nexora.ts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cjays-organization.gitbook.io/nexora.ts/getting-started/quick-start.md).

# Quick start

Create a production-ready Nexora bot in minutes.

## Requirements

* Node.js **≥ 20**
* pnpm **9.x** (recommended)

```bash
npm install -g pnpm@9.15.0
```

## Scaffold a project

```bash
npx @nexora.ts/create@latest my-bot
cd my-bot
pnpm install
cp .env.example .env
```

Edit `.env` and set at least:

```bash
DISCORD_TOKEN=your_bot_token
DISCORD_CLIENT_ID=your_client_id
```

Scripts use Node’s `--env-file=.env`, and `@nexora.ts/config` also loads `.env` via `loadEnv()` so `process.env` is ready when `defineConfig` runs.

## Run

```bash
pnpm dev
```

`pnpm dev` starts your bot, the Studio API (`:3920`), and an **embedded Studio UI** on **<http://localhost:3002>** — no second terminal needed. This is the default after scaffolding.

| Service           | URL                     |
| ----------------- | ----------------------- |
| **Nexora Studio** | <http://localhost:3002> |
| Studio API        | <http://127.0.0.1:3920> |

Open **:3002** for the [Developer Center](/nexora.ts/nexora-studio/studio.md) — live commands, plugins, logs, and bot status for your project.

![Nexora Studio](https://3248729062-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFYINlcdaLANBg99zQoZP%2Fuploads%2Fgit-blob-c41c2d2b08d23746c4e755ce289ce9ea24bf6e19%2Fstudio-overview.png?alt=media)

### Optional: `nexora` CLI

The scaffold does **not** put `nexora` on your PATH by itself. `@nexora.ts/create` only creates the project; the `nexora` binary lives in that same npm package.

If you want `nexora dev` (wrapper around `pnpm run dev`, plus Vite Studio UI when `@nexora.ts/studio` is available), install the CLI first:

```bash
# One-off (no global install)
npx -p @nexora.ts/create nexora dev

# Or install globally once
npm install -g @nexora.ts/create
nexora dev

# Or keep it in this project
pnpm add -D @nexora.ts/create
pnpm exec nexora dev
```

Run these from the **bot project root** (where `package.json` is). Details: [create-nexora-ts / `nexora` CLI](/nexora.ts/packages/cli.md).

Public docs (this site): <https://cjays-organization.gitbook.io/nexora.ts>

## Your first command

```ts
// commands/ping.ts
import { command } from '@nexora.ts/core';

export default command({
  name: 'ping',
  description: 'Check bot latency',
  async execute(ctx) {
    await ctx.reply('Pong!');
  },
});
```

## Your first event

```ts
// events/ready.ts
import { event } from '@nexora.ts/core';

export default event('ready', (client) => {
  console.log(`Logged in as ${client.user.tag}`);
});
```

Commands and events are **auto-discovered** — no manual registration. Prefer classes? See [Classes](/nexora.ts/classes/index.md).

## Updating Nexora packages

Keep your bot on the latest framework releases:

```bash
# Update core (recommended)
pnpm add @nexora.ts/core@latest

# Or update every @nexora.ts package in the project
pnpm update "@nexora.ts/*"
```

When you start the bot, Nexora checks npm for a newer `@nexora.ts/core`. If an update exists, the console shows something like:

```
WARN  Update available: @nexora.ts/core@0.1.3 → 0.1.4
INFO  Update with:  pnpm add @nexora.ts/core@latest
INFO  Or all pkgs:  pnpm update "@nexora.ts/*"
```

Disable the check with `updateCheck: false` in `defineConfig`, or set `NEXORA_UPDATE_CHECK=0`.

## Next steps

* [Configuration](/nexora.ts/getting-started/configuration.md)
* [Commands](/nexora.ts/commands-and-interactions/commands.md)
* [Nexora Studio](/nexora.ts/nexora-studio/studio.md)
* [Plugins](/nexora.ts/advanced/plugins.md)
* [Logging](/nexora.ts/advanced/logging.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cjays-organization.gitbook.io/nexora.ts/getting-started/quick-start.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
