Codex-CLI  by microsoft

CLI tool for natural language to shell commands (Bash/Zsh/PowerShell)

created 3 years ago
2,222 stars

Top 20.8% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a CLI tool that leverages OpenAI's Codex (GPT-3) to translate natural language commands into shell commands for Bash, Zsh, and PowerShell. It aims to make CLIs more accessible by allowing users to interact with their terminal using natural language, reducing the need to memorize specific syntax.

How It Works

The tool utilizes prompt engineering to guide the Codex model. It sends natural language commands, prefixed with a comment character, to the Codex API. The prompt includes examples of natural language-to-command translations specific to the target shell, helping Codex generate idiomatic and accurate shell commands. It supports both single-turn and multi-turn interactions, with the latter maintaining conversation history for context-aware command generation.

Quick Start & Requirements

  • Installation: Follow shell-specific instructions provided in the repository.
  • Prerequisites: Python 3.7.1+, OpenAI account, OpenAI API Key, OpenAI Organization ID, and an OpenAI Engine ID (e.g., code-davinci-002).
  • Usage: Type a natural language command as a comment (e.g., # what's my IP address) and press Ctrl + G.
  • Documentation: Installation instructions

Highlighted Details

  • Cross-shell compatibility (Bash, Zsh, PowerShell).
  • Supports multi-turn conversations for contextual command generation.
  • Customizable via prompt engineering and context files for specific tasks (e.g., Kubernetes).
  • Offers commands for managing conversation context (start multi-turn, stop multi-turn, load context, etc.).

Maintenance & Community

This project is presented as a demonstration for Microsoft Build 2022 and is not intended as a released product. Feature requests and OpenAI API discussions are outside its scope.

Licensing & Compatibility

The repository does not explicitly state a license. Compatibility with commercial or closed-source projects is not specified.

Limitations & Caveats

The tool relies on an external API (OpenAI) and may produce incorrect commands. Users are advised to understand commands before execution. The project is not a released product, implying potential for breaking changes or lack of ongoing support.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
76 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
2 more.

prompt-engine by microsoft

0.0%
3k
NPM library for LLM prompt engineering
created 3 years ago
updated 2 years ago
Feedback? Help us improve.