|
| 1 | +# tdc v0.1.0 |
| 2 | + |
| 3 | +This is the first MVP preview of `tdc`, an agent-friendly CLI for TiDB Cloud Starter and tdc fs workflows. It provides a scriptable command surface for configuring local credentials, managing Starter clusters, preparing SQL access roles, operating tdc fs resources, mounting remote filesystems, and using filesystem-backed Git, journal, and vault workflows. |
| 4 | + |
| 5 | +## What You Can Do |
| 6 | + |
| 7 | +Configure a local profile with a canonical region code: |
| 8 | + |
| 9 | +```bash |
| 10 | +tdc configure |
| 11 | +TDC_REGION_CODE=aws-us-east-1 \ |
| 12 | +TDC_PUBLIC_KEY="$TDC_PUBLIC_KEY" \ |
| 13 | +TDC_PRIVATE_KEY="$TDC_PRIVATE_KEY" \ |
| 14 | +tdc configure --non-interactive |
| 15 | +``` |
| 16 | + |
| 17 | +Manage TiDB Cloud Starter resources from the CLI: |
| 18 | + |
| 19 | +```bash |
| 20 | +tdc organization list-projects |
| 21 | +tdc db create-db-cluster --db-cluster-name demo --db-cluster-type starter --project-id <project-id> |
| 22 | +tdc db list-db-clusters |
| 23 | +tdc db describe-db-cluster --db-cluster-id <cluster-id> |
| 24 | +tdc db update-db-cluster --db-cluster-id <cluster-id> --db-cluster-name demo-renamed |
| 25 | +tdc db delete-db-cluster --db-cluster-id <cluster-id> |
| 26 | +``` |
| 27 | + |
| 28 | +Prepare database users for query access and run SQL through the HTTPS SQL API. The default role is read-write, and read-only/admin access must be selected explicitly: |
| 29 | + |
| 30 | +```bash |
| 31 | +tdc db create-db-sql-users --db-cluster-id <cluster-id> |
| 32 | +tdc db execute-sql-statement --db-cluster-id <cluster-id> --sql "select 1" |
| 33 | +tdc db execute-sql-statement --db-cluster-id <cluster-id> --read-only --sql "select 1" |
| 34 | +tdc db format-db-connection-string --db-cluster-id <cluster-id> --format mysql-uri |
| 35 | +tdc db format-db-connection-string --db-cluster-id <cluster-id> --read-only --format env |
| 36 | +``` |
| 37 | + |
| 38 | +Create and operate a tdc fs resource, then use either data-plane commands or a local mount: |
| 39 | + |
| 40 | +```bash |
| 41 | +tdc fs create-file-system --file-system-name workspace |
| 42 | +tdc fs check-file-system |
| 43 | +tdc fs cp --from-local ./notes.md --to-remote /notes.md --overwrite |
| 44 | +tdc fs cat --path /notes.md |
| 45 | +tdc fs ls --path / |
| 46 | +tdc fs mount-file-system --mount-path /tmp/tdc-workspace |
| 47 | +tdc fs unmount-file-system --mount-path /tmp/tdc-workspace |
| 48 | +``` |
| 49 | + |
| 50 | +Use filesystem-adjacent workflows when a tdc fs resource is configured: |
| 51 | + |
| 52 | +```bash |
| 53 | +tdc fs-git add-git-worktree --base-path /workspace --worktree-path /workspace-feature |
| 54 | +tdc fs-journal create-journal |
| 55 | +tdc fs-journal append-journal-entries --journal-id <journal-id> --entry-json '{"event":"demo"}' |
| 56 | +tdc fs-vault create-secret --secret-name app --field password=secret |
| 57 | +``` |
| 58 | + |
| 59 | +Install and update from GitHub Releases: |
| 60 | + |
| 61 | +```bash |
| 62 | +curl -fsSL https://github.com/tidbcloud/tdc/releases/latest/download/install.sh | sh -s -- --yes |
| 63 | +tdc cli check-update |
| 64 | +tdc cli update --yes |
| 65 | +``` |
| 66 | + |
| 67 | +The release also includes structured JSON/text output, JMESPath `--query`, shared `--dry-run` behavior for mutating control-plane commands, CI workflows, and a live e2e suite that verifies real TiDB Cloud and tdc fs flows. |
0 commit comments