# References

These references are generated from the upstream TiDB Cloud CLI docs:

- Tree view: `https://github.com/tidbcloud/tidbcloud-cli/tree/main/docs/generate_doc`
- Raw files: `https://raw.githubusercontent.com/tidbcloud/tidbcloud-cli/main/docs/generate_doc/<doc-name>.md`

Regenerate after upstream changes:

```bash
cd path/to/tidbcloud-cli
python3 scripts/generate_references.py --skill-dir .
```

> will cache the commit sha and only re-download files that have changed since the last generation. This can avoid Github rate limit.

Prefer a local docs checkout when available:

```bash
cd path/to/tidbcloud-cli
python3 scripts/generate_references.py \
  --skill-dir . \
  --docs-dir /path/to/tidbcloud-cli/docs/generate_doc
```

Notes:

- Normal skill execution should read from `references/` instead of fetching upstream docs on every task.
- Remote refreshes cache the upstream listing and downloaded docs under `references/.cache/`.
- Set `GITHUB_TOKEN` for higher GitHub API limits when refreshing from upstream.

Generated outputs:

- `command-index.md`
- `generated/commands/*.md`
- `generated/families/*.md`

Filename mapping rule:

- Start from the CLI command name
- Replace spaces with underscores
- Keep existing hyphens in subcommand names
- Append `.md`

Examples:

- `ticloud auth login` -> `ticloud_auth_login.md`
- `ticloud config create` -> `ticloud_config_create.md`
- `ticloud serverless private-link-connection list` -> `ticloud_serverless_private-link-connection_list.md`
