*Geometry Script* is a robust yet easy to use Python API for creating Geometry Nodes with code.
At a certain point, Geometry Node trees become unmanagably large. Creating node trees in Python enables quicker editing and reorganization of large, complex trees.
*Geometry Script* has all of the performance and capabilities of Geometry Nodes, but in a more managable format. The scripts are converted directly to Geometry Node trees making them easy to tweak for others unfamiliar with scripting.
1. Import all of the types and functions available in *Geometry Script*.
2. The `@tree(...)` decorator marks this function as a node tree builder. If you pass a name to the decorator it will use that as the name of the node tree. Otherwise, it will use the name of the function it is on. Any marked function will be built automatically when the script is run.
3. All arguments used in the function must be annotated with a type, such as `Geometry`, `Float`, `Vector`, etc. Each of these arguments is added to the *Group Input* node. They can be configured on the *Geometry Node* modifier.
4. The `cube` function maps to the *Cube* node. When you call this function, it creates that node in the tree, and returns the output socket. In this case, the output socket is stored in the variable `my_cube`.
5. Whatever is returned from the function will be connected to the *Group Output* node. You must return at least one `Geometry` type.
Blender's *Text Editor* leaves a lot to be desired. Editing scripts in an IDE like Visual Studio Code can provide a nicer experience with code completion, type hints, and more.
2. Navigate to the file, then open the sidebar (click the gear icon or press *N*) and uncheck *Make Internal*
![A screenshot of Blender's file selector with 'Make Internal' unchecked](resources/open_file.png)
3. Click *Open Text*
4. At the top of the Text Editor, enable Geometry Script's *Auto Resolve* feature. This will make sure the opened file automatically accepts any changes made in an external editor.
![A screenshot of the top of the Text Editor, with the Auto Resolve option checked](resources/auto_resolve.png)
Documentation and typeshed files are automatically generated when you install the add-on. You can find instructions for using them with your IDE in the add-on preferences.