Goal
Take the current offline documentation md_mirror/zh/cli as the sole primary source; first locate the scope by the "chapter index", then locate the specific page, avoiding blind searches across the full catalog.
Mandatory workflow (quick reference first, index as fallback)
- First use this file's "CLI Common Usage Quick Reference" to answer high-frequency questions directly, reducing the number of file reads.
- If the question goes beyond the quick reference scope, then read
references/docs_index.mdto confirm the chapter. - Then enter the chapter directory (e.g.
use-cli/、installation-guide/、configure-cli/) to locate the specific page. - When outputting commands, parameters, or options, they must come from the "Quick Reference" or a matched body page; if not found, clearly state "insufficient evidence".
- Do not add resources beyond the requirement, and do not do "convenient enhancements".
Documentation index main chain
references/docs_index.md: unified entry and chapter mapping (start of main chain)references/cli-official-links-index.md: official link index (referenced by link ID)references/links.md: link ID -> official URLmd_mirror/zh/cli/<section>/...: chapter body and subpages
Chapter routing (intent categorization)
- Product definition and capability overview: prioritize
md_mirror/zh/cli/what-is-cli/ - Quick start and supported products: prioritize
md_mirror/zh/cli/quick-start/ - Install, upgrade, uninstall: prioritize
md_mirror/zh/cli/installation-guide/ - Credentials, proxy, autocompletion: prioritize
md_mirror/zh/cli/configure-cli/ - Command structure, parameter format, output filtering, pagination aggregation, polling: prioritize
md_mirror/zh/cli/use-cli/ - Scripting practice, cross-region migration, container running: prioritize
md_mirror/zh/cli/best-practices/ - Editor and terminal tools: prioritize
md_mirror/zh/cli/common-tools/ - Troubleshooting and version changes: prioritize
md_mirror/zh/cli/cli-troubleshooting/andmd_mirror/zh/cli/version-updates/
CLI Common Usage Quick Reference (used by default with priority)
Help and discovery
- View overall CLI help:
aliyun --help - View product help:
aliyun ecs --help - View API help:
aliyun ecs DescribeInstances --help
Configuration and credentials
- Initialize/interactive configuration:
aliyun configure - Specify AK/SK non-interactive configuration:
aliyun configure set --profile <name> --mode AK --access-key-id <ak> --access-key-secret <sk> --region <region-id> - View current configuration list:
aliyun configure list - Switch configuration:
aliyun configure switch --profile <name>
High-frequency queries and calls
- Query ECS instances:
aliyun ecs DescribeInstances --RegionId <region-id> - Pass complex parameters as JSON:
aliyun <product> <api> --SomeJsonParam '[{"key":"value"}]' - Simulate the call only without creating resources:
aliyun <product> <api> --dryrun
Common global options
- Output filtering/tabulation:
--output cols=<...>,rows=<...> - Aggregate paginated results:
--pager - Result polling:
--waiter expr='<jmes>' to='<target>' timeout=<sec> - Force call an unlisted API:
--force --version <date> - Debug logging: set
DEBUG=sdk(use with command execution as needed)
Search suggestions
# 1) 先在统一索引中收敛章节
rg "安装|配置|命令结构|参数格式|输出|分页|轮询|故障排查" references/docs_index.md
# 2) 在目标章节目录下检索关键词
rg "configure|credentials|proxy|auto-completion" md_mirror/zh/cli/configure-cli
rg "--output|--pager|--waiter|--dryrun|--force" md_mirror/zh/cli/use-cli
rg "install|update|uninstall" md_mirror/zh/cli/installation-guide
# 3) 若要回到官方入口,通过链接 ID 映射
rg "CLI_" references/cli-official-links-index.md references/links.md
Output requirements
- When giving CLI command or parameter suggestions, use only the formulations already matched in the local mirror.
- If the user wants a "navigation/learning path", prioritize returning the chapter directory and recommended reading order.
- If the question is too broad, first return "candidate chapters + reasons for selection", then wait for the user to confirm and narrow the scope.
- For details not covered, clearly mark "the current offline mirror does not cover this information".