Skip to content
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
50 changes: 30 additions & 20 deletions docs/sdk/cli-reference.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
# CLI Reference
# tailor-sdk

The Tailor Platform SDK provides a command-line interface for managing projects and workspaces.
Tailor Platform SDK - The SDK to work with Tailor Platform

## Usage

```bash
tailor-sdk <command> [options]
```

## Global Options

<!-- politty:global-options:start -->

<a id="global-options"></a>
| Option | Alias | Description | Required | Default |
|--------|-------|-------------|----------|---------|
| `--env-file <ENV_FILE>` | `-e` | Path to the environment file (error if not found) | No | - |
| `--env-file-if-exists <ENV_FILE_IF_EXISTS>` | - | Path to the environment file (ignored if not found) | No | - |
| `--verbose` | - | Enable verbose logging | No | `false` |
| `--json` | `-j` | Output as JSON | No | `false` |

<!-- politty:global-options:end -->

## Common Options

The following options are available for most commands:

| Option | Short | Description |
| ---------------------- | ----- | --------------------------------------------------- |
| `--env-file` | `-e` | Path to environment file (error if not found) |
| `--env-file-if-exists` | | Path to environment file (ignored if not found) |
| `--verbose` | | Enable verbose logging (show stack traces on error) |
| `--json` | `-j` | Output as JSON (where applicable) |
| `--workspace-id` | `-w` | Workspace ID (for deployment commands) |
| `--profile` | `-p` | Workspace profile |
| `--config` | `-c` | Path to SDK config file |
| `--yes` | `-y` | Skip confirmation prompts |
| Option | Short | Description |
| ---------------- | ----- | -------------------------------------- |
| `--workspace-id` | `-w` | Workspace ID (for deployment commands) |
| `--profile` | `-p` | Workspace profile |
| `--config` | `-c` | Path to SDK config file |
| `--yes` | `-y` | Skip confirmation prompts |

### Environment File Loading

Expand All @@ -43,14 +53,14 @@ tailor-sdk apply --env-file .env --env-file .env.production

You can use environment variables to configure workspace and authentication:

| Variable | Description |
| --------------------------------- | ------------------------------------------------------------ |
| `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
| `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
| `TAILOR_TOKEN` | **Deprecated.** Use `TAILOR_PLATFORM_TOKEN` instead |
| `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
| `TAILOR_PLATFORM_SDK_CONFIG_PATH` | Path to SDK config file |
| `EDITOR` | Editor to open generated files (e.g., `vim`, `code`, `nano`) |
| Variable | Description |
| --------------------------------- | --------------------------------------------------------------------------- |
| `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
| `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
| `TAILOR_TOKEN` | **Deprecated.** Use `TAILOR_PLATFORM_TOKEN` instead |
| `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
| `TAILOR_PLATFORM_SDK_CONFIG_PATH` | Path to SDK config file |
| `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |

### Authentication Token Priority

Expand Down
106 changes: 73 additions & 33 deletions docs/sdk/cli/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ tailor-sdk init [options] [name]

<!-- politty:command:init:options:end -->

<!-- politty:command:init:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:init:global-options-link:end -->

<!-- politty:command:generate:heading:start -->

## generate
Expand Down Expand Up @@ -77,6 +83,12 @@ tailor-sdk generate [options]

<!-- politty:command:generate:options:end -->

<!-- politty:command:generate:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:generate:global-options-link:end -->

<!-- politty:command:apply:heading:start -->

## apply
Expand All @@ -103,19 +115,25 @@ tailor-sdk apply [options]

**Options**

| Option | Alias | Description | Required | Default |
| ------------------------------- | ----- | -------------------------------------------------- | -------- | -------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` |
| `--yes` | `-y` | Skip confirmation prompts | No | `false` |
| `--dry-run` | `-d` | Run the command without making any changes | No | - |
| `--no-schema-check` | - | Skip schema diff check against migration snapshots | No | - |
| `--no-cache` | - | Disable bundle caching for this run | No | - |
| `--clean-cache` | - | Clean the bundle cache before building | No | - |
| Option | Alias | Description | Required | Default | Env |
| ------------------------------- | ----- | -------------------------------------------------- | -------- | -------------------- | --------------------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` | `TAILOR_PLATFORM_SDK_CONFIG_PATH` |
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
| `--dry-run` | `-d` | Run the command without making any changes | No | - | - |
| `--no-schema-check` | - | Skip schema diff check against migration snapshots | No | - | - |
| `--no-cache` | - | Disable bundle caching for this run | No | - | - |
| `--clean-cache` | - | Clean the bundle cache before building | No | - | - |

<!-- politty:command:apply:options:end -->

<!-- politty:command:apply:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:apply:global-options-link:end -->

**Migration Handling:**

When migrations are configured (`db.tailordb.migration` in config), the `apply` command automatically:
Expand Down Expand Up @@ -164,15 +182,21 @@ tailor-sdk remove [options]

**Options**

| Option | Alias | Description | Required | Default |
| ------------------------------- | ----- | ------------------------- | -------- | -------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` |
| `--yes` | `-y` | Skip confirmation prompts | No | `false` |
| Option | Alias | Description | Required | Default | Env |
| ------------------------------- | ----- | ------------------------- | -------- | -------------------- | --------------------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` | `TAILOR_PLATFORM_SDK_CONFIG_PATH` |
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |

<!-- politty:command:remove:options:end -->

<!-- politty:command:remove:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:remove:global-options-link:end -->

<!-- politty:command:show:heading:start -->

## show
Expand All @@ -199,15 +223,20 @@ tailor-sdk show [options]

**Options**

| Option | Alias | Description | Required | Default |
| ------------------------------- | ----- | ----------------------- | -------- | -------------------- |
| `--json` | `-j` | Output as JSON | No | `false` |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` |
| Option | Alias | Description | Required | Default | Env |
| ------------------------------- | ----- | ----------------------- | -------- | -------------------- | --------------------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` | `TAILOR_PLATFORM_SDK_CONFIG_PATH` |

<!-- politty:command:show:options:end -->

<!-- politty:command:show:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:show:global-options-link:end -->

<!-- politty:command:open:heading:start -->

## open
Expand All @@ -234,14 +263,20 @@ tailor-sdk open [options]

**Options**

| Option | Alias | Description | Required | Default |
| ------------------------------- | ----- | ----------------------- | -------- | -------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` |
| Option | Alias | Description | Required | Default | Env |
| ------------------------------- | ----- | ----------------------- | -------- | -------------------- | --------------------------------- |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` | `TAILOR_PLATFORM_SDK_CONFIG_PATH` |

<!-- politty:command:open:options:end -->

<!-- politty:command:open:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:open:global-options-link:end -->

<!-- politty:command:api:heading:start -->

## api
Expand Down Expand Up @@ -278,11 +313,16 @@ tailor-sdk api [options] <endpoint>

**Options**

| Option | Alias | Description | Required | Default |
| ------------------------------- | ----- | -------------------- | -------- | ------- |
| `--json` | `-j` | Output as JSON | No | `false` |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - |
| `--body <BODY>` | `-b` | Request body as JSON | No | `"{}"` |
| Option | Alias | Description | Required | Default | Env |
| ------------------------------- | ----- | -------------------- | -------- | ------- | ------------------------------ |
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
| `--body <BODY>` | `-b` | Request body as JSON | No | `"{}"` | - |

<!-- politty:command:api:options:end -->

<!-- politty:command:api:global-options-link:start -->

See [Global Options](../cli-reference.md#global-options) for options available to all commands.

<!-- politty:command:api:global-options-link:end -->
Loading