Install OpenAI Codex and Google Gemini AI coding agent

Installing npm on Ubuntu

To install npm (the Node.js package manager) on Ubuntu, follow one of the clean, up-to-date methods below.


Option 1: Install from NodeSource (Recommended)

This gives you the latest stable Node.js and npm.

Verify installation:


Option 2: Install via Ubuntu’s Default Repositories (Older Version)

This is simpler but often outdated:

Check versions:

If npm shows a very old version, you can update it later with:


Installing OpenAI SDK (Codex Successor)

The @openai/codex package is no longer supported. Instead, install the official OpenAI SDK to access GPT-4 and GPT-5 models.

Option 1: Install Locally (Recommended for Projects)

Then you can use it in JavaScript:

Before running, set your API key:


Option 2: Global Installation (Optional)

If you prefer a global install without sudo:

Add this line to your ~/.bashrc or ~/.zshrc:

Reload your shell:

Now you can safely install globally:


Installing Google Gemini SDK

To use Google’s Gemini models, install the official Generative AI SDK:

Example usage:

Before running, export your Gemini API key:


Summary

Goal Install Command SDK API Key Env Variable
Use GPT-4/5 (Codex successor) npm install openai OpenAI SDK OPENAI_API_KEY
Use Google Gemini npm install @google/generative-ai Google Generative AI SDK GEMINI_API_KEY
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x