Beginner's Guide: How to Use AI From the Terminal
A walkthrough for someone who has never opened a terminal, on Mac, Windows or Linux. At the end you have a package manager, Node, Git and a terminal AI tool installed, and you have run your first session. It covers Claude, ChatGPT, Gemini, Kimi, GLM and DeepSeek, and says why the terminal keeps you free to change between them.
==============================================================================
ARKEY GUIDES
BEGINNER'S GUIDE: HOW TO USE AI FROM THE TERMINAL
==============================================================================
Version 1.0 Written 2026-11-12
Platforms: Mac, Windows, Linux
==============================================================================
TABLE OF CONTENTS SEARCH CODE
------------------------------------------------------------------------
1. What this guide gets you ................................... [INTR]
2. The three ways to use AI ................................... [WAYS]
3. Why you should use the terminal version .................... [WHYT]
4. What a terminal is ......................................... [TERM]
Optional: a different terminal app ......................... [APPS]
5. Get a package manager ...................................... [PKGM]
6. Install Node and Git ....................................... [NODE]
7. Install the AI tools ....................................... [INST]
8. Your first session ......................................... [PLAY]
9. When it goes wrong ......................................... [HELP]
10. Command list .............................................. [LIST]
11. Version history ........................................... [VERS]
HOW TO READ THIS GUIDE
Most steps are the same on every computer. Where they differ, the step
is split into three parts marked MAC, WINDOWS and LINUX. Do the part
for your computer and skip the other two.
To jump to a section, press Ctrl+F (Cmd+F on a Mac) and type its
search code with the brackets.
1. What this guide gets you [INTR]
At the end of this guide your computer has these installed:
| Thing | What it is |
|---|---|
| A package manager | A program that installs other programs from one command. |
| Node | A program that runs JavaScript tools. Many AI tools are installed through it. |
| Git | A program that keeps a history of changes to a folder. |
| A terminal AI tool | Claude Code, Codex, Antigravity CLI or Kimi Code. You can install more than one. |
You need a computer, an internet connection and about 30 minutes. You do not need to know how to code.
You also need an account with at least one AI company. Section 2 lists them. You only need one to finish this guide.
What each computer needs:
| Computer | Version |
|---|---|
| Mac | macOS 15 (Sequoia) or newer for Homebrew. Claude Code alone runs on macOS 13 or newer. |
| Windows | Windows 10 version 1809 or newer, or Windows 11. |
| Linux | Ubuntu 20.04 or newer, or Debian 10 or newer. Other distributions work with their own package manager. |
All of them need 4 GB of memory or more.
2. The three ways to use AI [WAYS]
The same AI model can be reached in three ways.
| Way | Where it runs | What it can touch |
|---|---|---|
| Chat website | A browser tab | Only what you paste or upload |
| Desktop app | An app you download | Files you attach, and a folder if you turn on its coding mode |
| Terminal (TUI) | A text window on your computer | The folder you start it in, and commands on your computer |
TUI means text user interface: a program you use inside the terminal. It is the word this guide uses for the terminal version.
The chat website and the app are the right place for a question, a draft or an image. The terminal is the right place when the work is on your computer: files, folders, code, installs, a server.
Who makes what
Six AI companies, each with a chat website. Not all of them make a terminal tool.
| AI | Made by | Chat website | Its own terminal tool |
|---|---|---|---|
| Claude | Anthropic | claude.ai | Claude Code |
| ChatGPT | OpenAI | chatgpt.com | Codex |
| Gemini | gemini.google.com | Antigravity CLI and Gemini CLI | |
| Kimi | Moonshot AI | kimi.com | Kimi Code |
| GLM | Z.ai | chat.z.ai | None found. It runs inside Claude Code. |
| DeepSeek | DeepSeek | chat.deepseek.com | None. It runs inside Claude Code and Codex. See the note below. |
A note on Gemini. Google has two terminal tools. Since 2026-06-18, a personal Google account, free or paid, uses Antigravity CLI. Gemini CLI is for a Google Cloud account or a Gemini API key. This guide installs Antigravity CLI and lists Gemini CLI as the other option.
A note on GLM and DeepSeek. On 2026-11-12 I looked for a terminal tool made by Z.ai or by DeepSeek and did not find one. DeepSeek does publish DeepSeek Harness. Despite the name, it opens a web page in your browser. It is a GUI, not a terminal tool. Both companies document the same route for the terminal: install another company's tool and point it at their model. Section 7e shows how. If either one ships its own terminal tool, this guide will be updated.
Desktop apps, if you want them: Claude and ChatGPT.
What each one needs to sign in from the terminal:
| Tool | Account |
|---|---|
| Claude Code | A Claude Pro, Max, Ultra, Team or Enterprise plan, or a Console account. The free Claude plan does not include it. |
| Codex | A paid ChatGPT plan. |
| Antigravity CLI | A Google account. |
| Gemini CLI | A Google Cloud account with Gemini Code Assist, or a Gemini API key. |
| Kimi Code | A Kimi Code account, or a Moonshot AI Open Platform API key. |
| GLM in Claude Code | A GLM Coding Plan API key. |
| DeepSeek in Claude Code | A DeepSeek API key. You pay for what you use. |
3. Why you should use the terminal version [WHYT]
The main reason: you are not locked to one company
A chat website or a desktop app runs one company's models. Your chats, your settings and your habits stay inside that product. This is vendor lock-in. When another company's model becomes better or cheaper, moving means starting again.
A terminal tool is separate from the model behind it. Three facts make this true:
- Your work stays in your folder. The files, the notes and the history are on your computer, not in a company's chat log. Any tool can open them.
- One tool can run another company's model. Claude Code runs GLM and DeepSeek by changing a few settings. Section 7e does this. The chat websites and apps have no such setting.
- The tools work the same way. Claude Code, Codex, Antigravity CLI and Kimi Code all start in a folder, take a request in plain words, and ask before they act. What you learn in one carries to the next.
This is what model-agnostic means: you pick the model for the job, and change it without changing how you work. The same holds for a model running on your own computer, which the next guide covers.
The second reason: a browser limits what the AI can do
A browser keeps every website in a closed box, called a sandbox. This protects you: a website cannot read your files or run programs on its own. It also limits the AI. The limit comes from the browser, not from the model.
From a chat website, the AI cannot:
- Open a folder on your computer and read what is in it. You upload or pick the files yourself.
- Change a file in place. It gives you text, and you paste it in yourself.
- Run a command or a program on your computer, or see the error when one fails. Some chat websites can run code, but on the company's computers, not on yours.
- Install software.
- Reach another computer, such as a rented GPU.
Each company also sets its own limits on its website: how many files you can upload, how large they can be, and which features are turned on. These differ from one website to the next, and they change.
The DeepSeek chat website is one example. It works well in a browser, and it still stopped me from doing some actions. The same DeepSeek model, reached from a terminal tool as in section 7e, does not have the browser's limits.
In a terminal the model works with what your own computer allows, and it asks you before each action.
The other reasons
- It works on your real files. You start it inside a folder. It reads the files there and edits them. You do not copy and paste back and forth.
- It can run commands. It can install a program, run a script and read the error. Then it fixes the error and runs it again.
- It asks first. Before it edits a file or runs a command, it shows you what it will do and waits for your answer.
- It is the same account. Claude Code and Codex sign in with the plan you already pay for. There is no second bill.
- It is the same on every computer. The apps differ between Mac, Windows and Linux. The terminal version takes the same requests and the same commands on all three.
- It works on a remote computer. A rented cloud GPU has no screen. A terminal is the only way in. The guide on local models and the later guides on cloud GPUs all use the terminal, so this guide comes first.
4. What a terminal is [TERM]
A terminal is a window where you type a command and the computer answers in text. It does the same things as clicking, but with words.
Open it
MAC
- Press
Cmd + Space. A search bar opens. - Type
Terminal. - Press
Return.
WINDOWS
- Press the
Windowskey. - Type
PowerShell. - Press
Enter.
Windows has two terminals: PowerShell and Command Prompt. This guide uses PowerShell. Its line starts with PS.
LINUX
- Press
Ctrl + Alt + T. - If nothing opens, open your app menu and search for
Terminal.
Use it
A window opens with a line that ends in %, $ or >. That line is the prompt. It means the terminal is waiting for you.
How to run a command:
- Type it, or paste it.
- Press
Enter. On a Mac the key is namedReturn. - Wait until the prompt comes back. A new prompt means the command finished.
| What | Mac | Windows | Linux |
|---|---|---|---|
| Paste | Cmd + V | Ctrl + V | Ctrl + Shift + V |
| Stop what is running | Control + C | Ctrl + C | Ctrl + C |
| Bring back the last command | Up arrow | Up arrow | Up arrow |
| Finish a file or folder name | Tab | Tab | Tab |
Try these five. They work on all three computers. None of them changes anything.
pwd
Prints the folder you are in. A folder is also called a directory.
ls
Lists the files and folders inside it.
cd Desktop
Moves into the Desktop folder. cd means change directory.
cd ..
Moves back up one folder.
clear
Clears the window.
Two rules for the rest of this guide:
- Copy each command exactly. One wrong character changes what it does.
- Only paste commands from a source you trust. A command can change or delete files.
Optional: a different terminal app [APPS]
The terminal that comes with your computer is enough for this whole guide. Skip this part if you want. Come back after section 5, because the install commands use the package manager.
A terminal app is only the window. The commands and the AI tools work the same in every one. Four that are free and good:
| App | Runs on | Known for |
|---|---|---|
| iTerm2 | Mac | The long-standing Mac choice. Everything is set from menus. |
| kitty | Mac, Linux | Fast. Set up from a text file. Splits one window into several. |
| Ghostty | Mac, Linux | Fast, and works well with no setup. |
| WezTerm | Mac, Windows, Linux | Set up from a text file. Built-in multiplexer. The same setup on all three computers. |
My picks are kitty and WezTerm, for two reasons:
- Customization. Both are set up from one text file. You can change the font, the colors and every key. You can also ask the AI tool to edit that file for you.
- Multiplexing, or mux. One window splits into several terminals, side by side. You can run an AI tool in one and watch its files in another. WezTerm can also keep a session running after you close the window.
All four are good. If you do not want to choose, stay with the terminal you have.
On Windows, the built-in Windows Terminal is also good, and it runs PowerShell in tabs. WezTerm is the one from this list that runs on Windows.
MAC
Install one:
brew install --cask iterm2
brew install --cask kitty
brew install --cask ghostty
brew install --cask wezterm
WINDOWS
winget install wez.wezterm
LINUX
kitty is in the package manager on Ubuntu, Debian and Fedora:
sudo apt install kitty
sudo dnf install kitty
Ghostty and WezTerm install differently on each distribution. Follow the Linux steps on ghostty.org and wezterm.org.
ALL THREE
Open the new app the same way you open any app. Everything from section 4 onward works in it without changes.
5. Get a package manager [PKGM]
A package manager installs programs from one line of text. Each computer has its own.
| Computer | Package manager | Do you install it? |
|---|---|---|
| Mac | Homebrew (brew) | Yes |
| Windows | WinGet (winget) | No. It comes with Windows. |
| Linux | apt on Ubuntu and Debian, dnf on Fedora | No. It comes with Linux. |
MAC
Paste this and press Return:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
What happens next:
- It asks for your Mac password. Type it and press
Return. Nothing appears on screen while you type. That is normal. - It lists what it will install and waits. Press
Returnto continue. - It may install Apple's Command Line Tools first. This can take several minutes.
- It ends with
Installation successful!and a section namedNext steps.
Do the next steps. On a Mac with an Apple chip (M1 or newer) they are these three lines. Run them one at a time:
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
If your terminal printed different lines under Next steps, run the lines it printed, not these.
Check that it worked:
brew --version
WINDOWS
Check that WinGet is there:
winget --version
You should see a version number. If you see an error, open the Microsoft Store, search for App Installer, install or update it, and open a new PowerShell window.
LINUX
Refresh the list of programs your package manager knows. It asks for your password, and nothing appears while you type it.
Ubuntu and Debian:
sudo apt update
Fedora:
sudo dnf check-update
6. Install Node and Git [NODE]
Node runs JavaScript tools. It comes with npm, which installs them. Git keeps a history of changes to a folder, and both AI tools use it when it is there.
MAC
brew install node git
WINDOWS
winget install OpenJS.NodeJS.LTS
winget install Git.Git
Close PowerShell and open it again when both finish.
LINUX
Ubuntu and Debian:
sudo apt install nodejs npm git
Fedora:
sudo dnf install nodejs git
ALL THREE
Check each one:
node --version
npm --version
git --version
Each prints a version number. On Linux the Node version can be older than 22. That is enough for this guide, with one exception: Gemini CLI in section 7c needs Node 20 or newer.
Claude Code, Codex, Antigravity CLI and Kimi Code have their own installers and do not need Node. Gemini CLI does need it. Install it anyway. Many other AI tools are installed with npm, and later guides use it.
7. Install the AI tools [INST]
Install one or more. Each is separate from the others.
7a. Claude Code
MAC and LINUX
curl -fsSL https://claude.ai/install.sh | bash
WINDOWS
irm https://claude.ai/install.ps1 | iex
ALL THREE
The command shows no progress while it downloads. Wait for the prompt to come back. Then close the terminal window, open a new one, and check:
claude --version
You should see a version number followed by (Claude Code). This install updates itself.
7b. Codex
MAC and LINUX
curl -fsSL https://chatgpt.com/codex/install.sh | sh
WINDOWS
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
ALL THREE
Open a new terminal window and check:
codex --version
To update Codex later, run its install command again.
7c. Gemini: Antigravity CLI
MAC and LINUX
curl -fsSL https://antigravity.google/cli/install.sh | bash
WINDOWS
irm https://antigravity.google/cli/install.ps1 | iex
ALL THREE
Open a new terminal window and start it. Its command is agy. It asks you to sign in with your Google account the first time.
agy
If you use Google Cloud or a Gemini API key, install Gemini CLI instead. It needs Node from section 6, and its command is gemini:
npm install -g @google/gemini-cli
I did not find a Google page that states which Google plans Antigravity CLI accepts. Guides written by others say a free Google account works.
7d. Kimi Code
MAC and LINUX
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
WINDOWS
Kimi Code uses Git for Windows. Install Git in section 6 first. Then:
irm https://code.kimi.com/kimi-code/install.ps1 | iex
ALL THREE
Open a new terminal window and check:
kimi --version
To sign in, start it with kimi, then type /login and press Enter.
7e. GLM and DeepSeek, inside Claude Code
Neither has its own terminal tool. Each one runs inside Claude Code. You install Claude Code in 7a, then tell it to send its requests to the other company. You do not need a Claude plan for this. You need that company's API key. An API key is a password for programs.
Two settings do the main work. Each company's page adds a few more, such as the model's name:
| Setting | What it holds | GLM | DeepSeek |
|---|---|---|---|
ANTHROPIC_BASE_URL | The address requests go to | https://api.z.ai/api/anthropic | https://api.deepseek.com/anthropic |
ANTHROPIC_AUTH_TOKEN | Your API key | From z.ai | From platform.deepseek.com |
Each company keeps a setup page with the full steps and the current model names. Follow that page. Model names change often, so this guide does not copy them.
- GLM: docs.z.ai/devpack/tool/claude
- DeepSeek: api-docs.deepseek.com, Claude Code
Z.ai also has a helper that writes the settings for you. It needs Node from section 6:
npx @z_ai/coding-helper
To go back to Claude, remove the two settings and open a new terminal window. I did not run the GLM or DeepSeek setup for this guide. The addresses and steps are from each company's own pages.
7f. Other ways to install
These install the same programs through a package manager. Use them only if the commands above fail. Do not install the same program twice.
| Computer | Claude Code | Codex |
|---|---|---|
| Mac | brew install --cask claude-code | brew install --cask codex |
| Windows | winget install Anthropic.ClaudeCode | npm install -g @openai/codex |
| Linux | npm install -g @anthropic-ai/claude-code | npm install -g @openai/codex |
Installs made this way do not update themselves. Installing Claude Code with npm needs Node 22 or newer.
8. Your first session [PLAY]
This section is the same on all three computers.
Open a new terminal window and start the tool you installed. This guide uses Claude Code:
claude
The first time, it opens your browser and asks you to sign in. Sign in, then come back to the terminal. It may also ask whether you trust the folder you are in. Choose yes.
Now type this request in plain words and press Enter:
Make a folder on my Desktop named hello world.
It stops and asks for permission before it makes the folder. Read what it shows, then choose yes. This is the main habit to learn: read what it asks before you approve it.
Look at your Desktop. A folder named hello world is there. The AI did something on your computer, not only in a chat.
To leave Claude Code, type /exit and press Enter. To see every command it has, type /help.
The other tools take the same request. Start one with its command, and press Ctrl + C to leave:
| Tool | Command | First time |
|---|---|---|
| Codex | codex | Choose Sign in with ChatGPT. |
| Antigravity CLI | agy | Sign in with your Google account. |
| Kimi Code | kimi | Type /login and press Enter. |
When you have a real project, cd into the project folder first, then start the tool. It works on the folder you start it in.
What next
The next guide runs a model on your own computer and connects it to these same tools: How to Run an AI Model on Your Own Computer.
9. When it goes wrong [HELP]
On any computer:
| What you see | Why | Fix |
|---|---|---|
| Nothing appears when you type your password | The terminal hides passwords. | Keep typing, then press Enter. |
claude, codex, agy or kimi is not found or not recognized | The window was open before the install. | Close it and open a new one. |
npm is not found or not recognized | Node is not installed, or the window is old. | Do section 6 again, then open a new window. |
An EACCES or permission error from npm install -g | npm cannot write to its folder. | Do not add sudo. Use the installer in section 7a to 7d. |
| The sign-in page does not open | The browser did not launch. | Copy the link the terminal printed and paste it into your browser. |
| Claude Code says your plan does not include it | The free plan has no Claude Code access. | Upgrade to a paid plan, or use Codex with a paid ChatGPT plan. |
| The terminal is stuck | A command is still running. | Press Ctrl + C. |
MAC
| What you see | Fix |
|---|---|
command not found: brew | Run the three Next steps lines in section 5, then open a new window. |
command not found: claude in a new window | Run the two lines below, then open a new window. |
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
WINDOWS
| What you see | Fix |
|---|---|
The token '&&' is not a valid statement separator | You pasted a Command Prompt command into PowerShell. Use the PowerShell command in section 7. |
'irm' is not recognized | You are in Command Prompt, not PowerShell. Open PowerShell as in section 4. |
winget is not recognized | Install App Installer from the Microsoft Store, as in section 5. |
LINUX
| What you see | Fix |
|---|---|
curl: command not found | Run sudo apt install curl, or sudo dnf install curl on Fedora. |
claude: command not found in a new window | Run the two lines below, then open a new window. |
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
ALL THREE
If Claude Code is installed but acts wrong, this prints a check of the install without starting a session:
claude doctor
10. Command list [LIST]
THE SAME ON EVERY COMPUTER
WHERE AM I pwd
WHAT IS HERE ls
GO INTO A FOLDER cd foldername
GO UP ONE FOLDER cd ..
MAKE A FOLDER mkdir foldername
PRINT A FILE cat filename
STOP SOMETHING Ctrl + C
START CLAUDE CODE claude
START CODEX codex
START ANTIGRAVITY CLI agy
START GEMINI CLI gemini
START KIMI CODE kimi
LEAVE CLAUDE CODE /exit
CHECK CLAUDE CODE claude doctor
UPDATE CLAUDE CODE claude update
INSTALL A PROGRAM
MAC brew install name
WINDOWS winget install name
LINUX (UBUNTU, DEBIAN) sudo apt install name
LINUX (FEDORA) sudo dnf install name
UPDATE WHAT IS INSTALLED
MAC brew upgrade
WINDOWS winget upgrade --all
LINUX (UBUNTU, DEBIAN) sudo apt update && sudo apt upgrade
LINUX (FEDORA) sudo dnf upgrade
11. Version history [VERS]
1.0 2026-11-12 First version. Mac, Windows and Linux. Claude,
ChatGPT, Gemini, Kimi, GLM and DeepSeek.