x-cmd icon indicating copy to clipboard operation
x-cmd copied to clipboard

[BUG] yq命令的使用似乎出现了错误

Open ydrk12 opened this issue 8 months ago • 3 comments

✅ Checklist

💬 Describe the bug

以下错误信息的重复出现,当你试图调用大语言模型的时候。

usage: yq [-h] [--yaml-output] [--yaml-roundtrip] [--yaml-output-grammar-version {1.1,1.2}] [--width WIDTH] [--indentless-lists] [--in-place] [--version] [jq_filter] [files ...] yq: error: argument files: can't open 'e': [Errno 2] No such file or directory: 'e'

📄 System

- name: x-cmd
  info: |-
    ___X_CMD_VERSION:           .94d2c1c0
    ___X_CMD_PKG_VERSION:       v0.1.2
    ___X_CMD_WEBSRC_REGION:     cn
    ___X_CMD_LANG:              en
    x-cmd sum:                  94d2c1c04b5265208749a89217f293e0bdbb63ce8418be594fcee2281e01a270e1540114d0692cd0d52d367d3709731c875d1a15a0454c99090df5cd7cb02a74

    ==== root ls ====
    V:          <<HOME-STRING>>/.x-cmd.root/v
    ROOT:       <<HOME-STRING>>/.x-cmd.root
    CODE:       <<HOME-STRING>>/.x-cmd.root/v/.94d2c1c0
    ADV:        <<HOME-STRING>>/.x-cmd.root/v/.94d2c1c0/adv
    MOD:        <<HOME-STRING>>/.x-cmd.root/v/.94d2c1c0/mod
    METADATA:   <<HOME-STRING>>/.x-cmd.root/v/.94d2c1c0/.x-cmd/metadata
    GDATA:      <<HOME-STRING>>/.x-cmd.root/global/data
    DATA:       <<HOME-STRING>>/.x-cmd.root/local/data
    USR:        <<HOME-STRING>>/.x-cmd.root/local/usr
    ART:        <<HOME-STRING>>/.x-cmd.root/local/art
    GCFG:       <<HOME-STRING>>/.x-cmd.root/global/cfg
    CFG:        <<HOME-STRING>>/.x-cmd.root/local/cfg
    LOG:        <<HOME-STRING>>/.x-cmd.root/local/log
    CACHE:      <<HOME-STRING>>/.x-cmd.root/local/cache
    TMP:        <<HOME-STRING>>/.x-cmd.root/local/tmp
    SHARED:     <<HOME-STRING>>/.x-cmd.root/global/shared

    ==== boot rc ====
- name: shell
  info: bash
- name: awk
  info: mawk 1.3.4 20200120
- name: sed
  info: |-
    /usr/bin/sed (GNU sed) 4.9
    Packaged by Debian
    Copyright (C) 2022 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by Jay Fenlason, Tom Lord, Ken Pizzini,
    Paolo Bonzini, Jim Meyering, and Assaf Gordon.

    This sed program was built with SELinux support.
    SELinux is disabled on this system.

    GNU sed home page: <https://www.gnu.org/software/sed/>.
    General help using GNU software: <https://www.gnu.org/gethelp/>.
    E-mail bug reports to: <[email protected]>.
- name: grep
  info: |-
    grep (GNU grep) 3.8
    Copyright (C) 2022 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by Mike Haertel and others; see
    <https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
- name: find
  info: |-
    find (GNU findutils) 4.9.0
    Copyright (C) 2022 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by Eric B. Decker, James Youngman, and Kevin Dalley.
    Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)
- name: busybox
  info:
- name: curl
  info: |-
    curl 7.88.1 (x86_64-pc-linux-gnu) libcurl/7.88.1 OpenSSL/3.0.16 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.3 libpsl/0.21.2 (+libidn2/2.3.3) libssh2/1.10.0 nghttp2/1.52.0 librtmp/2.3 OpenLDAP/2.5.13
    Release-Date: 2023-02-20, security patched: 7.88.1-10+deb12u12
    Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
    Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
- name: wget
  info: |-
    GNU Wget 1.21.3 built on linux-gnu.

    -cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls
    +ntlm +opie +psl +ssl/gnutls

    Wgetrc:
        /etc/wgetrc (system)
    Locale:
        /usr/share/locale
    Compile:
        gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
        -DLOCALEDIR="/usr/share/locale" -I. -I../../src -I../lib
        -I../../lib -Wdate-time -D_FORTIFY_SOURCE=2
        -I/usr/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG -g -O2
        -ffile-prefix-map=/build/reproducible-path/wget-1.21.3=.
        -fstack-protector-strong -Wformat -Werror=format-security
        -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall
    Link:
        gcc -I/usr/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG -g -O2
        -ffile-prefix-map=/build/reproducible-path/wget-1.21.3=.
        -fstack-protector-strong -Wformat -Werror=format-security
        -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall -Wl,-z,relro -Wl,-z,now
        -lpcre2-8 -luuid -lidn2 -lnettle -lgnutls -lz -lpsl ../lib/libgnu.a

    Copyright (C) 2015 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later
    <http://www.gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Originally written by Hrvoje Niksic <[email protected]>.
    Please send bug reports and questions to <[email protected]>.
- name: release
  info: |-
    linuxmint
    "6"

🔎 To Reproduce

  1. Start up service: ...
  2. Type command: ...

Expected behavior

使用任何命令包括但不限于@ds,x chat来调用大语言模型的时候

🗂️ Additional Context

安装环境是基于wsldl构建的项目LinuxmintWSL2,在首次使用x-cmd尝试唤起ai大模型的时候会提示在下载yq,但是这个时候我忘记调整网络设置了,导致下载非常慢速,因此用^C手动终止了下载过程之后,更换了软件源和代理设置,用apt自己手动装了一个yq,此后设置了api_key,在尝试使用@ds调用ds模型的时候出现了以下的重复的错误信息:

x chat --send --provider deepseek 'How are you?' usage: yq [-h] [--yaml-output] [--yaml-roundtrip] [--yaml-output-grammar-version {1.1,1.2}] [--width WIDTH] [--indentless-lists] [--in-place] [--version] [jq_filter] [files ...] yq: error: argument files: can't open 'e': [Errno 2] No such file or directory: 'e' 已经尝试过的方法包括但不限于重新安装x-cmd,更新到beta,apt purge yq包(会提示找不到yq目录)或者重新安装yq,或者手动移除整个x-cmd然后重新安装。 此外,在使用手册上的命令x uninstall的时候,跳出的界面是指示卸载其他包而非卸载x-cmd本身的界面。 已经发现安装脚本并没有正确地把启动x-cmd的脚本添加进.bashrc文件中,在init之后也没有正常添加@ds命令,而是需要我手动添加。我的这个环境在整个的issue里面应该算是非常小众的了,但是也许解决它有助于你们改进一些系统性的问题。

ydrk12 avatar Jun 10 '25 18:06 ydrk12

存在一种可能, 就是 yq 的新版本出现了不兼容的问题. 明天我看看, 谢谢你的建议 ~ 因为有点晚了, 明天我们再总结一下你提到的几个问题.

另外, 你的 issue 对我们改进很重要. x-cmd 的目标就是将所有这些使用过程中的细节问题( 在不同平台 ) 消除. 所以欢迎给我们更多的反馈. 非常感谢.

如果你是中国用户, 非常欢迎加入到 我们的 微信群 和 订阅B站 x-cmd, 当然, github 永远是更佳的反馈模式.

再次表示感谢.

edwinjhlee avatar Jun 10 '25 18:06 edwinjhlee

  1. 方便的话查看一下 yq 的版本号: x yq --version

  2. 关于 uninstall 的详细功能可以看它的 help 文档: x uninstall --help

  3. 安装脚本并没有正确地把启动x-cmd的脚本添加进.bashrc文件中

    可以手动执行 x boot init 之后反馈一下具体的 log 信息吗

  4. @ds 命令需要提前设置好 deepseek 的 apikey:x deepseek init

qiakai avatar Jun 11 '25 03:06 qiakai

@qiakai 回复,因为是新设置的mint环境,因为出了上面那些错误已经删掉mint环境换wsl-ubuntu了,没有复现原先的问题(除了到了wsl-ubuntu这边我还是得用alias自己设置一个@ds的别名,x deepseek init的命令并没有加上),因此我也没办法找到原先yq的版本以及log了,关于最麻烦的yq命令的问题你可以试着找一下mint6“Faye”库里面的最新版本

ydrk12 avatar Jun 16 '25 16:06 ydrk12