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, documentation, or 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:

croct open <url>

Example

Open a deep link:

npx 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.

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 command.

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

ParameterResultDescription
f=-fEmpty value, single-character key becomes short flag.
force=--forceEmpty value, multi-character key becomes long flag.
name=John--name JohnValue 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:

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.