Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Document available templates and boilerplates #17422

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/.gitbook/assets/ai-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/detail-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/form-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/grid-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/list-detail-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/list-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/menu-bar-template.webp
Binary file not shown.
Binary file added docs/.gitbook/assets/run-script-template.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Debug an Extension](basics/debug-an-extension.md)
- [Install an Extension](basics/install-an-extension.md)
- [Review an Extension in a Pull Request](basics/review-pullrequest.md)
- [Templates and Boilerplates](basics/templates-and-boilerplates.md)

## AI

Expand Down
2 changes: 2 additions & 0 deletions docs/basics/create-your-first-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Open the Create Extension command, name your extension "Hello World" and select

{% hint style="info" %}
To create a private extension, select your organization in the first dropdown. You need to be logged in and part of an organization to see the dropdown. Learn more about Raycast for Teams [here](../teams/getting-started.md).

To assist developers, Raycast provides various templates and boilerplates for commands, tools, and extensions. Learn more [here](./templates-and-boilerplates.md).
{% endhint %}

Next, you'll need to follow the on-screen instructions to build the extension.
Expand Down
139 changes: 139 additions & 0 deletions docs/basics/templates-and-boilerplates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
description: Learn about the templates provided by Raycast to help kickstart your extension.
---

# Templates and Boilerplates

Raycast provides developers with a variety of templates to assist in kick-starting your extension development journey.

Raycast provides 3 types of templates:

- **Commands:** These are templates for different views for commands within your extension.
- **Tools:** Tools are a type of entry point for an extension different from a command. Learn more about Tools [here](../api-reference/tool.md).
- **Extension Boilerplates:** These are fully built extension templates designed for use by organizations.

## Commands

### Show Detail

<details>
<summary>Renders a simple Hello World from a markdown string. </summary>

![Detail Template Render](../.gitbook/assets/detail-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/user-interface/detail.md) for more information about customization.
{% endhint %}

</details>

### Submit Form

<details>
<summary>Renders a form that showcases all available form elements.</summary>

![Submit Form Template Render](../.gitbook/assets/form-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/user-interface/form.md) for more information about customization.
{% endhint %}

</details>

### Show Grid

<details>

<summary>Renders a grid of Icons available from Raycast.</summary>
Defaults to a large grid, but provides a selection menu to change the size.

![Grid Template Render](../.gitbook/assets/grid-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/user-interface/grid.md) for more information about customization.

See here for information about [Icons](../api-reference/user-interface/icons-and-images.md).
{% endhint %}

</details>

### Show List and Detail

<details>
<summary>Renders a list of options. When an option is selected, a Detail view is displayed.</summary>

![List and Detail Template Render](../.gitbook/assets/list-detail-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/user-interface/list.md) for more information about customization.
{% endhint %}

</details>

### Menu Bar Extra

<details>
<summary>Adds a simple Menu Bar Extra with a menu.</summary>

![Menu Bar Extra Template Render](../.gitbook/assets/menu-bar-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/menu-bar-commands.md) for more information about customization.
{% endhint %}

</details>

### Run Script

<details>
<summary>Renders a simple HUD indicating the completion of the script.</summary>

![Run Script Template Render](../.gitbook/assets/run-script-template.webp)

</details>

### Show List

<details>
<summary>Renders a simple list with each entry containing an icon, title, subtitle, and accessory.</summary>

![List Template Render](../.gitbook/assets/list-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/user-interface/list.md) for more information about customization.
{% endhint %}

</details>

### Show Typeahead Results

<details>
<summary>Renders a searchable list of NPM packages. Returned packages updates as search.</summary>

![Typeahead Results Template Render](../.gitbook/assets/typeahead-results-template.webp)

</details>

### AI

<details>
<summary>Renders output from an AI command in a Detail view.</summary>

![AI Template Render](../.gitbook/assets/ai-template.webp)

</details>

## Tools

<details>

<summary>Renders a barebones Quick AI chat with your extension.</summary>

![Tool with Confirmation Template Render](../.gitbook/assets/tool-with-confirmation-template.webp)
{% hint style="info" %}
See the [API Reference](../api-reference/tool.md) for more information about customization.
{% endhint %}

</details>

## Extension Boilerplates

The Raycast Team has created high-quality templates to reinforce team experiences with the Raycast API.

Run `npm init raycast-extension -t <template-name>` to get started with these extensions. All templates can be found on the [templates page](https://www.raycast.com/templates).

Specific instructions about customizing the template can be found on the relevant [template page](https://www.raycast.com/templates). Simply customize the template as you see fit, then run `npm run publish` in the extension directory to allow your team to install the extension.