Gemini
Install and configure the Gemini CLI (command-line tool) on your computer using environment variables
If you run into any issues, you can take a screenshot of this entire page and your problem, and send it to Doubao or deepseek or another AI, then follow its instructions to run the corresponding commands.
If the AI is also unable to resolve the issue, you can contact our engineers for technical support and assistance.
Windows
1. Install Node.js
Go to the Node.js official website to download and install the LTS version. (If it is already installed, you can skip this step.)
Verify installation:
If you see the following message, it means that Node has been installed successfully.

Note that the Nodejs version must be 18 or higher.
If your version is lower than this, you can ask the AI how to upgrade your Nodejs version. First, have the AI give you commands to collect your system information, and then it will provide the fastest and most accurate guidance.
2. Install Gemini CLI
Open PowerShell (it is recommended to run as administrator) and execute:

If you encounter a message that running scripts is disabled on this system, you need to run PowerShell with administrator privileges, and then execute Set-ExecutionPolicy Unrestricted command
3. Create a configuration file
Open PowerShell (it is recommended to run it as administrator) and execute:
Don’t forget to replace the API KEY
Verify whether the configuration was successful:

4. Verify the configuration
In the terminal, type gemini to start it, then in the dialog box, enter: Hello!
Say hello to him. If he replies normally and you can see the invocation record in the platform, it means the configuration was successful.


MacOS
1. Install Node.js
First, make sure you have Homebrew installed on your computer. If not, click the link and you’ll see a command that you can copy and run to install it in one step.
When installing Homebrew, some resources are hosted overseas, so you need to configure a TUN proxy.

After the installation is complete, use Homebrew to install Node.js (you can skip this step if it is already installed).

Use the following command to verify the installation. If you see the message shown below, it means Node has been installed successfully.

Note that the Nodejs version must be 18 or higher.
If your version is lower than this, you can ask the AI how to upgrade your Node.js version. First, have the AI give you commands to collect your system information, and then it will provide the fastest and most accurate guidance.
2. Install the Gemini CLI
Install using npm:

3. Create a configuration file
Open the terminal and run:
Don’t forget to replace the API KEY
Verify whether the configuration was successful:

4. Verify the configuration
In the terminal, type gemini to start it, then in the dialog box, enter: Hello!
Say hello to him. If he responds normally and you can see the invocation record within the platform, it means the configuration was successful.


Linux
1. Install Node.js
Command to install Nodejs (you can skip this if it is already installed):
Verify the installation:

Note that the Nodejs version must be 18 or higher.
If your version is lower than this, you can ask the AI how to upgrade your Node.js version. First, have the AI give you commands to collect your system information, and then it will provide the fastest and most accurate guidance.
2. Install the Gemini CLI
Install using npm:
If it appears as shown in the figure below, the installation was successful.

3. Create a configuration file
Open the terminal and run:
Don’t forget to replace the API KEY
Verify whether the configuration was successful:

4. Verify the configuration
In the terminal, type gemini to start it, then in the dialog box, enter: Hello!
Say hello to him. If he responds normally and you can see the invocation record in the platform, it means the configuration was successful.

