Using the REPL
Load your project with zeon up, send code with zeon py, keep state between entries, stop an entry, see the result, release the instance with zeon down.
This page assumes you have installed the CLI, signed in and have a project folder (see Your first project).
Start: zeon up
cd my-project
zeon upzeon up loads the version of the project last pushed to the cloud on your cloud instance, loads its active world, and prints the link to the 3D viewer:
project: my-project (<project id>)
setup: <setup name>
world: shaker_deck
viewer: <link to the 3D viewer>
The REPL works on what is loaded, so run zeon up first. You need it once per session, again after the instance restarted, and to load another world (zeon up --world W). Open the viewer link in a browser to watch the arms; zeon open prints it again.
Send code: zeon py
zeon py 'list_objects("wellplate_stand")'['wellplate_stand_1', 'wellplate_stand_2']
zeon py sends one entry to the REPL, waits for it, and prints its output: what the code printed, then the value of its last expression, as an interactive Python session does. End the last line with ; to hide the value. A value of None prints nothing.
For more than one line, put the code in a file, or pipe it in with -f -:
zeon py -f scratch.pyzeon py -f - <<'EOF'
for name in list_anchors("wellplate_shaker"):
print(name)
EOFState stays between entries
Every entry runs in the same Python session. Variables, imports and functions you define are there for the next zeon py:
zeon py 'grasp = anchor("wellplate", "grasp_short")'
zeon py 'grasp.width'Do not rely on them after an instance restart or after zeon down. Keep code you want to reuse in a file and run it with zeon py -f.
The simulated world keeps its state too. An arm you moved, a lid you opened, an object you attached stay that way for the next entry and the next run. To start again from the saved world, run zeon up (it reloads the active world) or zeon up --world W. zeon run NAME --world W reloads the world before a run. A world reload does not move the arms: zeon reset-arms puts both back at their start position, opens the grippers and lets go of what they hold.
One entry at a time
Entries run one after another. While one runs, the next waits. If it is still waiting at its timeout, zeon py exits with code 5 and says that another entry is running.
Timeouts and stopping an entry
zeon py waits 120 seconds by default; --timeout S changes that. At the timeout the entry is interrupted and the command exits with code 5. Ctrl+C interrupts the entry too.
For long work, start a run instead: zeon run NAME --detach prints the run id and returns; zeon wait ID or zeon logs ID -f follows it.
Errors and refusals
| What happened | What you see | Exit code |
|---|---|---|
| The code raised an exception | The traceback, then error: entry N ended ... and a next: line. | 1 |
| A move could not be made | A SkillError that names the move, the target and the reason. Nothing moved. See Errors. | 1 |
| The guard refused the code | refused by the REPL guard, what was refused, and a hint. Nothing ran. | 4 |
| The instance is starting or restarting | An error that says so. Wait about a minute, run zeon up, retry. | 6 |
A refusal looks like this:
refused by the REPL guard (static): os.environ is not available
hint: ...
next: change the code to use the skill API and submit again (the refusal is logged)
All exit codes are listed under Instance commands.
Long output
zeon py shows at most 16000 characters inline, keeping the start and the end (--max-chars N; 0 for no cap). --out FILE writes all of it to a file. When output is capped without --out, the message names a temporary file that holds all of it.
See what happened
| Command | What it does |
|---|---|
| The viewer link | The simulation, live, in a browser. zeon up and zeon open print it. |
zeon snap out.png | Saves a picture of the simulation viewer (without a path, to .zeon/snaps/ in the project folder). The instance renders it; no browser needs to be open. |
zeon look TARGET | Points the viewer camera at an object id, an anchor (<holder>.<anchor>) or a preset from viewer.yaml, and highlights it. |
zeon say "TEXT" | Posts a note to the viewer's Agent panel, for someone watching. |
zeon brief | The project, the setup the instance runs, the world and its objects, each arm's state, skills and workflows with their inputs, and recent runs. |
Keep what works
When code works in the REPL, write it into a skill's robotic_code.py, then:
zeon synczeon sync pushes the change and refreshes your instance (it prints instance refreshed). skills.<id>(...) in the REPL and zeon run <id> then run the new version. Without instance refreshed in the output, run zeon up. See The development loop.
zeon py and zeon brief compare your folder with what the instance runs and print notice: lines when they differ, each naming the command that fixes it. Act on a notice before reading a result as a bug.
Finish: zeon down
zeon downReleases your instance: released instance <id>. While a run is still going, the release is refused and the instance stays yours (zeon stop ID stops it). A command you run after zeon down that needs the instance takes it again and prints a notice: line saying so.
Updated 1 day ago