# open

Learn how to open a deep link.

This command is the behind-the-scenes engine for deep links. It allows the CLI to receive and execute commands triggered directly from your browser, such as from the [Croct admin](https://app.croct.com), [documentation](https://docs.croct.com), or [templates](https://croct.com/templates).

While you can run it manually, this command is primarily intended to be called by your operating system when you click a "Run" button online.

## Usage

This command has the following syntax:

```sh
croct open <url>
```

## Example

Open a deep link:

```sh
npx --yes croct@latest open 'croct://use?arg=croct://starter/nextjs'
```

## Arguments

- `url`: `string`

  The deep link URL to open.

## Options

This command only accepts [global options](../global-options).

## URL syntax

Deep link URLs follow this syntax:

```
croct://<command>[/<subcommand>][?<options>&arg=<positional>]
```

The hostname and path segments map to the command and its subcommands. For example, `croct://slot/add` corresponds to the [`croct slot add`](/reference/cli/commands/add-slot) command.

Query parameters map to CLI options, and how they translate depends on whether they have a value:

| Parameter   | Result        | Description                                           |
| ----------- | ------------- | ----------------------------------------------------- |
| `f=`        | `-f`          | Empty value, single-character key becomes short flag. |
| `force=`    | `--force`     | Empty value, multi-character key becomes long flag.   |
| `name=John` | `--name John` | Value present, key becomes option with value.         |

The exception is the special `arg` key, which passes positional arguments appended after all options. You can specify multiple `arg` parameters.

To illustrate, the following URL:

```
croct://use?eslint=&name=my-project&arg=croct://starter/nextjs
```

Translates to this CLI command:

```sh
croct use 'croct://starter/nextjs' --eslint --name my-project
```

Note that the URL must use the `croct://` protocol and cannot contain a username, password, port, or fragment.

## Explore

- [Deep links](/reference/cli/deep-links): Learn how deep links work.
- [Enable deep link](/reference/cli/commands/enable-deep-link): Learn how to enable deep link support.
