Lifestyle

CLI commands and slash commands

Distinguish shell commands and launch flags, interactive slash commands, keyboard shortcuts and natural-language requests. Check the input location: /plan belongs in the Codex interactive client; codex --help runs in the operating-system terminal.

About 12 min read · Practice 20 min

Workflow illustration, not a product screenshot.
Image: Mokaair (© Mokaair)
On this page
  1. What you will accomplish
  2. Before you begin
  3. Distinguish five kinds of input
  4. Step 1: inspect version and help
  5. Step 2: start a session and inspect status
  6. Step 3: request a plan
  7. Step 4: exit and locate the same session
  8. Common-command index
  9. Verification, troubleshooting and restoring
  10. Practice and verification record

What you will accomplish

The scope is Codex CLI. The desktop app and ChatGPT web can also have slash menus, but their commands differ. Do not treat Claude Code commands, older screenshots or desktop shortcuts as CLI syntax. Check the interface and version you are actually using.

Before you begin

Complete and sign-in. Download the todo materials and copy expected into codex-practice. This lesson primarily reads files and produces a plan; GitHub and paid external services are unnecessary. If codex is not found, resolve installation first instead of confusing path discovery with authentication.

Open PowerShell on Windows, Terminal on macOS, or a shell in the relevant Linux/WSL environment at the practice folder. WSL /home paths differ from Windows C:\Users paths. Run commands where the CLI is installed and verify the location before proceeding.

Distinguish five kinds of input

TypeWhere it goesExampleEffect
Startup option or flagAfter a terminal command--help in codex --helpControls that command; --help is not a standalone slash command
Shell commandPowerShell / Terminal / Linux shellcodex --helpRuns the CLI and prints help
Interactive slash commandComposer after Codex starts/statusHandled by the current interactive UI
ShortcutPress keys, do not type their namesCtrl+RSearches prompt history
Natural-language promptCodex conversation composerExplain core.mjs without editing.Gives the agent a task to interpret

A shell usually displays a path and prompt; Codex has its own conversation input. Typing /plan in PowerShell is interpreted as a shell command or path, not Codex Plan mode. Conversely, pasting installation commands into a Codex conversation may ask the agent to execute them, which differs from running them yourself.

Step 1: inspect version and help

Windows PowerShell, macOS Terminal or Linux shell; outside a Codex conversation · text
codex --version
codex --help
codex resume --help

Run these one line at a time. They show the version, available subcommands and flags, and resume-specific help. They do not start a new agent task. The Windows environment checked for this lesson reported codex-cli 0.154.0-alpha.6.2; that is an evidence record, not an instruction to install this preview build.

Square brackets in help indicate optional arguments; angle brackets usually identify a value to replace. Do not copy placeholders such as SESSION_ID literally or combine every documented flag. If an option is missing, check spelling, subcommand and version before deciding to update.

Step 2: start a session and inspect status

The same system terminal, in codex-practice · text
codex

Inside the interactive interface, type /, search for status in the popup and run /status. Expect session configuration such as the model, permissions and context state, with fields varying by version. This is not a purchase or reset-credit redemption command.

Codex CLI interactive composer; inspect status · text
/status

Also ask for the working directory in a read-only prompt. If it is wrong, leave the session, enter the correct folder in the shell and restart. Switching models does not correct a directory mistake.

Codex CLI conversation; inspect the practice location · text
Report the current working directory and list the five Small Steps source files.
Do not edit anything. If this is not the practice folder, stop and explain.

Step 3: request a plan

helps inspect requirements, scope and verification before implementation. Run the following in the interactive composer to design a Clear completed feature. It must preserve active tasks and handle an empty list. This lesson produces only the plan.

Codex CLI interactive composer; slash command with this request · text
/plan Plan a Clear completed button for this todo website. Do not implement it yet. Preserve active tasks and explain how to verify an empty list, mixed completion states, and reload behavior.

A useful plan identifies files, button placement, data operations, persistence and test cases. “Edit, test, finish” is insufficient. Check for invented React components or a database that this project does not have. Add constraints until you can use the plan to judge results. When ready to implement later, follow the current interface's mode controls and prompts. A plan does not establish that the website has changed.

While Codex is working, /plan is temporarily unavailable. Wait for that work to finish. If you actually need to interrupt it, use the current interface's stop control and inspect completed changes before requesting a plan. Repeating /plan or switching modes does not undo earlier actions.

Step 4: exit and locate the same session

Record the task name or session identifier after planning, then enter /quit in the interactive composer. Back in the system terminal, run codex resume. Check time, content and location in the picker before selecting the task. For beginners, choosing explicitly is easier to verify than assuming the latest session is the intended one.

Codex CLI interactive composer; leave the interface · text
/quit
Back in the system terminal; open the session picker · text
codex resume

The documentation also provides codex resume --last for the latest session in the current directory; --all broadens the search. Check resume --help before using these options. After resuming, ask for the previous plan and outstanding work, then verify the path. Remembering the feature does not prove the files are in the right location.

When the launch directory differs from the saved session directory, the CLI may ask which directory to use; tui.resume_cwd also affects that choice. Check the full codex-practice path rather than trusting the chat title. An explicit --cd overrides that setting. Beginners can leave overrides out and consult .

Common-command index

InputInterfacePurpose and use here
/modelInteractive CLIInspect available models and reasoning choices; you can cancel
/permissionsInteractive CLIInspect or adjust authorization; reading does not require broader access
/reviewInteractive CLIReview changes; findings still need verification
/compactInteractive CLISummarize a long conversation; not a complete original transcript
/skillsInteractive CLIFind skills for the next lesson
/copyInteractive CLICopy the most recent completed response
codex exec --helpSystem terminalInspect non-interactive options, outside the conversation
Ctrl+RCLI shortcutSearch prompt history; Enter selects and Esc cancels

See , and for those workflows. Before /compact, preserve errors that need exact reproduction and the acceptance criteria; see . The hub's command search accepts terms such as /plan, AGENTS.md and resume.

Verification, troubleshooting and restoring

Normal verification: version and help work, the directory is correct, planning did not edit files, and the same task can be resumed. Boundary verification: type a nonexistent name in the slash menu and observe that it does not become the function you expected. Cancel and check documentation rather than increasing permissions or installing an unknown add-on.

“Command not found” or the Windows equivalent means the shell cannot find codex. Check installation and open a fresh terminal environment. If codex --help works but /plan does not, the input surface is often wrong; that is not a missing CLI installation.

Rejected argument: use ordinary -- hyphens, not a typographic dash, and preserve spaces and quotes. Different subcommands accept different flags; a flag on the main command does not necessarily work everywhere.

Missing or wrong resumed task: consider whether it started in another directory, host or CLI environment. Inspect the picker and help. Do not delete history as a fix. This lesson does not modify source code, so exiting ends it; leaving or restarting a conversation does not undo earlier file operations.

In the diagram, 01 is the system terminal, 02 is Codex interactive input, and 03 is the result to verify.

Practice and verification record

Make a four-row note for help, status, a read-only request and resuming. Include the input location and expected result for each, then try them. Explaining the interface difference between codex resume and /resume is more useful than memorizing many flags.

Checked on 2026-09-14 against the official CLI command documentation and local --help. Windows checks covered version, main-command help and resume help. Interactive commands, model menus and macOS/Linux behavior were checked through documentation, not all exercised directly. Continue with and .

11. CLI commands and slash commands — Workflow illustration, not a product screenshot. Shell → Interactive / → Result
11. CLI commands and slash commands — Workflow illustration, not a product screenshot. Shell → Interactive / → Result · Image: Mokaair (© Mokaair)
Read the full description

Shell to Interactive / to Result

Back to directory

  • Lifestyle

    Codex learning hub: tutorial directory

    A planned 60-lesson, ten-unit Codex curriculum, from setup and your first task to MD instructions and advanced integrations. Find your next lesson by experience, platform, goal or command; unpublished entries show their status.

  • Lifestyle

    Worktrees and isolated tasks

    A Git worktree gives one repository multiple working directories on different branches. It isolates file edits, but databases, ports and external services may still be shared. File isolation is not full resource isolation.

  • Lifestyle

    Workshop: build a small website

    Plan and build the Small Steps task website from brief.md, with adding, completing, deleting, filtering and local persistence. Separate HTML, CSS, data functions, UI events and tests, verify with Node and browser checks, and document restart and recovery steps.

  • Lifestyle

    Usage and efficiency: reducing rework

    Record task conditions, model options, time and outcomes to reduce unnecessary retries and excess context.

Latest travel guides

Sources

Lifestyle