Documentation Terminal basics

Terminal basics

The terminal at the bottom of the right panel uses xterm.js. It's a lightweight shell that runs in the browser against your project's files. It is not a container or VM: there's no real Node.js process, package manager, or OS behind it.

What works
  • File commands on your project: ls, cd, pwd, cat, head, tail, wc, grep, echo, touch, mkdir
  • Pipes (|) and output redirects (>): a redirect writes the output to a project file
  • Environment and history: env, export KEY=VALUE, $VAR interpolation, ↑/↓ history, Tab completion, clear
  • git, backed by the GitHub API for the project's linked repo: status, add, commit -m, push (creates a real commit), pull, log (real commits), branch (remote branches), diff (local vs. remote), checkout, remote -v
What is simulated
  • npm install <pkg> looks up package metadata on the npm registry but installs nothing. npm install with no arguments prints a canned message
  • npm run dev, npm run build and node -v print placeholder output. Builds and tests don't run
  • npx / cap / ionic (Capacitor) commands print guidance only
  • The fixed Setup and Run tabs show static informational text
bash
# Inspect project files
ls src
grep useState src/App.tsx

# Write command output to a file
echo "# Notes" > NOTES.md

# Commit and push to the linked GitHub repo
git add .
git commit -m "Add notes"
git push
Note
To add a dependency, list it in package.json or ask the agent to add it. The dev preview fetches packages from there. Run type-checks, tests and builds on your own machine or in CI after pushing to GitHub.
Multiple terminals

Click "+" in the terminal tab bar to open another session, and use the split buttons to show two side by side or stacked. Sessions and their command history (the last 200 commands) are saved to your account and restored the next time you open the project. The terminal is hidden on mobile.