Skip to content

Cloud Computer as a Development Environment: Run Scripts, Install Dependencies, Verify the Environment ​

💡 One-sentence summary: Use the Grok Bot Cloud Computer as your portable development environment — project files persist in /workspace, the Bot runs scripts, installs dependencies, and does environment self-checks in the cloud terminal, work continues when you close your laptop, and after updates or recovery you can rebuild in one step following the skill.

This is the third lesson of Route B (Programmers), and also the final one. Unlike the previous two lessons (B1 Bug Reproduction, B2 Performance Investigation), which came from the official use-cases role table, this lesson strings together the development-relevant rules from the official cloud computer documentation into a practical workflow: where files go, how to run things in the terminal, why dependencies always need reinstalling, and who decides when the disk is full. The whole lesson takes about 10 minutes.

First, remember the official one-sentence positioning of this machine: Every Bot works on a persistent cloud computer with a browser, file system, and terminal — so tasks finish in your real tools instead of staying as chat drafts (official wording: tasks finish in your real tools instead of as chat drafts).

What You'll Be Able to Do After This Lesson ​

  • Use the Grok Bot Cloud Computer as a portable development environment: project files in /workspace, shared by all Bots, cloud scripts keep running when you close your laptop
  • Have the Bot run scripts in the cloud terminal: every command goes through Auto Review first, you click Allow when confirmation is needed, and output and errors are pasted straight back into the conversation
  • Do an environment self-check after installing dependencies: runtime versions, whether key dependencies can be imported, listed in a table pasted into the conversation
  • Save "install dependencies + self-check" as a "Rebuild Environment" skill — after the computer's Update, Recover, or Reset, reinstall in one step by name

Why Use Grok Bot Instead of a Web-Based AI? ​

CapabilityWeb-Based AIGrok Bot
A real machine❌ Can only give you code snippets; you find somewhere to run them yourself✅ A persistent cloud computer with a terminal, file system, and browser — tasks finish in real tools
Environment can be verified❌ "It should run now" — it has never run it itself✅ The Bot installs dependencies and runs scripts itself, pasting the output and errors for you
Work continues when you shut down❌ Close the tab and it's gone✅ Close your laptop, close the app — cloud work continues
Environment is reproducible❌ Describe the environment from scratch in every conversation✅ Save the rebuild workflow as a skill, rerun by name after updates and recovery
Multi-Bot relay❌ One chat window, one brain✅ One machine shared by all Bots — an environment one Bot installed, another can use

Your Current Pain Points ​

  • Running a script locally means half a day of environment setup: version conflicts, missing dependencies, start over on another computer
  • Code from AI "theoretically runs," but when you copy it over, dependencies and files are missing, and on errors you have to ask another round
  • You don't dare close your laptop during long tasks: close the lid and the connection drops, wasting half-finished scripts

When to Use This Approach ​

When you need:

  • A cloud development environment you don't have to set up yourself, ready to dispatch script-running tasks anytime
  • AI that doesn't just give code, but installs dependencies itself, runs it, and pastes the output and errors for you
  • Fast environment rebuilds when things break: after updates or recovery, one command brings the dependencies back

And you don't want to:

  • Install a pile of one-time-use tools and dependencies on your own computer
  • Stare at the terminal waiting for long tasks to finish
  • Re-describe your environment every time you switch devices

🎒 Preparation Before Starting ​

  • Read 1.5 Create Your First Bot — have a Bot you can dispatch tasks to
  • A real small task as practice input (a script, a data conversion, a small project that needs dependencies installed)
  • Know how to handle approval cards; if unfamiliar, first read 3.1 Approvals and Auto Review
  • About 10 minutes

Follow Along ​

Step 1: Get to Know the Grok Bot Cloud Computer — One Machine, Shared by All Bots ​

Why: Before using it as a development environment, first understand three rules that differ from a local machine: who owns the machine, who can see what, and where to watch it work.

How: Open any Bot's conversation, click computer preview in the right-side panel, then send this:

Introduce the cloud computer you're on:
What directories and files are currently in /workspace?

You should see: In the preview you can see the Bot's clicks, typing, and current state, and the Bot replies with a directory listing of /workspace. Remember the three rules:

  1. The machine belongs to the account, not to an individual Bot: browser cookies, login sessions, files, and command-line credentials are shared by all Bots—a file saved by one Bot can be used by another. The official guidance therefore warns: don't put credentials or files on here that you don't want another Bot in the account to touch
  2. Each Bot has its own screen: several Bots can use the browser and desktop tools in parallel, but a single Bot's screen runs only one computer-use task at a time
  3. Closing the lid doesn't stop the work: close the app or shut your laptop and the cloud work continues; log in to the same account on your phone and desktop, and you're looking at the same cloud computer

💡 This is the unique value of the Grok Bot

A web-based AI has no machine—you have to carry the code over and run it yourself. The Grok Bot's cloud computer is a real machine: terminal, file system, and browser all live in the cloud—it keeps running when your laptop is closed, and opening it from another device shows the same machine with the same files.

Step 2: Put the project files into the /workspace persistent work area ​

Why: The official docs draw a clear line on what happens to files—things placed in the right location survive updates and recovery, while things placed in the wrong location are lost.

How: Send this message to set up the project:

Create a project folder under /workspace named [project name].
From now on, put this project's scripts, data, and result files in this folder.

You should see: The Bot confirms the directory is created. Memorize the official breakdown:

WhereAfter update/recoveryExamples
Project folders in /workspace✅ KeptScripts, data, result files
Browser state, supported logins✅ KeptLogin sessions for web tools
Temporary directories, manually installed packages❌ Treated as disposableSystem temporary files
node_modules, Python virtual environments❌ Not saved, must be reinstalledDependency directories

Double-insure important results: have the Bot copy them into /workspace, or attach them to the conversation (official wording: Copy important results into the shared workspace or attach them to the conversation). For details on attachments and reviewable results, see 2.2 Files and Reviewable Results.

Step 3: Have the Bot run its first script in the terminal ​

Why: This step validates the core experience of "AI running scripts"—the Bot types the commands, but every action goes through Auto Review first, so you stay in control.

How: Send it a real small task:

Run [script or task] once on the cloud computer.
When it finishes, paste the full output to me; if it errors, attach the complete error message instead of just saying it failed.

You should see: The Bot opens a terminal in the preview and types commands. Most actions are auto-approved; when your confirmation is needed, a terminal command approval card appears in the chat—with Allow / Skip buttons, and Manage settings next to them taking you straight to Auto Review settings. Click Allow and the command runs, with the output pasted back into the conversation.

Tired of approval cards popping up for frequently used commands? You can set up auto-approval rules—the official example is a development scenario: "Auto-approve running git status in /workspace/reports". For rule details, see 3.1 Approvals and Auto Review.

Step 4: Install dependencies and verify the environment ​

Why: Installing dependencies is the core action of setting up an environment, but the official docs explicitly classify it as "not saved"—so after installing you must verify, and write down how you installed things (to save as a skill in the next step).

How: Send this message:

Install the dependencies for [project name]: [dependency list].
After installation, run an environment self-check and list the results in a table:
Language runtime version, whether each key dependency can be imported, and its version number.
If any item fails, attach the complete error message.

You should see: The Bot installs the dependencies one by one (each action still goes through Auto Review), then returns an environment self-check table: one check per row—name, result (pass/fail), version or error.

Remember the official line: project folders like node_modules and Python virtual environments are not saved; after a computer Update, Recover, or Reset they must all be reinstalled. "Verify right after installing" isn't perfectionism—it's the user manual for this machine.

Step 5: Save "rebuild the environment" as a skill ​

Why: Dependencies will need reinstalling sooner or later—instead of dictating the list every time, save the process as a skill that can be rerun with a single instruction.

How: Send this message:

Save the complete "install dependencies + environment self-check" process from just now as a skill,
named "Rebuild Environment". Spell out six things:
when to use it, what inputs and permissions it needs, the order of work,
how to verify results, what it returns, and which operations need my approval.

You should see: The Bot confirms the skill is saved. From then on, invoke it by name in any conversation—just say "Run the Rebuild Environment skill". The private skill library is shared across all Bots: any Bot can help you rebuild the environment. For details on saving and invoking, see 3.2 Skills and Teaching.

Step 6: Master the two playbooks—disk almost full and disconnection ​

Why: After using a dev environment for a while, two scenarios are unavoidable: a full disk and an unreachable cloud computer. The official docs have clear playbooks for both—just follow them.

Disk almost full: The Bot will report once in the chat—listing the largest files/folders and their sizes, and proposing what to delete. It won't delete anything without your approval. Low disk space is not data loss; cleanup only touches the computer's files, not the chat.

Disconnected: When you see Reconnecting or Couldn't Reach Grok Bot's Computer, the Bot cannot complete its turn. The official least-destructive order:

  1. Wait first, then click Retry (or reopen the conversation)—during reconnection Bots, files, and logins are all safe; do not Reset at this point
  2. If that doesn't work, fully quit Grok Bot and reopen it (on Mac choose Quit from the menu bar, not just closing the window), and check for app updates while you're at it
  3. If it still doesn't work, then consider Update Bot's Computer → Recover → Reset, one level at a time

You should see: the script plays out as written—disk cleanup only happens after you say "yes"; after a disconnect is recovered, resend the message once more, and the Bot can finish that turn. For the full sequence and details, see 5.1 Cloud Computer Care.

📋 Magic Prompts ​

📝 New Project Environment Setup (All in One Step) ​

Expected result: creating the directory, installing dependencies, and running a self-check all in one go, ending with an environment self-check report—getting a new project from zero to runnable on the cloud computer takes just this one message.

## Role
You are my cloud development environment administrator.
## Task
Initialize the development environment for the project [project name] on the cloud computer.
## Input Information
### Required Fields
- Project directory: /workspace/[project name]
- Dependency list: [language runtime version, libraries and version numbers]
- Verification method: [what counts as installed, e.g., which modules can be imported, which script can run]
### Optional Fields
- Reference code: [code URL to download or refer to?]
## Output Specification
Environment self-check report: check items, result (pass/fail), version or error;
For failed items, attach the full error message and fix suggestions.
## Constraints
- ✅ Put all files under /workspace/[project name]
- ✅ Paste the self-check report in the conversation, and copy the result file into the project folder
- ❌ Do not delete other existing project files in /workspace
- ❌ Ask me first before any operation that needs extra permissions

📝 Environment Self-Check Report (Verify the Environment) ​

Expected result: whenever you suspect something is off with the environment, send this to have the Bot survey the current state—versions, dependencies, files, disk, all laid out in one report.

## Role
You are my cloud development environment administrator.
## Task
Run a full environment self-check on /workspace/[project name].
## Input Information
### Required Fields
- Project directory: /workspace/[project name]
- Key dependency list: [libraries and versions that must be available]
### Optional Fields
- Focus check items: [what you're especially worried about this time, e.g., a certain dependency's version?]
## Output Specification
Self-check report: language runtime version, whether key dependencies can be imported and their version numbers,
whether project files are complete, how much disk space is left; attach error messages for abnormal items.
## Constraints
- ✅ Read-only check: don't modify files, don't install or uninstall anything
- ✅ Every result must be traceable in the terminal output
- ❌ For items that can't be checked, write "unverified", not "normal"
- ❌ If you find problems, report only—don't fix them on the spot or change any configuration

🔧 Disk-Almost-Full Confirmation (Responding to the Bot's Cleanup Proposal) ​

Expected result: when the Bot reports the disk is almost full and proposes deleting files, use this to respond—freeing up space while keeping your results safe.

## Role
You are my cloud development environment administrator, and you just reported the disk is almost full.
## Task
Execute the cleanup according to my approval, and report the results when done.
## Input Information
### Required Fields
- My approval: [which items may be deleted, which must be kept]
- Bottom line: [all project results in /workspace must be kept]
### Optional Fields
- Handle later: [items to leave alone for now and deal with later?]
## Output Specification
Cleanup results: what was deleted, the size of each, and how much space was freed;
List the items not deleted for me to handle next time.
## Constraints
- ✅ Delete only the items I named; keep everything else
- ✅ Ask me first about anything you're unsure of
- ❌ No acting first and reporting after
- ❌ If space is still not enough, stop and report—don't expand the deletion scope on your own

Checkpoints ✅ ​

  • computer preview opens, and you can see every step the Bot takes in the terminal
  • Project files are all in the project folder under /workspace; important results were copied into the workspace or attached to the conversation
  • After dependencies were installed, an environment self-check was run once—versions and importability are documented in a report
  • The "rebuild environment" skill is saved, so a different Bot can invoke it by name
  • You know both scripts by heart: when the disk is almost full, the Bot reports first and only deletes what you approve; on disconnect, wait then Retry, don't Reset

Pitfall Reminders ​

❌ Assuming the environment is done for good once dependencies are installed ​

The official docs are clear: project folders like node_modules and Python virtual environments are not included in what gets saved—they must be reinstalled after the computer is Updated, Recovered, or Reset. The right approach: run a self-check right after installing, save the process as a "rebuild environment" skill, and make reinstalling a one-command affair.

❌ Keeping important results only in a temporary directory ​

The official docs classify temporary directories, manually installed packages, and uncommitted application state as "treat as disposable". Results from an overnight run kept in a temp directory are gone with a single update. The right approach: copy result files into the project folder under /workspace, or attach them directly to the conversation—double insurance.

❌ An itchy trigger finger hitting Reset during a disconnect ​

Resetting when you see Reconnecting / Couldn't Reach Grok Bot's Computer is exactly what the official docs explicitly warn against—during reconnection, Bots, files, and logins are all safe, while Reset may lose recent changes that haven't been saved yet. The right approach: wait first, then Retry, escalating step by step to Update → Recover; Reset always comes last. For details, see 5.1 Cloud Computer Care.

❌ Using rm -rf to try to delete chat history ​

Conversation history is stored outside the cloud computer—deleting files on the computer, including with rm -rf, won't delete the chat. And vice versa: disk cleanup only touches computer files, leaving chat history unaffected. If you want the Bot to forget something, just say so in the conversation—deleting files is not the way.

Advanced Tips (Optional) ​

  • Set up auto-approval for safe commands: the official example is exactly a development scenario—"auto-approve running git status in /workspace/reports". You can have at most 20 Allow automatically rules, each no more than 1000 characters. See 3.1 Approvals and Auto Review.
  • Multi-Bot pipelines: each Bot has its own screen, and several Bots can use the browser and desktop tools in parallel—one Bot scrapes data, one runs cleaning, one runs validation, with files handed off in /workspace. See 3.5 Multi-Bot Collaboration.
  • Share one machine with bug reproduction and performance investigations: the staging login for B1 Bug Reproduction and the monitoring dashboard for B2 Performance Investigation live on the same cloud computer as your development environment—log in once and all Bots share it, no repeated setup needed.
  • Intranet repositories or dashboards won't open: the cloud computer is in the cloud and can't see your company intranet by default—open Settings → Computer → Route traffic through this computer to have the Bot use your desktop's network. See 5.3 Traffic Routing and Local Execution.

Lesson Summary ​

  • ✅ Grok Bot cloud computer = a persistent machine owned by your account: terminal, file system, and browser all included, shared by all Bots, keeps working with the lid closed
  • ✅ Put files in the project folder under /workspace—they survive updates and recovery; node_modules and virtual environments are not saved, leave reinstalling to the skill
  • ✅ Every action like running scripts or installing dependencies goes through Auto Review; terminal command cards are Allow / Skip—set up auto-approval for frequently used safe commands
  • ✅ When the disk is almost full, the Bot reports first and only deletes with your consent; on disconnect, wait then Retry—Reset always comes last
Key ItemValue in This Lesson
Workspace/workspace (persistent, shared by all Bots)
Not saved, must be reinstallednode_modules, Python virtual environments, manually installed packages
Approval cardTerminal commands: Allow / Skip + Manage settings
skill"Rebuild environment" (the official six elements, invoked by name, shared across all Bots)
Disk almost fullThe Bot reports the largest file + its size once, and deletes only with your approval
Disconnection playbookWait → Retry → Restart the app → Update → Recover → Reset (last resort)

Next lesson preview ​

The programmer track wraps up here. The next lesson shifts gears and enters the creator track: C1 Topic research. You will learn:

  • What X search can do without a connection: search public content, read posts, view mentions and quotes, check trends — read-only, no X login required
  • How to use the official efficient-conversation checklist — "link factual sources, ask for evidence" — to have the Bot do topic research, so every conclusion can be opened and verified
  • When private content (DMs, bookmarks, timeline) actually requires connecting the X plugin
gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.