Not found at this URL
https://svelte.dev/docs/cli/llms-full.txt ↗- Discovery
- Conventional sibling path checked
- HTTP response
- 404 · text/html
Developer tools · llms.txt file breakdown
Overview organizes Svelte CLI documentation around Usage, Acknowledgements, How do I run the `sv` CLI?, `npx sv` is not working and 72 more sections.
The actual file
The saved llms.txt text, displayed as source. The file belongs to its publisher; the live endpoint may change.
Showing the first 18000 characters. Load the complete file to read the remainder.
<SYSTEM>This is the developer documentation for Svelte CLI.</SYSTEM>
# Overview
The command line interface (CLI), `sv`, is a toolkit for creating and maintaining Svelte applications.
## Usage
The easiest way to run `sv` is with [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) (or the equivalent command if you're using a different package manager — for example, `pnpm dlx` if you're using [pnpm](https://pnpm.io/)):
```sh
npx sv <command> <args>
```
If you're inside a project where `sv` is already installed, this will use the local installation, otherwise it will download the latest version and run it without installing it, which is particularly useful for [`sv create`](sv-create).
## Acknowledgements
Thank you to [Christopher Brown](https://github.com/chbrown) who originally owned the `sv` name on npm for graciously allowing it to be used for the Svelte CLI. You can find the original `sv` package at [`@chbrown/sv`](https://www.npmjs.com/package/@chbrown/sv).
# Frequently asked questions
## How do I run the `sv` CLI?
Running `sv` looks slightly different for each package manager. Here is a list of the most common commands:
- **npm** : `npx sv create`
- **pnpm** : `pnpm dlx sv create`
- **Bun** : `bunx sv create`
- **Deno** : `deno run npm:sv create`
- **Yarn** : `yarn dlx sv create`
## `npx sv` is not working
Some package managers prefer to run locally installed tools instead of downloading and executing packages from the registry. This issue mostly occurs with `npm` and `yarn`. This usually results in an error message or looks like the command you were trying to execute did not do anything.
Here is a list of issues with possible solutions that users have encountered in the past:
- [`npx sv` create does nothing](https://github.com/sveltejs/cli/issues/472)
- [`sv` command name collides with `runit`](https://github.com/sveltejs/cli/issues/259)
- [`sv` in windows powershell conflicts with `Set-Variable`](https://github.com/sveltejs/cli/issues/317)
# sv create
`sv create` sets up a new SvelteKit project, with options to [setup additional functionality](sv-add#Official-add-ons).
## Usage
```sh
npx sv create [options] [path]
```
## Options
### `--from-playground <url>`
Create a SvelteKit project from a [playground](/playground) URL. This downloads all playground files, detects external dependencies, and sets up a complete SvelteKit project structure with everything ready to go.
Example:
```sh
npx sv create --from-playground="https://svelte.dev/playground/hello-world"
```
### `--template <name>`
Which project template to use:
- `minimal` — barebones scaffolding for your new app
- `demo` — showcase app with a word guessing game that works without JavaScript
- `library` — template for a Svelte library, set up with `svelte-package`
- `addon` — template for a community add-on, ready to be tested & published
### `--types <option>`
Whether and how to add typechecking to the project:
- `ts` — default to `.ts` files and use `lang="ts"` for `.svelte` components
- `jsdoc` — use [JSDoc syntax](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) for types
### `--no-types`
Prevent typechecking from being added. Not recommended!
### `--add [add-ons...]`
Add add-ons to the project in the `create` command. Following the same format as [sv add](sv-add#Usage).
Example:
```sh
npx sv create --add eslint prettier [path]
```
### `--no-add-ons`
Run the command without the interactive add-ons prompt
### `--no-download-check`
Do not warn about downloads from community add-ons.
> [!NOTE]
> Svelte maintainers have not reviewed community add-ons for malicious code! Use at your discretion.
### `--addon-name <name>`
Specify the package name when creating an addon template. Accepts `@<org>/<pkg>` or `<pkg>`. When omitted, you will be prompted for the name.
### `--install <package-manager>`
Installs dependencies with a specified package manager:
- `npm`
- `pnpm`
- `yarn`
- `bun`
- `deno`
### `--no-install`
Prevents installing dependencies.
### `--no-dir-check`
Skip checking whether the target directory is empty.
# sv add
`sv add` updates an existing project with new functionality.
## Usage
```sh
npx sv add
```
```sh
npx sv add [add-ons]
```
You can select multiple space-separated add-ons from [the list below](#Official-add-ons), or you can use the interactive prompt.
## Options
### `-C`, `--cwd`
Path to the root of your Svelte(Kit) project.
### `--no-git-check`
Do not warn about uncommitted changes.
### `--no-download-check`
Do not warn about downloads from community add-ons.
> [!NOTE]
> Svelte maintainers have not reviewed community add-ons for malicious code! Use at your discretion.
### `--install <package-manager>`
Installs dependencies with a specified package manager:
- `npm`
- `pnpm`
- `yarn`
- `bun`
- `deno`
### `--no-install`
Do not prompt to install dependencies.
## Official add-ons
- [`ai-tools`](ai-tools)
- [`better-auth`](better-auth)
- [`drizzle`](drizzle)
- [`enhanced-img`](enhanced-img)
- [`eslint`](eslint)
- [`mdsvex`](mdsvex)
- [`paraglide`](paraglide)
- [`playwright`](playwright)
- [`prettier`](prettier)
- [`storybook`](storybook)
- [`sveltekit-adapter`](sveltekit-adapter)
- [`tailwindcss`](tailwind)
- [`vitest`](vitest)
## Community add-ons
> [!NOTE]
> Svelte maintainers have not reviewed community add-ons for malicious code!
Community add-ons are npm packages published by the community. Look out for add-ons from your favourite libraries and tools. _(soon)_ Many developers are building `sv` add-ons to make their integrations a one-liner. You can find them on [npmx](https://www.npmx.dev/search?q=keyword:sv-add) by searching for the keyword: `sv-add`.
```sh
# Install a community addon-on
npx sv add my-addon
# Also works with org names
npx sv add @supacool/sv
# As a shorthand, packages named `sv` can be omitted
npx sv add @supacool
# Use a local add-on (for development or internal use)
npx sv add file:../path/to/my-addon
# Mix and match official and community add-ons
npx sv add eslint @supacool
# Also works when creating a new project directly
npx sv create --add eslint @supacool
```
> [!NOTE]
> On Windows PowerShell, `@` is a special character that should be escaped with single quotes. For example: `npx sv add '@supacool'`.
Want to create your own? Check the [Add-on Docs](community).
# sv check
`sv check` finds errors and warnings in your project, such as:
- unused CSS
- accessibility hints
- JavaScript/TypeScript compiler errors
Requires Node 16 or later.
## Installation
You will need to have the `svelte-check` package installed in your project:
```sh
npm i -D svelte-check
```
## Usage
```sh
npx sv check
```
## Options
### `--workspace <path>`
Path to your workspace. All subdirectories except `node_modules` and those listed in `--ignore` are checked.
### `--output <format>`
How to display errors and warnings. See [machine-readable output](#Machine-readable-output).
- `human`
- `human-verbose`
- `machine`
- `machine-verbose`
### `--watch`
Keeps the process alive and watches for changes.
### `--preserveWatchOutput`
Prevents the screen from being cleared in watch mode.
### `--tsconfig <path>`
Pass a path to a `tsconfig` or `jsconfig` file. The path can be relative to the workspace path or absolute. Doing this means that only files matched by the `files`/`include`/`exclude` pattern of the config file are diagnosed. It also means that errors from TypeScript and JavaScript files are reported. If not given, will traverse upwards from the project directory looking for the next `jsconfig`/`tsconfig.json` file.
### `--no-tsconfig`
Use this if you only want to check the Svelte files found in the current directory and below and ignore any `.js`/`.ts` files (they will not be type-checked)
### `--ignore <paths>`
Files/folders to ignore, relative to workspace root. Paths should be comma-separated and quoted. Example:
```sh
npx sv check --ignore "dist,build"
```
<!-- TODO what the hell does this mean? is it possible to use --tsconfig AND --no-tsconfig? if so what would THAT mean? -->
Only has an effect when used in conjunction with `--no-tsconfig`. When used in conjunction with `--tsconfig`, this will only have effect on the files watched, not on the files that are diagnosed, which is then determined by the `tsconfig.json`.
### `--fail-on-warnings`
If provided, warnings will cause `sv check` to exit with an error code.
### `--compiler-warnings <warnings>`
A quoted, comma-separated list of `code:behaviour` pairs where `code` is a [compiler warning code](../svelte/compiler-warnings) and `behaviour` is either `ignore` or `error`:
```sh
npx sv check --compiler-warnings "css_unused_selector:ignore,a11y_missing_attribute:error"
```
### `--diagnostic-sources <sources>`
A quoted, comma-separated list of sources that should run diagnostics on your code. By default, all are active:
<!-- TODO would be nice to have a clearer definition of what these are -->
- `js` (includes TypeScript)
- `svelte`
- `css`
Example:
```sh
npx sv check --diagnostic-sources "js,svelte"
```
### `--threshold <level>`
Filters the diagnostics:
- `warning` (default) — both errors and warnings are shown
- `error` — only errors are shown
## Troubleshooting
[See the language-tools documentation](https://github.com/sveltejs/language-tools/blob/master/docs/README.md) for more information on preprocessor setup and other troubleshooting.
## Machine-readable output
Setting the `--output` to `machine` or `machine-verbose` will format output in a way that is easier to read
by machines, e.g. inside CI pipelines, for code quality checks, etc.
Each row corresponds to a new record. Rows are made up of columns that are separated by a
single space character. The first column of every row contains a timestamp in milliseconds
which can be used for monitoring purposes. The second column gives us the "row type", based
on which the number and types of subsequent columns may differ.
The first row is of type `START` and contains the workspace folder (wrapped in quotes). Example:
```
1590680325583 START "/home/user/language-tools/packages/language-server/test/plugins/typescript/testfiles"
```
Any number of `ERROR` or `WARNING` records may follow. Their structure is identical and depends on the output argument.
If the argument is `machine` it will tell us the filename, the starting line and column numbers, and the error message. The filename is relative to the workspace directory. The filename and the message are both wrapped in quotes. Example:
```
1590680326283 ERROR "codeactions.svelte" 1:16 "Cannot find module 'blubb' or its corresponding type declarations."
1590680326778 WARNING "imported-file.svelte" 0:37 "Component has unused export property 'prop'. If it is for external reference only, please consider using `export const prop`"
```
If the argument is `machine-verbose` it will tell us the filename, the starting line and column numbers, the ending line and column numbers, the error message, the code of diagnostic, the human-friendly description of the code and the human-friendly source of the diagnostic (eg. svelte/typescript). The filename is relative to the workspace directory. Each diagnostic is represented as an [ndjson](https://en.wikipedia.org/wiki/JSON_streaming#Newline-Delimited_JSON) line prefixed by the timestamp of the log. Example:
```
1590680326283 {"type":"ERROR","fn":"codeaction.svelte","start":{"line":1,"character":16},"end":{"line":1,"character":23},"message":"Cannot find module 'blubb' or its corresponding type declarations.","code":2307,"source":"js"}
1590680326778 {"type":"WARNING","filename":"imported-file.svelte","start":{"line":0,"character":37},"end":{"line":0,"character":51},"message":"Component has unused export property 'prop'. If it is for external reference only, please consider using `export
const prop`","code":"unused-export-let","source":"svelte"}
```
The output concludes with a `COMPLETED` message that summarizes total numbers of files, errors and warnings that were encountered during the check. Example:
```
1590680326807 COMPLETED 20 FILES 21 ERRORS 1 WARNINGS 3 FILES_WITH_PROBLEMS
```
If the application experiences a runtime error, this error will appear as a `FAILURE` record. Example:
```
1590680328921 FAILURE "Connection closed"
```
## Credits
- Vue's [VTI](https://github.com/vuejs/vetur/tree/master/vti) which laid the foundation for `svelte-check`
## FAQ
### Why is there no option to only check specific files (for example only staged files)?
`svelte-check` needs to 'see' the whole project for checks to be valid. Suppose you renamed a component prop but didn't update any of the places where the prop is used — the usage sites are all errors now, but you would miss them if checks only ran on changed files.
# sv migrate
`sv migrate` migrates Svelte and SvelteKit codebases. Newer migrations use the task-based migration system in `sv`. Legacy migrations are delegated to [`svelte-migrate@1`](https://www.npmjs.com/package/svelte-migrate) and are kept available for older projects, but no longer receive updates.
Before migrating, make sure the project is committed and read the migration's linked changelog or migration guide. Migration code cannot account for every application, so review the resulting diff and run your project's checks after every step.
## Usage
```sh
npx sv migrate
```
When no migration is specified, `sv migrate` prompts you to pick one.
You can also specify a migration directly via the CLI:
```sh
npx sv migrate [migration]
```
For task-based migrations, `sv migrate` shows the migration tasks before applying them. Prerequisite tasks always run, and the remaining tasks can be selected interactively or with `--tasks`.
To make migration changes easier to review, run one selectable task at a time and commit the result before starting the next one. The task system is intended to create focused commits, not independent migration paths. Do not expect a project to work after running only a few tasks. Most projects need all applicable tasks before the migration is complete.
After a successful task-based migration, `sv` formats the changes using the project's `format` or `fmt` script when one exists, otherwise it formats changed files with Prettier when available. It then prompts to install updated dependencies. Some transformations leave `@migration-task` comments where manual work is required; search the project for that exact marker before considering the migration complete.
## Task-based migrations
### `sveltekit-3`
Upgrades a SvelteKit 2 app to SvelteKit 3. Read the [SvelteKit 3 changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md#300) before running it.
The migration is divided into these tasks:
- `package-json` (prerequisite) updates package versions for SvelteKit 3.
- `tsconfig` (prerequisite) extends the generated `$app/tsconfig` instead of `.svelte-kit/tsconfig.json`.
- `svelte-config` moves supported configuration from `svelte.config.*` into `vite.config.*` and updates imports of the old config where possible.
- `environment` replaces legacy environment modules with `$app/env` and creates `src/env.js` or `src/env.ts` declarations when needed.
- `paths` migrates deprecated `$app/paths` APIs and path types.
- `external-redirects` opts external redirects into the new redirect behavior.
- `shallow-routing` replaces shallow-routing APIs with `goto` calls.
- `params` consolidates route parameter matchers into `src/params.js` or `src/params.ts`.
- `app-state` migrates `$app/stores` usage to `$app/state`.
The migration only changes patterns it can identify safely. Review `@migration-task` comments and the SvelteKit 3 changelog for changes that require manual work.
### `app-state`
Migrates `$app/stores` usage to `$app/state` in `.svelte` files. See the [migration guide](/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated) for more details.
## Legacy migrations
The migrations below run through `svelte-migrate@1`. They remain available so older projects can move forward, but they no longer receive fixes or support for newly discovered code patterns. Commit your project first and carefully review their output.
### `svelte-5`
Upgrades a Svelte 4 app to use Svelte 5, and updates individual components to use [runes](../svelte/what-are-runes) and other Svelte 5 syntax ([see migration guide](../svelte/v5-migration-guide)).
### `self-closing-tags`
Replaces all the self-closing non-void elements in your `.svelte` files. See the [pull request](https://github.com/sveltejs/kit/pull/12128) for more details.
### `svelte-4`
Upgrades a Svelte 3 app to use Svelte 4 ([see migration guide](../svelte/v4-migration-guide)).
### `sveltekit-2`
Upgrades a SvelteKit 1 app to SvelteKit 2 ([see migration guide](../kit/migrating-to-sveltekit-2)).
### `package`
Upgrades a library using `@sveltejs/package` version 1 to version 2. See the [pull request](https://github.com/sveltejs/kit/pull/8922) for more details.
### `routes`
Upgrades a pre-release SvelteKit app to use the filesystem routing conventions in SvelteKit 1. See the [pull request](https://github.com/sveltejs/kit/discussions/5774) for more details.
## Options
These options apply to both task-based and legacy migrations.
### `--cwd <path>`
Run the migration in a different working directory. The path defaults to the current directory and must contain a `package.json`.
### `--no-git-check`
By default, `sv migrate` prompts before making changes when the git working tree is dirty. Use `--no-git-check` to skip this check.
### `--confirm`
Skip the final confirmation prompt before applying the migration. This does not skip migration selection or the dirty-working-tree check; provide the migration name and corresponding options for non-interactive use.
## Task-based migration options
These options do not apply to legacy migrations. LegaMeasured from the saved file
Size measures the captured UTF-8 text, not compressed transfer size. Tokens are counted with a named tokenizer; other models can count differently. Neither measure establishes context compatibility or answer quality.
Context architecture
76 H2 sections organize 84 parsed Markdown links. 2 links point to .md or .markdown paths; 38 link occurrences use another hostname. Linked destinations have not been recursively validated.
| H2 section | Links | UTF-8 bytes | Tokens |
|---|---|---|---|
| UsageLine 8 | 3 | 505 | 128 |
| AcknowledgementsLine 18 | 2 | 295 | 75 |
| How do I run the `sv` CLI?Line 24 | 0 | 274 | 89 |
| `npx sv` is not workingLine 34 | 4 | 786 | 181 |
| UsageLine 48 | 0 | 43 | 16 |
| OptionsLine 54 | 3 | 2013 | 501 |
| UsageLine 133 | 1 | 185 | 51 |
| OptionsLine 145 | 0 | 517 | 136 |
| Official add-onsLine 176 | 13 | 356 | 116 |
| Community add-onsLine 192 | 2 | 1253 | 324 |
| InstallationLine 234 | 0 | 111 | 31 |
| UsageLine 242 | 0 | 25 | 11 |
| OptionsLine 248 | 2 | 2549 | 629 |
| TroubleshootingLine 326 | 1 | 182 | 36 |
| Machine-readable outputLine 330 | 1 | 2863 | 662 |
| CreditsLine 375 | 1 | 109 | 31 |
| H2 section | Links | UTF-8 bytes | Tokens |
|---|---|---|---|
| FAQLine 379 | 1 | 914 | 192 |
| UsageLine 391 | 0 | 1154 | 231 |
| Task-based migrationsLine 411 | 2 | 1422 | 369 |
| Legacy migrationsLine 435 | 7 | 1254 | 340 |
| OptionsLine 463 | 0 | 604 | 125 |
| Task-based migration optionsLine 479 | 1 | 1773 | 382 |
| UsageLine 519 | 0 | 32 | 13 |
| What you getLine 525 | 5 | 937 | 223 |
| OptionsLine 536 | 1 | 966 | 275 |
| UsageLine 574 | 0 | 35 | 13 |
| What you getLine 580 | 0 | 173 | 34 |
| OptionsLine 586 | 1 | 509 | 131 |
| UsageLine 607 | 0 | 31 | 12 |
| What you getLine 613 | 0 | 232 | 50 |
| OptionsLine 620 | 3 | 1351 | 339 |
| UsageLine 660 | 0 | 36 | 13 |
| What you getLine 666 | 1 | 225 | 60 |
| UsageLine 676 | 0 | 30 | 12 |
| What you getLine 682 | 1 | 344 | 78 |
| UsageLine 693 | 0 | 36 | 12 |
| What you getLine 699 | 0 | 55 | 11 |
| OptionsLine 703 | 1 | 455 | 116 |
| UsageLine 721 | 0 | 30 | 14 |
| What you getLine 727 | 1 | 309 | 80 |
| UsageLine 735 | 0 | 33 | 13 |
| What you getLine 741 | 0 | 224 | 61 |
| OptionsLine 750 | 1 | 344 | 90 |
| UsageLine 772 | 0 | 34 | 12 |
| What you getLine 778 | 1 | 187 | 51 |
| UsageLine 789 | 0 | 32 | 12 |
| What you getLine 795 | 1 | 227 | 57 |
| UsageLine 805 | 0 | 33 | 13 |
| What you getLine 811 | 4 | 720 | 174 |
| UsageLine 820 | 0 | 41 | 16 |
| What you getLine 826 | 0 | 85 | 19 |
| OptionsLine 830 | 7 | 1120 | 311 |
| UsageLine 859 | 0 | 35 | 14 |
| What you getLine 865 | 1 | 329 | 92 |
| OptionsLine 872 | 3 | 360 | 107 |
| UsageLine 889 | 0 | 30 | 13 |
| What you getLine 895 | 0 | 162 | 35 |
| OptionsLine 901 | 0 | 266 | 71 |
| Quick startLine 918 | 0 | 214 | 57 |
| Project structureLine 928 | 2 | 1599 | 428 |
| DevelopmentLine 977 | 0 | 458 | 105 |
| TestingLine 993 | 0 | 1608 | 414 |
| PublishingLine 1053 | 3 | 2386 | 703 |
| Next stepsLine 1149 | 0 | 308 | 80 |
| Version compatibilityLine 1166 | 0 | 196 | 40 |
| ExamplesLine 1170 | 1 | 218 | 53 |
| `defineAddon`Line 1178 | 2 | 4224 | 1102 |
| `defineAddonOptions`Line 1322 | 0 | 718 | 189 |
| `create`Line 1348 | 0 | 180 | 50 |
| `add`Line 1363 | 0 | 396 | 110 |
| transformsLine 1386 | 0 | 4729 | 1218 |
| Parsers (low-level)Line 1577 | 0 | 589 | 147 |
| Language toolingLine 1594 | 0 | 418 | 122 |
| Svelte configLine 1605 | 0 | 2519 | 640 |
| Package manager helpersLine 1644 | 0 | 752 | 215 |
| Browser usageLine 1667 | 0 | 564 | 145 |
Link counts exclude parsed fenced and inline code and resolve relative destinations against the final endpoint. Section sizes cover the text below each H2 until the next H2.
Embedded material
Embedded example text and links to further documentation are counted separately. A code block does not establish that a sample runs or that an authentication flow succeeds.
Source line 239 · sh
npm i -D svelte-checkSource line 1383 · sh
npm install -D @sveltejs/sv-utilsSource line 596 · sh
# GitHub OAuth onlySource line 599 · sh
# Both Email & Password and GitHub OAuthPublisher prioritization
No H2 section named “Optional” was detected in this file.
The community proposal uses Optional by convention for secondary links that can be skipped for a shorter context. This label does not establish that everything outside it is critical, or that the material inside it is deprecated.
Machine-readable routes
MCP-related text was detected in the captured file. 0 links have MCP-related labels or paths. 0 fenced lines match mcpServers, mcp_servers or an mcp add command.
These are text and link observations. No MCP server connection, authentication or tool call was tested.
Index and bundle
Not found at checked URLs
A verified text response establishes a companion at the checked URL. It does not prove the bundle contains all product documentation, that generation is automated, or that it fits an assistant’s context window.
Change evidence
This capture establishes a baseline. Update frequency cannot be determined from one observation.
5 links have release, changelog, deprecation or migration terms in their labels or paths. These provide places to investigate product changes separately.
File changes can reveal documentation edits or navigation changes. They do not by themselves measure product release velocity, accuracy, agent adoption or AI visibility.
857ad598c4dbec621cd49dabc3049d04c5d4bccc1420a79aba68bdd2239bf924Counts use a deterministic parser, not a spec-compliance grade. Unusual Markdown and indented code can fall outside its recognized patterns. See the llms.txt proposal and tokenizer implementation.