Article count:10400 Read by:146798529

Featured Content
Account Entry

Give a comment in the command line, AI can automatically generate code

Latest update time:2021-09-30
    Reads:
Xingkun from Aofei Temple
Quantum Bit Report | Public Account QbitAI

Can't remember the common Shell commands and parameters? Now there is a tool that can automatically generate commands as long as you write down the description.

Just hit the Enter key to let the AI ​​generate code and execute commands. For example, let it list all running instances:

Does this operation look familiar? Yes, it is a third-party shell tool developed based on the OpenAI Codex model, the Zsh Codex plug-in.

Programming in the command line can also be simplified to just writing a comment or variable name. For programmers who are used to writing code in the terminal, this lazy plugin buff ​​to improve efficiency must not be missed.

How to let AI write code in the command line?

Install the plugin

The first step to get the buff is to install the OpenAI package to get the Codex AI model.

pip3 install openai

Next, download the ZSH plug-in, which needs to be installed through the third-party tool "oh-my-zsh".

git clone https://github.com/tom-doerr/zsh_codex.git ~/.oh-my-zsh/custom/plugins/ 

Then add the following to your .zshrc file.

plugins=(zsh_codex)
bindkey '^X' create_completion

Create openaiapirc file in ~/.config with organization_id and secret_key data .

[openai]
organization_id = ...
secret_key = ...

Finally, run zsh and enter ^X to start writing code with AI.

About Codex AI

GitHub Copilot, which is supported by the Codex AI model, has become a cheat buff widely praised by programmers because of its ability to automatically complete code.

By embedding the Codex AI model into the terminal environment through shell tools, what GitHub Copilot can do can now be done in the terminal.

Based on the pre-training of the GPT language model and fine-tuning of the code data, the Codex AI model can not only automatically generate code, but also build a natural language interface.

Programmers only need to describe commands in natural language, and the model can generate code instructions based on the description, that is, automatically generate code based on the annotation content.

Even in the improved version of Codex AI, voice-controlled word document typesetting function is also implemented.

The biggest obstacle is OpenAI

Based on the recognition of Codex AI, the Zsh Codex plugin has received 333 stars on GitHub.

However, some people have raised concerns about whether the training quality of Zsh Codex is guaranteed? After all, even GitHub Copilot will write a lot of bugs.

In addition, as netizens have complained: humans will encounter ambiguity in understanding natural language, let alone AI. To generate code through natural language, it may be necessary to train several programmers to accurately describe the commands.

Of course, the biggest obstacle to using the plugin may still be obtaining the Codex API from openAI first.

Reference links:
https://github.com/tom-doerr/zsh_codex
https://www.youtube.com/watch?v=SGUCcjHTmGY
https://twitter.com/search?q=tom-doerr&src=typed_query&f=top
https://lobste.rs/s/b9t093

-over-

This article is the original content of [Quantum位], a signed account of NetEase News•NetEase's special content incentive plan. Any unauthorized reproduction is prohibited without the account's authorization.

List collection! 6 major awards for top AI companies

Registration for the "2021 China Artificial Intelligence Annual Selection" is open! This selection will look for outstanding AI companies from three dimensions: company, person, and product. Welcome to scan the QR code to register and participate. The selection will be announced in December. We look forward to witnessing the honor of these outstanding companies with millions of practitioners!



click here


Latest articles about

 
EEWorld WeChat Subscription

 
EEWorld WeChat Service Number

 
AutoDevelopers

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building,Block B, 18 Zhongguancun Street, Haidian District,Beijing, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号