Skip to content
Draft
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
5 changes: 1 addition & 4 deletions TOC-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,9 @@
- [create-layer](/ai/ti/reference/ti-fs-create-layer.md)
- [list-layers](/ai/ti/reference/ti-fs-list-layers.md)
- [fork-layer](/ai/ti/reference/ti-fs-fork-layer.md)
- [list-layer-chain](/ai/ti/reference/ti-fs-list-layer-chain.md)
- [describe-layer](/ai/ti/reference/ti-fs-describe-layer.md)
- [diff-layer](/ai/ti/reference/ti-fs-diff-layer.md)
- [create-layer-checkpoint](/ai/ti/reference/ti-fs-create-layer-checkpoint.md)
- [delete-layer](/ai/ti/reference/ti-fs-delete-layer.md)
- [rollback-layer](/ai/ti/reference/ti-fs-rollback-layer.md)
- [merge-layer](/ai/ti/reference/ti-fs-merge-layer.md)
- [commit-layer](/ai/ti/reference/ti-fs-commit-layer.md)
- [pack-file-system](/ai/ti/reference/ti-fs-pack-file-system.md)
- [unpack-file-system](/ai/ti/reference/ti-fs-unpack-file-system.md)
Expand Down
1 change: 1 addition & 0 deletions ai/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The TiDB Cloud CLI (`ti`) lets users, scripts, CI jobs, and AI agents manage TiD
| Install and configure `ti`, then complete a first workflow | [Get Started with TiDB Cloud CLI](/ai/ti/ti-quick-start.md) |
| Automate TiDB Cloud Starter instance, branch, and SQL operations | [Manage TiDB Cloud Starter Instances](/ai/ti/guides/manage-starter-instances.md) |
| Persist and share files across machines, CI jobs, and sandboxes | [Use TiDB Cloud Filesystem with TiDB Cloud CLI](/ai/ti/guides/manage-filesystems-via-cli.md) |
| Try isolated file changes and merge a selected layer | [File system layer commands](/ai/ti/reference/ti-filesystem.md#layer-and-portability-commands) |
| Use mounted workspaces, Git workspaces, journals, or delegated secrets | [Mount a file system](/tidb-cloud-filesystem/filesystem-mount.md), [Manage Git Workspaces](/tidb-cloud-filesystem/manage-git-workspaces.md), [Use Journals in a File System](/tidb-cloud-filesystem/use-filesystem-journals.md), and [Manage Vault Secrets for a File System](/tidb-cloud-filesystem/manage-filesystem-vault-secrets.md) |
| Follow an end-to-end automation or agent example | [Run a Daily TiDB Cloud CLI Workflow](/ai/ti/guides/ti-daily-workflow-example.md) or [Use TiDB Cloud Filesystem in an Agent Sandbox](/ai/ti/guides/ti-agent-sandbox-example.md) |
| Look up commands, global options, output behavior, and errors | [TiDB Cloud CLI Command Reference](/ai/ti/reference/ti-cli-reference.md) |
Expand Down
15 changes: 7 additions & 8 deletions ai/ti/reference/ti-filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ These commands configure optional providers for extracting content from media fi

## Layer and portability commands

The layer commands below apply to `ti` v0.2.12 and the LayerFS v36 runtime.

| Command | Description |
| --- | --- |
| [`create-layer`](/ai/ti/reference/ti-fs-create-layer.md) | Creates an isolated writable layer. |
| [`list-layers`](/ai/ti/reference/ti-fs-list-layers.md) | Lists layers in a file system. |
| [`fork-layer`](/ai/ti/reference/ti-fs-fork-layer.md) | Forks a child layer from a parent tip or checkpoint. |
| [`list-layer-chain`](/ai/ti/reference/ti-fs-list-layer-chain.md) | Lists the pinned ancestry of a layer. |
| [`describe-layer`](/ai/ti/reference/ti-fs-describe-layer.md) | Describes a layer by ID. |
| [`diff-layer`](/ai/ti/reference/ti-fs-diff-layer.md) | Lists changes recorded in a layer. |
| [`create-layer-checkpoint`](/ai/ti/reference/ti-fs-create-layer-checkpoint.md) | Creates a durable checkpoint in a layer. |
| [`delete-layer`](/ai/ti/reference/ti-fs-delete-layer.md) | Logically abandons a layer. |
| [`rollback-layer`](/ai/ti/reference/ti-fs-rollback-layer.md) | Rolls a layer back without committing its changes. |
| [`commit-layer`](/ai/ti/reference/ti-fs-commit-layer.md) | Applies a layer's changes to the base file system. |
| [`fork-layer`](/ai/ti/reference/ti-fs-fork-layer.md) | Forks a child layer from a current state of a parent layer. |
| [`describe-layer`](/ai/ti/reference/ti-fs-describe-layer.md) | Describes a layer by ID, unique name, or tag. |
| [`delete-layer`](/ai/ti/reference/ti-fs-delete-layer.md) | Deletes a layer. |
| [`merge-layer`](/ai/ti/reference/ti-fs-merge-layer.md) | Applies a layer's changes to the base file system. |
| [`pack-file-system`](/ai/ti/reference/ti-fs-pack-file-system.md) | Archives selected local overlay state to the file system. |
| [`unpack-file-system`](/ai/ti/reference/ti-fs-unpack-file-system.md) | Restores local overlay state from an archive. |

Expand Down Expand Up @@ -104,6 +102,7 @@ The following `ti fs` commands have Unix-style aliases. For example, `ti fs cp`

| Alias | Canonical command |
| --- | --- |
| `commit-layer` | `merge-layer` |
| `cp` | `copy-file` |
| `cat` | `read-file` |
| `ls` | `list-files` |
Expand Down
38 changes: 1 addition & 37 deletions ai/ti/reference/ti-fs-commit-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,8 @@ summary: Commit a file system layer.

# ti fs commit-layer

Applies one layer to its base file system.
This command is an alias for [`ti fs merge-layer`](/ai/ti/reference/ti-fs-merge-layer.md). Both names accept the same options and return the same result.

> **Note:**
>
> TiDB Cloud CLI (`ti`) is currently in public preview. Its features and command-line interface are subject to change without notice.

## Syntax

```text
ti fs commit-layer
--layer-id <string>
[--dry-run]
[--file-system-id <string>]
[--fs-token <string>]
[--help]
[--version]
```

## Options

- `--layer-id <string>`: Layer ID. \[required]
- `--dry-run`: Validate the request without applying changes.
- `--file-system-id <string>`: Select the file system. You can also set `TI_FS_FILE_SYSTEM_ID`.
- `--fs-token <string>`: Set the file system token. If omitted, the command uses the `TI_FS_TOKEN` environment variable. If neither is provided, the command uses the local token stored for the selected file system.
- `--help`: Display help information.
- `--version`: Display version information.

For options shared by all commands, see [Global options](/ai/ti/reference/ti-cli-reference.md#global-options).

## Examples

- Commit a layer:

```bash
# Apply the selected layer's changes to its base file system view.
ti fs commit-layer --file-system-id <file-system-id> --layer-id "<layer-id>"
```

## Related documentation

- [TiDB Cloud Filesystem CLI Command Reference](/ai/ti/reference/ti-filesystem.md)
4 changes: 2 additions & 2 deletions ai/ti/reference/ti-fs-copy-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ ti fs copy-file
- `--from-stdin`: Read from stdin and write to `--to-remote`.
- `--fs-token <string>`: Set the file system token. If omitted, the command uses the `TI_FS_TOKEN` environment variable. If neither is provided, the command uses the local token stored for the selected file system.
- `--help`: Display help information.
- `--layer-id <string>`: Write one copied file into a file system layer instead of the base file system. Cannot be combined with `--recursive`.
- `--layer-id <string>`: Write the copied files into the selected layer. Combine with `--recursive` to copy a directory tree.
- `--overwrite`: Replace an existing destination file.
- `--recursive`: Copy directory structure recursively. Cannot be combined with `--layer-id`; seed a layer directory through a writable FUSE mount instead.
- `--recursive`: Copy directory structure recursively.
- `--resume`: Resume an active copy operation.
- `--tag <string>`: Create tags `key=value` for `--to-remote` operation; repeatable.
- `--to-local <string>`: The local destination path.
Expand Down
59 changes: 0 additions & 59 deletions ai/ti/reference/ti-fs-create-layer-checkpoint.md

This file was deleted.

14 changes: 6 additions & 8 deletions ai/ti/reference/ti-fs-create-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Create a layer in a file system.

# ti fs create-layer

Creates a layer for recording isolated changes over a file system base path. If `--layer-id` is omitted, the service generates one.
Creates a layer for recording isolated changes over a file system base path. The service returns a generated layer ID.

> **Note:**
>
Expand All @@ -18,13 +18,12 @@ ti fs create-layer
--base-root-path <string>
[--actor-id <string>]
[--dry-run]
[--durability-mode <string>]
[--file-system-id <string>]
[--fs-token <string>]
[--help]
[--layer-id <string>]
[--layer-name <string>]
[--tag <string>]
[--ttl <string>]
[--version]
```

Expand All @@ -33,13 +32,12 @@ ti fs create-layer
- `--base-root-path <string>`: Base root path in the file system. \[required]
- `--actor-id <string>`: Actor ID identifying the layer owner (for example, the agent name).
- `--dry-run`: Validate the request without applying changes.
- `--durability-mode <string>`: Set the layer durability mode. The only explicitly supported value is `restore-safe`, which preserves changes in the remote layer so the layer can be restored after the local environment ends. If omitted, the service uses `restore-safe`.
- `--file-system-id <string>`: Select the file system. You can also set `TI_FS_FILE_SYSTEM_ID`.
- `--fs-token <string>`: Set the file system token. If omitted, the command uses the `TI_FS_TOKEN` environment variable. If neither is provided, the command uses the local token stored for the selected file system.
- `--help`: Display help information.
- `--layer-id <string>`: The layer ID. Normally it is generated by the service automatically.
- `--layer-name <string>`: The name of the layer.
- `--tag <string>`: Tags for the layer, `key=value`; repeatable.
- `--ttl <string>`: Layer lifetime in whole seconds or a duration such as `5m`.
- `--version`: Display version information.

For options shared by all commands, see [Global options](/ai/ti/reference/ti-cli-reference.md#global-options).
Expand All @@ -53,11 +51,11 @@ For options shared by all commands, see [Global options](/ai/ti/reference/ti-cli
ti fs create-layer --file-system-id <file-system-id> --base-root-path /workspace --layer-name agent-task
```

- Create a restore-safe tagged layer:
- Create a tagged layer with a one-hour lifetime:

```bash
# Request durable layer behavior and attach task metadata.
ti fs create-layer --file-system-id <file-system-id> --base-root-path /workspace --durability-mode restore-safe --tag task=review
# Set the lifetime and attach task metadata.
ti fs create-layer --file-system-id <file-system-id> --base-root-path /workspace --ttl 1h --tag task=review
```

## Related documentation
Expand Down
19 changes: 5 additions & 14 deletions ai/ti/reference/ti-fs-delete-layer.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: ti fs delete-layer
summary: Abandon a file system layer.
summary: Delete a file system layer.
---

# ti fs delete-layer

Abandons a layer without erasing its history. If the layer has live descendants, the command fails unless you specify `--cascade`, which abandons the descendants first.
Deletes the selected layer. An exclusive mount prevents deletion unless you specify `--force`.

> **Note:**
>
Expand All @@ -16,7 +16,7 @@ Abandons a layer without erasing its history. If the layer has live descendants,
```text
ti fs delete-layer
--layer-ref <string>
[--cascade]
[--force]
[--dry-run]
[--file-system-id <string>]
[--fs-token <string>]
Expand All @@ -27,7 +27,7 @@ ti fs delete-layer
## Options

- `--layer-ref <string>`: Layer ID, unique name, or [tag reference](/ai/ti/reference/ti-filesystem.md#layer-references). \[required]
- `--cascade`: Abandon live descendants before abandoning the selected layer.
- `--force`: Delete the selected layer even if it is exclusively mounted.
- `--dry-run`: Validate the request without applying changes.
- `--file-system-id <string>`: Select the file system. You can also set `TI_FS_FILE_SYSTEM_ID`.
- `--fs-token <string>`: Set the file system token. If omitted, the command uses the `TI_FS_TOKEN` environment variable. If neither is provided, the command uses the local token stored for the selected file system.
Expand All @@ -38,21 +38,12 @@ For options shared by all commands, see [Global options](/ai/ti/reference/ti-cli

## Examples

- Abandon a rejected leaf timeline:
- Delete a layer:

```bash
# Deletion fails when the selected layer still has live descendants.
ti fs delete-layer --file-system-id <file-system-id> --layer-ref experiment-a
```

- Abandon a test-owned subtree:

```bash
# Cascade is explicit and abandons descendants before the selected layer.
ti fs delete-layer --file-system-id <file-system-id> --layer-ref experiment-root --cascade
```

## Related documentation

- [TiDB Cloud Filesystem CLI Command Reference](/ai/ti/reference/ti-filesystem.md)
- [`ti fs list-layer-chain`](/ai/ti/reference/ti-fs-list-layer-chain.md)
7 changes: 4 additions & 3 deletions ai/ti/reference/ti-fs-describe-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Describes one file system layer.

```text
ti fs describe-layer
--layer-id <string>
(--layer-id <string> | --layer-ref <string>)
[--file-system-id <string>]
[--fs-token <string>]
[--help]
Expand All @@ -24,7 +24,8 @@ ti fs describe-layer

## Options

- `--layer-id <string>`: The ID of the specified file system layer. \[required]
- `--layer-id <string>`: Layer ID.
- `--layer-ref <string>`: Layer ID, unique name, or tag reference. Specify exactly one of `--layer-id` and `--layer-ref`.
- `--file-system-id <string>`: Select the file system. You can also set `TI_FS_FILE_SYSTEM_ID`.
- `--fs-token <string>`: Set the file system token. If omitted, the command uses the `TI_FS_TOKEN` environment variable. If neither is provided, the command uses the local token stored for the selected file system.
- `--help`: Display help information.
Expand All @@ -37,7 +38,7 @@ For options shared by all commands, see [Global options](/ai/ti/reference/ti-cli
- Describe a layer:

```bash
# Inspect one layer's base root, state, durability, and metadata.
# Inspect one layer's base root and metadata.
ti fs describe-layer --file-system-id <file-system-id> --layer-id "<layer-id>"
```

Expand Down
55 changes: 0 additions & 55 deletions ai/ti/reference/ti-fs-diff-layer.md

This file was deleted.

2 changes: 0 additions & 2 deletions ai/ti/reference/ti-fs-find-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ti fs find-files
[--file-system-id <string>]
[--fs-token <string>]
[--help]
[--layer-id <string>]
[--limit <int32>]
[--max-size-bytes <int64>]
[--min-size-bytes <int64>]
Expand All @@ -37,7 +36,6 @@ ti fs find-files
- `--file-system-id <string>`: Select the file system. You can also set `TI_FS_FILE_SYSTEM_ID`.
- `--fs-token <string>`: Set the file system token. If omitted, the command uses the `TI_FS_TOKEN` environment variable. If neither is provided, the command uses the local token stored for the selected file system.
- `--help`: Display help information.
- `--layer-id <string>`: Search files and directories within a specific file system layer.
- `--limit <int32>`: Maximum number of results; 0 uses the service default.
- `--max-size-bytes <int64>`: Maximum file size in bytes.
- `--min-size-bytes <int64>`: Minimum file size in bytes.
Expand Down
Loading