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

# sauce update

> Update the sauce command the way it was installed, or check which version an update would install.

`sauce update` updates the active installation of `@eco-incorp/sauce`. Its behavior depends on whether you installed the package globally, in a project, or through npx.

## Synopsis

```bash theme={null}
sauce update [--check] [--version <version|tag>] [--json]
```

## Description

`sauce update` reads the version to install from the npm registry when it runs. It decides what to do from its own path:

| Installed as | What `sauce update` does |
| - | - |
| A global install | npm, pnpm, yarn or bun installs the version globally again, run with no shell (npm with the prefix this copy is under). The command prints the version before and after. |
| A project's copy | Prints the command the project's package manager takes to update it, pinned exactly, and runs nothing. |
| npx's cache | Prints the `npx -y` command that runs the latest version. |
| Anything else | Refuses, and prints npm's global install command. |

After a global update, the new `sauce` updates the skills installed in the current directory (the targets [`sauce skills status`](https://docs.eco.com/sauce-sdk/cli/skills) reports) and prints what changed. Where the replaced version had its runtime packages installed, the new `sauce` installs its own ([`sauce runtime`](https://docs.eco.com/sauce-sdk/cli/runtime)).

`--check` reads the registry and installs nothing.

Every other command prints one line on stderr when its update check has seen a newer version, and suggests `sauce update`. [The update notice](https://docs.eco.com/sauce-sdk/operating/upgrading.md#the-update-notice) describes that check, its cache and how to turn it off.

## Options

| Option | Description |
| - | - |
| `--check` | Print which version is installed and which version an update would install; install nothing. |
| `--version <version\|tag>` | The version or npm dist-tag to install (default: `latest`). |
| `--json` | Print one JSON object instead. |
| `-h, --help` | Show the help. |
| `--no-update-check` | Print no notice of a newer `sauce`, and do not read the registry for one. |

## Output

Text output names the package, the installed version, how it was installed and the latest version, then what an update does. With `--json`:

| Field | Meaning |
| - | - |
| `package` | `@eco-incorp/sauce` |
| `installation` | How this copy was installed: `kind`, `manager`, `description`, and for a project's copy the `project` path and `dev` |
| `current` | The installed version |
| `latest` | The registry's latest version |
| `target` | The version an update installs |
| `upToDate` | Whether the installed copy needs no update |
| `command` | The command that updates this copy, where the command prints one instead of running it |

## Examples

### Check for an update

Run from a project whose `node_modules` holds the package:

```bash theme={null}
sauce update --check
```

```text theme={null}
@eco-incorp/sauce <version>, /path/to/project's own copy (npm); the latest is <version>
This is the project's own copy, and it is up to date.
```

### Check, as JSON

```bash theme={null}
sauce update --check --json
```

```json theme={null}
{
  "package": "@eco-incorp/sauce",
  "installation": {
    "kind": "project",
    "manager": "npm",
    "project": "/path/to/project",
    "dev": false,
    "description": "/path/to/project's own copy (npm)"
  },
  "current": "<version>",
  "latest": "<version>",
  "target": "<version>",
  "upToDate": true,
  "command": "npm install --save-exact @eco-incorp/sauce@latest",
  "project": "/path/to/project"
}
```

## Next steps

* [The sauce command](https://docs.eco.com/sauce-sdk/cli/overview.md)
* [`sauce skills`](https://docs.eco.com/sauce-sdk/cli/skills)
* [`sauce runtime`](https://docs.eco.com/sauce-sdk/cli/runtime)
* [Package updates](https://docs.eco.com/sauce-sdk/operating/upgrading.md)


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