# Getting Started

> Start developing with the GenAIScript VS Code Extension to create AI scripts efficiently.

GenAIScript is a scripting language that integrates LLMs into the scripting process using a simplified JavaScript syntax. Supported by our VS Code GenAIScript extension, it allows users to create, debug, and automate LLM-based scripts.

[Play](https://youtube.com/watch?v=ENunZe--7j0)

## Preamble

[Section titled “Preamble”](#preamble)

Before you start writing GenAIScripts, you will need to configure your environment to have access to a LLM. The [configuration](/genaiscript/getting-started/configuration) covers this topic in details as they are a lot of options to consider.

Tip

If you are running GenAIScript from a [GitHub CodeSpaces](https://github.com/features/codespaces), you can skip the configuration step as the extension will automatically use [GitHub Models](/genaiscript/configuration/github).

## Hello World

[Section titled “Hello World”](#hello-world)

A GenAIScript is a JavaScript program that builds an LLM which is then executed by the GenAIScript runtime. Let’s start with a simple script that tells the LLM to generate a poem. In typical use, GenAIScript files have the naming convention `<scriptname>.genai.mjs` and are stored in the `genaisrc` directory in a repository. Let’s call this script `poem.genai.mjs`.

poem.genai.mjs

```js
$`Write a poem in code.`
```

The `$...` syntax is [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) that renders to a user message to the LLM prompt. In this example, it would be:

```txt
Write a poem in code.
```

In practice, your script may also import [system scripts](/genaiscript/reference/scripts/system) (automatically or manually specified) that add more messages to the requests. So the final JSON payload sent to the LLM server might look more like this:

```js
{   ...
    messages: [
        { role: "system", content: "You are helpful. ..." },
        { role: "user", content: "Write a poem in code." }
    ]
}
```

GenAIScripts can be executed from the [command line](/genaiscript/reference/cli) or run with a right-click context menu selection inside Visual Studio Code. Because a GenAIScript is just JavaScript, the execution of a script follows the normal JavaScript evaluation rules. Once the script is executed, the generated messages are sent to the LLM server, and the response is processed by the GenAIScript runtime.

* npm

  ```sh
  npx genaiscript run poem
  ```

* pnpm

  ```sh
  pnpx genaiscript run poem
  ```

* yarn

  ```sh
  yarn dlx genaiscript run poem
  ```

Here is an example output for this prompt (shortened) that got returned by OpenAI gpt-4o.

````markdown
```python
def poem():
    # In the silence of code,
    ...