# Upgrading Yarn Scripts

The Yarn Spinner Console (`ysc`) can upgrade your older `.yarn` scripts to the latest syntax.

{% hint style="info" %}
The Yarn Spinner Console (`ysc`) is in heavy development, and is likely to have its own complete section here, in the documentation, before long. Until then, find further initial documentation via [its GitHub project](https://github.com/YarnSpinnerTool/YarnSpinner-Console).
{% endhint %}

To upgrade your scripts:

**Install the version of Yarn Spinner Console that matches your version of Yarn Spinner**. You can do this via the [Yarn Spinner Console GitHub Project](https://github.com/YarnSpinnerTool/YarnSpinner-Console). Choose *Releases* in the sidebar, and download the appropriate binary for your platform. If you just want the latest release, you can find it [here](https://github.com/YarnSpinnerTool/YarnSpinner-Console/releases/latest).

**Run the upgrader on your scripts.** To upgrade, you must run `ysc` on your command-line/terminal with the `upgrade` parameter and a path to a `yarn file:`

```
$ ysc upgrade myOldYarnFile.yarn
```

**You can also run the upgrade on multiple scripts at once.** To do this, you can pass in as many `.yarn` files as you want:

```
ysc upgrade myOldYarnFile.yarn myOtherOldYarnFile.yarn
```

{% hint style="danger" %}
By default, `ysc` will replace the existing `.yarn` files you've passed in, as part of the upgrade. If you don't want it to do this, either make sure you have a backup, or pass in the `--output-directory` option, after the `upgrade` parameter. For example:

```
ysc upgrade --output-directory ./output myOldYarnFile.yarn
```

{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.yarnspinner.dev/2.0/getting-started/upgrading-yarn-scripts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
