V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xiaoxuan6
V2EX  ›  程序员

代码解释器 code-explain 解决你对代码疑惑的地方

  •  
  •   xiaoxuan6 ·
    xiaoxuan6 · 36 天前 · 252 次点击
    这是一个创建于 36 天前的主题,其中的信息可能已经有所发展或是发生改变。

    注意需要依赖 php >= 8.1, Go 版本在文章末尾可直接运行二进制文件

    解决平时代码中比较疑惑的地方,支持 windows 、linux 、darwin.

    github:https://github.com/xiaoxuan6/code-explain

    Requirements

    • PHP >= 8.1

    Installation

    Composer

    composer global require james.xue/code-explain
    

    直接下载 code-explain 可执行文件

    curl 'https://mirror.ghproxy.com/https://raw.githubusercontent.com/xiaoxuan6/code-explain/main/builds/code-explain' -o code-explain --progress-bar
    chmod +x code-explain
    

    Help

    $ ./code-explain -h
    Description:
      What does it mean to explain the code.
    
    Usage:
      explain [options] [--] [<code>]
    
    Arguments:
      code                    The code to explain
    
    Options:
      -C, --is-use-clipboard  Use clipboard to get the code to explain
      -h, --help              Display help for the given command. When no command is given display help for the explain command
      -q, --quiet             Do not output any message
      -V, --version           Display this application version
          --ansi|--no-ansi    Force (or disable --no-ansi) ANSI output
      -n, --no-interaction    Do not ask any interactive question
          --env[=ENV]         The environment the command should run under
      -v|vv|vvv, --verbose    Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
    

    Go 版本

    https://github.com/xiaoxuan6/tools

    tools c -h
    NAME:
       tools code - 人工智能来解释您不理解的任何代码的工具
    
    USAGE:
       tools code [command options] [arguments...]
    
    OPTIONS:
       --help, -h  show help
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1496 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 17:29 · PVG 01:29 · LAX 10:29 · JFK 13:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.