# Your first GenAI script

> Learn how to create and execute your initial GenAI script to automate interactions with language models.

GenAIScript use stylized JavaScript with minimal syntax. They are stored as JavaScript files (`genaisrc/*.genai.mjs)` or TypeScript files (`genaisrc/*.genai.mts`) in your project. The execution of a genaiscript creates the prompt that will be sent to the LLM.

1. * Visual Studio Code, Cursor

     Use the `> GenAIScript: Create new script...` command in the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) (`Ctrl+Shift+P` on Windows/Linux, `⇧⌘P` on Mac) to create a new script.

     ![A search bar with the text "createn" entered, displaying a suggestion for "GenAIScript: Create new script..." in a dropdown menu.](/genaiscript/_astro/vscode-create-new-script.Bia2CKYb_ZCe3CB.webp)

   * Other Editors

     Run the [cli](/genaiscript/reference/cli/) `script create` command with the name of the script you want to create.

     ```bash
     npx genaiscript script create proofreader
     ```

2. The resulting file will be placed in the `genaisrc` folder in your project.

   * …

   * genaisrc scripts are created here by default

     * genaiscript.d.ts (TypeScript type definitions)
     * tsconfig.json (TypeScript compiler configuration)
     * **proofreader.genai.mts**
     * …

   * …

Tip

Watch this video to learn how to turn super charge the knowledge of GenAIScript in GitHub Copilot Chat.

[Play](https://youtube.com/watch?v=0GkbxnW0J34)

## the Prompt

[Section titled “the Prompt”](#the-prompt)

The execution of the GenAIScript generates a prompt (and more) that gets sent to the LLM model.

The ` $``...`` ` template string function formats and write the string to the prompt; which gets sent to the LLM.

poem.genai.mts

```js
$`Write a one sentence poem.`
```

👤 user

```markdown
Write a one sentence poem.
```

🤖 assistant

```markdown
Roses bloom, hearts swoon, under the silver moon.
```

## Alternative: Markdown Scripts

[Section titled “Alternative: Markdown Scripts”](#alternative-markdown-scripts)

For simpler prompts, you can also use Markdown files with YAML frontmatter instead of JavaScript/TypeScript. These are easier to write and maintain for basic prompts.

Create a file named `poem.genai.md`:

poem.genai.md

```markdown
---
title: "Simple Poem Generator"
description: "Generates a one sentence poem"
model: "small"
---