Install from the official source and sign in with your account
Installing the program, signing in to your account, and opening it in the folder are three separate steps, each with its own check. The command comes from the official page, the account is your subscription, and no password passes through the terminal.
2Install Claude Code or Codex from the official address
3Confirm with --version after reopening cmd
4Sign in with your subscription and check the method, without exposing a key
Objective: install Git, gh, Node, and the agent (Claude Code or Codex) using cmd, then confirm the version and sign-in method.
01 · From zero to an open agent
Three steps, each with its own check.
Lesson 201 · From zero to an open agentThree steps, each with its own check.
1/4
Install the program
Installing puts the program on your computer. It doesn’t connect your account or choose the folder yet. After installing, close cmd and open it again: only the new window can see the program that was just installed.
Scroll down: each step below lights up its part of the diagram.
1/4
Install the program
Installing puts the program on your computer. It doesn’t connect your account or choose the folder yet. After installing, close cmd and open it again: only the new window can see the program that was just installed.
2/4
Sign in with your account
Like a badge at a turnstile: the terminal sends you to the browser, and that’s where you sign in. Your password never goes through the terminal. Signing in with your account uses your subscription plan; an API key bills usage to a different account.
3/4
Open in the folder
The agent works in the folder where you opened it. The first time you open it in a folder, it asks whether you trust it: this is your practice folder, so confirm. To exit, /quit in Codex or /exit in Claude Code.
4/4
One step at a time
Installed it? Check the version. Signed in? Check the method. Opened it? Check the folder. If something fails, you know exactly which of the three steps stopped.
Right after installing, opening the agent and seeing a sign-in request isn’t a defect: step 1 worked, and step 2 is still needed.
02 · Check the seal before opening the box
Four precautions that apply to any new program.
1. Official source
“Faster” commands circulate online. A command pasted without checking can run anything.
Read the publisher: Git.Git, GitHub.cli, OpenJS.NodeJS.LTS, @openai/codex, claude.ai/install.cmd. If the name is different or from an unknown page, don’t paste it.
Warning signA package with “codex” in its name, but without @openai/ in front.
2. Wait for the >
Paste one command, wait for it to finish, and for > to return. You don’t need to understand the lines that scroll by.
The first time, winget may ask if you accept the source terms: type Y and press Enter.
What you seeSuccessfully installed
3. Reopen and check
Close cmd and open it again. Then git --version, gh --version, and claude --version or codex --version should return a number.
“Is not recognized as an internal or external command” usually just means you’re using an old window.
RuleInstalled it? Close and reopen cmd before checking.
4. Sign-in method
The first time you open it, the agent asks you to sign in: use your subscription. In Codex, codex login opens the browser, and codex login status tells you how you signed in.
In the project sheet, record the method (“account” or “API”). Never put the key itself in a sheet, prompt, or screenshot.
Expected responseLogged in using ChatGPT
03 · The installation commands
Once per computer. Copy one block, wait for it to finish, then close and reopen cmd.
rem Claude Code:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
rem Codex:
npm install -g @openai/codex
cmd · in a NEW window, check
git --version
gh --version
claude --version
codex --version
cmd · sign in and check the method (Codex)
codex login
codex login status
cmd · open the agent in the project folder
cd %USERPROFILE%\projetos\meu-primeiro-agente
cd
claude
Simulation: illustrative example
C:\Users\ana> winget install --id OpenJS.NodeJS.LTS -e
Successfully installed
C:\Users\ana> rem closed cmd and opened another
C:\Users\ana> npm install -g @openai/codex
added 1 package in 9s
C:\Users\ana> codex login status
Logged in using ChatGPT
Version numbers and times change over time. What matters is seeing a number, not an error message.
"… is not recognized as an internal or external command": close cmd, open it again, and repeat.
winget asked you to accept terms: Y and Enter.
login status shows an API key and you wanted the account: codex logout, then codex login.
The agent asks whether it trusts the folder: it’s your practice folder, confirm.
In the Mac or Linux Terminal, install Claude Code with curl -fsSL https://claude.ai/install.sh | bash and Codex with npm install -g @openai/codex (install Node first). Check the same way: run --version in a new window.
04 · Rehearse: install and check
Notice what happens when you check in the same window.
Missions
1Install Git with winget (exact name: Git.Git).
2Check whether Git responds in this same window.
3Close this window (the command is exit).
4Now check Git again.
5Check which method Codex used to sign in.
Command Prompt · simulation
Simulation: actual messages may vary with the Windows and program versions.
05 · Practice
Once per computer.
E3 · Tools installed
20 min
Install Git, GitHub CLI, Node, and the agent you’ll use with winget. Close and reopen cmd, then run the --version commands.
Done when:git --version, gh --version, and claude --version or codex --version show version numbers.
E4 · Sign in and note the method
10 min
Open the agent, sign in with your subscription through the browser, and note on a card (or phone note) which method is active and where you checked.
Done when: the card says "account" (or "API") and contains no password or key.
06 · Test what you learned
The explanation appears after your answer.
Question 1 of 3
You installed Git, and in the same window, git --version replied "is not recognized." What should you do?
Correct
The window that was open before installation can’t see the new program. A new window almost always fixes it; reinstalling only makes things harder.
Not this one
The window that was open before installation can’t see the new program. A new window almost always fixes it; reinstalling only makes things harder.Review: Rehearse: install and check
Question 2 of 3
In a group, someone shared a “faster” command to install Codex, using a package name other than @openai/codex. What do you do?competency
Correct
The name in the command is the seal. A command from an unknown source can run anything on your computer.
What do you put in the project sheet about the agent’s access?
Correct
Write down the method, never the credential. A key in plain text, a screenshot, or a request can be used by someone else, and the account is yours.
Not this one
Write down the method, never the credential. A key in plain text, a screenshot, or a request can be used by someone else, and the account is yours.Review: From zero to an open agent
Test complete
You got {a} out of {n} right. Get them all right to mark the lesson complete.
Choose an option. The explanation appears after your attempt.