You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用GitHub CLI执行含空格的搜索查询?

GitHub CLI搜索带空格标签的正确用法

要在gh issue list的--search参数中处理带空格的标签,确保shell正确传递搜索表达式即可,以下是两种可靠写法:

  • 用单引号包裹整个搜索语句,内部标签名保留双引号:

    gh issue list --search 'label:"Pod 1"'
    
  • 用双引号包裹整个搜索语句,内部的双引号添加反斜杠转义:

    gh issue list --search "label:\"Pod 1\""
    

如果需要实现或条件同时匹配多个带空格的标签,直接用OR连接不同标签的搜索规则即可,示例:

gh issue list --search 'label:"Pod 1" OR label:"Pod 2"'

这种写法能让gh命令正确识别带空格的标签名,和网页端的label:"Pod 1"搜索逻辑完全一致,同时支持--search参数的所有高级搜索特性。

内容的提问来源于stack exchange,提问作者Steven Kopp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 14:36:15