close
|Docs

railway templates

Manage Railway templates from the CLI. The templates command groups subcommands for discovering, creating, publishing, and managing templates. You can also call the command as railway template. Both forms behave identically.

Usage

Subcommands

SubcommandAliasesDescription
searchfindSearch published templates in the marketplace.
listlsList templates owned by a workspace.
creategenerateCreate an unpublished template from a project.
publishupdatePublish or update a template in the marketplace.
unpublishUnpublish a published template from the marketplace.
deleteremove, rmDelete a template.

Search published Railway templates in the marketplace. The command works in two modes:

  • In a terminal (TTY), it opens a command-palette-style picker that updates as you type.
  • Outside a terminal, or when --json is set, it prints results to stdout for use in scripts and agents.

The picker is seeded with the optional QUERY argument. Pressing Enter selects the highlighted template. The command does not require authentication.

Usage

Arguments

ArgumentDescription
QUERYSearch term. Seeds the picker in TTY mode.

Options

FlagDescription
--jsonPrint results as JSON. Disables the interactive picker.
--limit <LIMIT>Number of results to request. Defaults to 20. Maximum 50.
--after <CURSOR>Fetch the next page using pageInfo.endCursor from a previous response.
--category <CATEGORY>Filter by template category.
--verified <BOOL>Filter by verification state. Accepts true or false.

Examples

Open the interactive picker

Search with a seed query

Filter to verified templates

Filter by category

Paginate through results

Use the endCursor value from the previous JSON response as the next --after value.

railway templates list

List templates owned by a workspace. This includes both draft and published templates.

Usage

Options

FlagDescription
-w, --workspace <WORKSPACE>Workspace ID or name. Defaults to listing across every workspace you belong to.
--jsonPrint results as JSON.

Examples

List all templates across your workspaces

List templates in a specific workspace

List templates as JSON

List templates in a workspace as JSON

railway templates create

Create an unpublished template draft from an existing project. This matches the dashboard "Generate Template" action: it clones a project into a template draft that you can edit and publish later.

Usage

Options

FlagDescription
-p, --project <PROJECT>Project ID or name. Defaults to the linked project.
-e, --environment <ENVIRONMENT>Environment ID or name. Defaults to the linked environment when available.
--jsonPrint the created template as JSON.

Examples

Create a template from the linked project

Create a template from a specific project

Create a template from a specific project and environment

Create a template and output as JSON

railway templates publish

Publish or update a template in the marketplace. Use this command to make a template available to other users or to update metadata on an already-published template.

First-time publication requires a template overview via --readme-file or --readme. Use the update alias when replacing metadata on an already-published template.

Usage

Arguments

ArgumentDescription
TEMPLATETemplate ID or code.

Options

FlagDescription
--category <CATEGORY>Marketplace category. See Valid Categories below.
--description <DESCRIPTION>Short marketplace description.
--readme <README>Template overview markdown. Prefer --readme-file for multi-line content.
--readme-file <README_FILE>File containing the template overview markdown. Use - to read from stdin.
--image <IMAGE>Image URL for the marketplace card. Use none or clear to clear it.
--demo-project <DEMO_PROJECT>Public demo project ID. Use none or clear to clear it.
-w, --workspace <WORKSPACE>Workspace ID or name. Defaults to the template workspace.
--jsonPrint the published template as JSON.

Valid Categories

  • AI/ML
  • Analytics
  • Authentication
  • Automation
  • Blogs
  • Bots
  • CMS
  • Observability
  • Other
  • Starters
  • Storage
  • Queues

Examples

Publish a template with metadata

Publish a template with a demo project

Update an already-published template

Publish a template with readme from stdin

Publish and output as JSON

railway templates unpublish

Unpublish a published template from the marketplace. The template draft remains in your workspace and can be published again later.

Usage

Arguments

ArgumentDescription
TEMPLATETemplate ID or code.

Options

FlagDescription
-y, --yesSkip confirmation dialog. Required for non-interactive use.
--2fa-code <TWO_FACTOR_CODE>2FA code for verification when required by the current auth session.
--jsonPrint the unpublished template result as JSON.

Examples

Unpublish a template (interactive)

Unpublish a template (non-interactive)

Unpublish and output as JSON

railway templates delete

Delete a template. This removes the template draft or marketplace template from the workspace.

Usage

Arguments

ArgumentDescription
TEMPLATETemplate ID or code.

Options

FlagDescription
-y, --yesSkip confirmation dialog. Required for non-interactive use.
--2fa-code <TWO_FACTOR_CODE>2FA code for verification when required by the current auth session.
--jsonPrint the deleted template result as JSON.

Examples

Delete a template (interactive)

Delete a template (non-interactive)

Delete and output as JSON