# Sources

Learn where templates can be loaded from.

The [`use`](/reference/cli/commands/use) command resolves templates from several source types. The source format determines how the CLI locates and fetches the template file.

## Local file

A path to a template on disk, either relative or absolute:

```sh
croct use template.json5
```

This is the simplest option for testing templates during development.

## URL

A publicly accessible URL pointing to the template file:

```sh
croct use https://example.com/template.json5
```

If the URL does not end with a filename, the CLI looks for `template.json` or `template.json5` at that location automatically.

## GitHub

A blob URL pointing to a template in a GitHub repository:

```sh
croct use https://github.com/org/repo/blob/master/template.json5
```

The CLI extracts the repository, branch, and file path from the URL and fetches the template directly from GitHub.

## npm

The `npm://` scheme resolves a template from an npm package's linked repository. The CLI reads the package metadata from the npm registry, finds the associated GitHub repository, and fetches the template from its root directory:

```sh
croct use npm://package-name
```

This is useful for libraries that ship a companion template alongside their package. For details on setting this up, see the [publishing templates tutorial](/immersion/tutorials/template-publishing).

## Registry

Registries map custom URL schemes to template locations. The built-in registry maps schemes like `croct://`, `shadcn-ui://`, `magic-ui://`, and others to their corresponding template repositories:

```sh
croct use croct://starter/nextjs
```

For details on the registry format, built-in schemes, and custom registries, see [Registries](/reference/cli/templates/registries).

You can specify a custom registry using the [`--registry`](/reference/cli/global-options) global option.

## Explore

- [Registries](/reference/cli/templates/registries): See the template registry reference.
- [Use](/reference/cli/commands/use): Learn how to apply a template to your project.
