---
title: "CLI: Upgrade Source-Controlled AI Gateway Templates"
description: "Preview and apply new AI Gateway template routes and policies to your source-controlled project with the Zuplo CLI."
canonicalUrl: "https://zuplo.com/changelog/2026/10/20/ai-gateway-template-upgrades"
pageType: "changelog"
date: "2026-10-20"
tags: "cli"
---
The Zuplo CLI can now add new AI Gateway template routes and policies to a
gateway connected to source control. Preview the additions and apply them
without replacing your existing routes, policies, or custom policy code.

From a local clone of your gateway repository, install the latest `zuplo`
package and commit any dependency changes. Then preview the upgrade:

```bash
npx zuplo source upgrade --type ai-gateway
```

The command shows missing definitions and a diff without changing files. To
apply compatible additions to a clean working tree, run:

```bash
npx zuplo source upgrade --type ai-gateway --apply
```

The CLI asks for confirmation before writing. If an addition conflicts with your
configuration or can't be verified, it changes nothing and prints the
definitions for manual adoption. Review and test the result, then commit and
push to deploy through your existing workflow.

## Getting started

See
[Keep the gateway up to date](https://zuplo.com/docs/ai-gateway/source-control#keep-the-gateway-up-to-date)
for the upgrade workflow and
[Source Upgrade](https://zuplo.com/docs/cli/source-upgrade) for options and
recovery steps.