How to Vibe Code in the Terminal: The Exact Setup
If you’re building with Lovable, Bolt or Replit, you’re paying a premium for a wrapper. Under the hood, those tools call the same models you can run directly from your own computer. Going direct gets you more usage for the money, full control of your code, and the ability to run several projects at once.
It sounds technical. It isn’t. You need one free app, one subscription, and about twenty minutes.
Here’s the exact setup, step by step.
What you need before you start
- A Mac. cmux, the terminal app in this guide, is macOS only for now.
- One paid AI plan. Claude Code needs a Claude Pro, Max, Team or Enterprise plan (the free plan doesn’t include it). Codex needs a ChatGPT Plus, Pro, Business, Edu or Enterprise plan. You only need one to start. I use both, but pick one and get comfortable first.
- A free GitHub account at github.com. Optional for day one, but you’ll want it by step 6.
Step 1: Download cmux
cmux is a free, open-source terminal built for running AI coding agents. Its big advantages over the default Mac Terminal: split panes, a sidebar of workspaces that shows each project’s folder and git branch, and a ring that lights up when an agent needs your attention.
- Go to cmux.com and click Download for Mac.
- Open the
.dmgfile and drag cmux into your Applications folder. - Open cmux from Applications. If macOS warns you about opening an app from the internet, click Open.
If you already use Homebrew, you can install it from the terminal instead:
brew tap manaflow-ai/cmux
brew install --cask cmux
cmux updates itself, so you only do this once.
Step 2: Install Claude Code or Codex
Open cmux. You’ll see a blinking cursor. That’s your terminal. Paste one of the following and press Enter.
Claude Code:
curl -fsSL https://claude.ai/install.sh | bash
Codex:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
The Claude installer shows no progress while it downloads. Give it a minute. When it finishes, close the tab (⌘W), open a new one (⌘T), and check it worked:
claude --version
or
codex --version
If you see a version number, you’re in. If you see command not found, quit cmux completely and reopen it. That fixes it most of the time.
Step 3: Log in
Type claude (or codex) and press Enter. The first time, it opens your browser and asks you to sign in.
- Claude Code: log in with your Claude account.
- Codex: choose Sign in with ChatGPT.
Once you’re signed in, quit for now by typing /exit or pressing Ctrl+C twice. You’ll start it properly inside a project in step 5.
Step 4: Create your “work” folder
Every project you build will live in one folder. This keeps things simple: one place to look, one place to back up.
In cmux, run:
mkdir ~/work
That creates a folder called work inside your home folder. You can see it in Finder under your user name.
Now create your first project inside it. Replace my-first-app with whatever you’re building (no spaces, use dashes):
mkdir ~/work/my-first-app
Step 5: cd into the project and start building
cd means “change directory.” It moves your terminal into a folder so the AI works on that project and nothing else.
cd ~/work/my-first-app
claude
(or codex instead of claude)
That’s it. You’re now talking to an AI agent that can read, write and run code inside that folder. Describe what you want in plain English, the same way you would in Lovable:
Build me a simple landing page for a coffee subscription. One page, a headline, three pricing tiers and an email signup. Use plain HTML and CSS so I can open it in my browser.
The first time it wants to create a file or run a command, it will ask permission. Read what it’s about to do and approve it. You can tell it to stop or change direction at any point.
To see what it built, ask it: “How do I open this in my browser?” It will tell you, and usually start a local preview for you.
A tip that saves hours: at the end of every session, ask the agent to “commit everything with a clear message.” That gives you a save point you can always roll back to.
Step 6: Connect your project to GitHub
GitHub is a backup for your code and the bridge to putting your site online (Vercel and Netlify both deploy straight from GitHub).
The easiest way to set it up is to let the agent do it. First install GitHub’s command line tool and log in once:
brew install gh
gh auth login
(No Homebrew? Install it first from brew.sh. It’s one command.)
Follow the prompts: choose GitHub.com, HTTPS, and Login with a web browser.
Then, inside your project, just ask the agent:
Initialize git in this folder, create a private GitHub repo called my-first-app, and push everything to it.
It’ll run the commands for you. Repeat this for every new project in your work folder.
Step 7: Run eight agents on one screen
This is where it stops being a Lovable replacement and starts being a superpower. Instead of one chat with one project, you can run a different agent in every pane.
The cmux shortcuts you need:
| Action | Shortcut |
|---|---|
| Split pane to the right | ⌘D |
| Split pane down | ⌘⇧D |
| Move between panes | ⌥⌘ + arrow keys |
| New workspace (a new sidebar entry) | ⌘N |
| Rename a workspace | ⌘⇧R |
| New tab | ⌘T |
| Close tab | ⌘W |
To build an eight-pane grid:
- Press
⌘Dthree times to get four columns. - Click into each column and press
⌘⇧Donce to split it in half. Now you have eight panes. - In each pane,
cdinto a project and start an agent:
cd ~/work/my-first-app && claude
cd ~/work/client-site && codex
Each pane is its own agent with its own job. One builds a landing page, one fixes a bug in another project, one writes tests. When an agent finishes or needs approval, its pane lights up, so you can leave them running and only check in when something needs you.
If eight feels like a lot, it is. Start with two side by side. Most people find their limit is attention, not screen space. You can also use workspaces (⌘N) instead of splits: one workspace per project, listed in the sidebar with its branch name.
One rule: don’t point two agents at the same project folder at the same time unless you’ve asked them to work on separate things. They’ll overwrite each other’s changes.
The whole setup on one screen
- Download cmux from cmux.com and drag it to Applications.
- In cmux, install Claude Code (
curl -fsSL https://claude.ai/install.sh | bash) or Codex (curl -fsSL https://chatgpt.com/codex/install.sh | sh). - Run
claudeorcodexand sign in. mkdir ~/work, then make a folder for each project inside it.cd ~/work/project-nameand runclaudeorcodex.- Install
gh, log in, and ask the agent to push each project to GitHub. - Split cmux into panes with
⌘Dand⌘⇧D, and run a different agent in each one.
The tools that hide the terminal from you are selling comfort. Comfort is worth something in week one. By week three it’s a tax on everything you build. Twenty minutes of setup buys you the same models, more usage, and code that’s actually yours.