| Is this the page you were looking for?|
This is the article for ComputerCraft's primary shell, CraftOS. If you are looking for the API, see shell (API).
It is launched automatically when a given Computer, Turtle or Pocket Computer starts up, from the file /rom/programs/shell (for a time, it labelled itself as "TurtleOS" when executed on turtles - currently it calls itself "CraftOS" on all systems). It then initialises the shell API which other scripts can use to interface with it. If the first instance of CraftOS running on a system is exited, the system will shut down.
As of ComputerCraft 1.6, advanced systems launch CraftOS via the Multishell script, which enables easy multitasking (allowing the one device to run multiple programs at the same time, in different tabs). ComputerCraft 1.74 furthermore added tab-completion to the interface.
Alternate "operating systems" can either run "on top of" CraftOS, or, using a resource pack, they can replace it altogether. Many user-defined OSes can be found in the ComputerCraft forums, but note that not all are fully-functional and/or compatible with all versions of ComputerCraft.
When first starting a system, it is recommended to label it - an unlabelled computer's file system will be discarded if it is pickaxe'd and re-placed (in the case of turtles, their fuel reserves will also be lost). To check the current label of a system, enter:
To set a new label, enter:
label set <newLabel>
For example, to view a list of files on the system, enter:
You can change to a different folder by entering:
To go back a directory, enter:
To run a script file, simply enter its name. If you wish to edit a script file, use the edit command:
Note that you cannot edit the contents of the rom (Read-Only Memory) directory, nor that of Treasure Disks.
Also try the included lua script, which gives you immediate access to a Lua interpreter.