### Install Project Dependencies Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Installs all project dependencies using npm. ```sh npm i ``` -------------------------------- ### Install Prettier Globally Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Installs the Prettier code formatter globally. ```sh npm install -g prettier ``` -------------------------------- ### Install Node.js Version Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Installs the Node.js version specified in the .nvmrc file using nvm. ```sh nvm i ``` -------------------------------- ### Install AI Shell Source: https://github.com/builderio/ai-shell/blob/main/README.md Installs the AI Shell CLI globally using npm. Requires Node.js version 14 or higher. ```sh npm install -g @builder.io/ai-shell ``` -------------------------------- ### Build the Project Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Builds the project using the 'build' script. The package is bundled using pkgroll. ```sh npm build ``` -------------------------------- ### Install AI Shell Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Installs the AI Shell CLI globally using npm. Requires Node.js version 14 or higher. ```sh npm install -g @builder.io/ai-shell ``` -------------------------------- ### Run Executable in UNIX-like Environments Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Executes the built distribution file directly. ```sh ./dist/cli.mjs ``` -------------------------------- ### Check Version Source: https://github.com/builderio/ai-shell/blob/main/README.md Displays the currently installed version of AI Shell. ```bash ai --version ``` -------------------------------- ### Format Single File with Prettier Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Formats a single JavaScript file using Prettier. ```sh prettier --write path/to/your/file.js ``` -------------------------------- ### Format Multiple Files with Prettier Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Formats multiple JavaScript files matching a pattern using Prettier. ```sh prettier --write "src/**/*.js" ``` -------------------------------- ### Check Version Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Displays the currently installed version of AI Shell. ```bash ai --version ``` -------------------------------- ### Run Executable in Non-UNIX Environments Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Executes the built distribution file using Node.js. ```sh node ./dist/cli.mjs ``` -------------------------------- ### Development Build (Watch Mode) Source: https://github.com/builderio/ai-shell/blob/main/CONTRIBUTING.md Builds the project in watch mode, automatically rebuilding on file changes. ```sh npm build -w ``` -------------------------------- ### Silent Mode Usage Source: https://github.com/builderio/ai-shell/blob/main/README.md Runs AI Shell without explanations, using the -s or --silent flag. This is useful for quickly getting command suggestions. ```bash ai -s list all log files ``` -------------------------------- ### Set Language Preference Source: https://github.com/builderio/ai-shell/blob/main/README.md Sets the preferred language for AI Shell's output and interactions. The example shows how to set it to Simplified Chinese. ```sh ai config set LANGUAGE=zh-Hans ``` -------------------------------- ### Chat Mode Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Enables a conversational mode where users can interact with the AI directly in the CLI to get responses in a natural, dialogue-like manner. ```bash ai chat ``` -------------------------------- ### Open Configuration UI Source: https://github.com/builderio/ai-shell/blob/main/README.md Launches an interactive, visual interface for viewing and modifying AI Shell's configuration options. ```bash ai config ``` -------------------------------- ### Configuration Options Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Illustrates the interactive UI for setting configuration options, including OpenAI Key, API Endpoint, Silent Mode, Model, and Language. ```bash ◆ Set config: │ ○ OpenAI Key │ ○ OpenAI API Endpoint │ ○ Silent Mode │ ● Model (gpt-4o-mini) │ ○ Language │ ○ Cancel └ ``` -------------------------------- ### Basic Usage Source: https://github.com/builderio/ai-shell/blob/main/README.md Executes AI Shell by providing a natural language prompt. The tool will suggest a shell command, provide an explanation, and ask for confirmation. ```bash ai list all log files ``` -------------------------------- ### View and Set Configuration Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Opens an interactive UI for viewing and modifying AI Shell's configuration options. ```bash ai config ``` -------------------------------- ### Basic Usage Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Executes a natural language prompt to generate a shell command. The tool provides the suggested command, an explanation, and options to run, modify, or cancel. ```bash ai 查找所有.log文件 ``` -------------------------------- ### Configure OpenAI API Key Source: https://github.com/builderio/ai-shell/blob/main/README.md Sets the OpenAI API key for AI Shell to use. This command creates or updates a .ai-shell file in the home directory. ```sh ai config set OPENAI_KEY= ``` -------------------------------- ### Configure OpenAI API Key Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Sets the OpenAI API key for AI Shell to use. This key is stored in a .ai-shell file in the user's home directory. ```sh ai config set OPENAI_KEY= ``` -------------------------------- ### Update AI Shell Source: https://github.com/builderio/ai-shell/blob/main/README.md Updates AI Shell to the latest version available on npm. ```bash npm update -g @builder.io/ai-shell ``` ```bash ai update ``` -------------------------------- ### Custom API Endpoint Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Allows users to configure a custom OpenAI API endpoint, useful for using proxy endpoints. ```sh ai config set OPENAI_API_ENDPOINT= ``` -------------------------------- ### Chat Mode Source: https://github.com/builderio/ai-shell/blob/main/README.md Enables conversational mode for AI Shell, allowing users to interact with the AI through a series of prompts and responses. ```bash ai chat ``` -------------------------------- ### Prompt with Special Characters Source: https://github.com/builderio/ai-shell/blob/main/README.md Wraps prompts containing special shell characters (like ?, *) in single quotes to ensure they are interpreted correctly by the shell. ```bash ai 'what is my ip address' ``` -------------------------------- ### Configure Custom API Endpoint Source: https://github.com/builderio/ai-shell/blob/main/README.md Sets a custom API endpoint for OpenAI, useful for using proxy services or alternative OpenAI-compatible APIs. ```sh ai config set OPENAI_API_ENDPOINT= ``` -------------------------------- ### Update AI Shell Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Updates AI Shell to the latest version from npm or via the AI shell command itself. ```bash npm update -g @builder.io/ai-shell ``` ```bash ai update ``` -------------------------------- ### Set Language Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Customizes the UI language for AI Shell. Supports multiple languages with specific key values. ```sh ai config set LANGUAGE=zh-Hans ``` -------------------------------- ### Configure Silent Mode Preference Source: https://github.com/builderio/ai-shell/blob/main/README.md Sets the SILENT_MODE configuration option to true, making silent mode the default behavior for AI Shell. ```sh ai config set SILENT_MODE=true ``` -------------------------------- ### Handling Special Characters Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md When prompts contain special shell characters (e.g., ?, *), enclose the prompt in single quotes to prevent unexpected behavior. ```bash ai '我的 IP 地址是什么?' ``` -------------------------------- ### Silent Mode Source: https://github.com/builderio/ai-shell/blob/main/README-zh-Hans.md Disables the explanation section for generated commands. This can be set temporarily via the command line or permanently via configuration. ```bash ai -s 列出所有日志文件 ``` ```bash ai config set SILENT_MODE=true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.