Skip to main content

Code, terminals, and startup commands

The editor, terminals, and agent all work with the files on your development machine. Use whichever is most convenient: ask the agent to implement a feature, edit a file yourself, or run a command to test the result.

Edit and save files​

Open Explorer and select a file to open it in a tab. Save your edits with ⌘S on macOS or Ctrl+S on Windows and Linux. Unsaved changes are marked on the tab.

Saving writes the file to the development machine. It does not create a Git commit, push to the shared repository, or update a deployment.

The agent and terminal commands can also change files. If a file changes on disk while you have unsaved edits, the editor warns about the conflict. Review both versions before overwriting or reloading: either action can discard work you intended to keep.

Open a terminal​

Choose Open a terminal on the welcome screen, or Dev Machine → New terminal. This opens a shell on the cloud development machine—not your own computer.

Use it to install dependencies, run tests, build the application, inspect logs, or start a server. For an existing Node.js application with a lockfile and matching package scripts, a typical sequence might be:

npm ci
npm test
npm run dev

Use the commands defined by your application; not every project has those scripts. Ask the agent to check the repository and explain the commands if you are unsure. For a browser preview, your development server also needs the correct host and port configuration.

You can open multiple terminals—for example, one for the server and another for tests. Closing a terminal's editor tab only hides it; the terminal remains listed under Dev Machine → Terminals. Kill terminal ends that session. Use Ctrl+C to interrupt a foreground command when appropriate.

Do not rely on a development terminal to keep a production service running after your development session ends.

Save commands you use repeatedly​

Startup commands save the steps you want to run when working in the module, such as starting a web server or a file watcher.

  1. Open Dev Machine and choose New startup command under Startup.
  2. Give it a recognisable name, such as Web preview.
  3. Enter the command, or start from one of the supplied presets.
  4. Choose whether it should start automatically, then save it.

Run a saved command from its row. While running, you can open its terminal output, stop it, or restart it. Turn automatic starting off for occasional tasks such as dependency installation or a one-off check.

Each startup command launches independently. Listing Install dependencies above Start server does not make the server wait for installation. If the second action depends on the first succeeding, put them in one command:

npm ci && npm run dev

Keep commands safe to repeat. Avoid automatically running database resets, destructive cleanup, or other actions that should require a deliberate decision.

Work with the agent​

Give the agent a concrete goal and ask it to verify the result:

Add a search field to this application. Run the relevant tests and check it in the development preview. Explain what changed before committing anything.

Review the code and terminal results, then use Git and source control to record and share the work. Development startup commands are separate from a deployment's startup script; publishing requires its own build-and-run configuration.