Repetier-Host Documentation

G-Code Verification and Preparation

After slicing you can see the slicing result. You can rotate and inspect the whole model, a layer range or just single layers and you can visualize the travel moves. So you can check if everything is correct before printing, what can save a lot of time and money.

If everything is OK, you can save the G-Code or start the print job with this commands:

  1. Print: This will start the print job directly. If the host is connected via Repetier-Server, the G-Code is sent to the server and then the print job will start, so that you can close the host.
  2. Safe to File: Click here to save the generated G-Code on your hard drive without additional start- and endcodes, that are stored in printer settings.
  3. Save for SD Print: Here you save the G-Code for SD Print including additional start- and endcodes and job finishing commands, that are stored in printer settings. If your printer runs with Repetier-Firmware, you can save it in binary format. The SD card should be in the computer, which is significantly faster than when the SD card is in the printer. If the SD card is in the printer, you need to save the G code via the tab SD Card.
  4. Save to Server: If the host is connected to Repetier-Server, you can save the G-Code in Repetier-Server. You will get a rendered preview image and you can start the print job from the host via the Server tab or in Repetier-Server.

If you want to edit the G-Code, click Edit G-Code.

Elements of the G-Code Editor

G-Code Editor

The G-Code editor has it’s own small toolbar, where you can select the most important functions. After finishing a slice, the “G-Code” is selected. This is the code generated by the slicer. All other selections are smaller codes, which are executed depending on their intention. These codes are saved as part of your current printer configuration, when you press the save button. Only if the G-Code is selected, a file selector appears to select the place to store the data. Then you switch the printer configuration the files will change to the one stored in the this configuration!

Predefined G-Code Scripts

You have the possibility to define some G-Code scripts for start, end, run on kill, run on pause and up to 5 scripts you can use and call for whatever you want, eg. for calibration, … You can set these scripts in Printer Settings -> Scripts.

Script 1 to 5 can be selected in Manual Control. If you hover over a button, you get a note box with the title if you hover. Just click to run the script.

Start Code and End Code

The G-Code for your printer is the assembled data from “Start Code”+”G-Code”+”End Code”. So if you store or send a job, this always means these three files together. Normally this start and end codes are set in the slicer settings.

Run on Kill/Run on Pause

When sending a job to the printer you may want to kill the print or pause the job. After hitting the button, the matching script will be send to the printer. While the kill job is not so important, you might want some code for the pause case. Typical reasons for a pause are switching filament type or modifications on the printing object like adding nuts bevor enclosing it in filament. In these cases you don’t want the extruder to stay over the object. One thing you could do is move the object back with a G1 command. You can do this, because the host remembers the position, where the pause started. After you hit the continue button, the extruder will go back to the starting position. Things you shouldn’t do during pause are:

  • Home axis.
  • Redefine coordinates with G92.
  • Move the z-axis to a deeper position.

Things you can to during pause:

  • Switch between relative and absolute coordinates, e.g. for lifting extruder.
  • Move extruder.
  • Extrude filament, reset extruder position.
  • Change temperatures (these are not reset by the host).

Script 1-5

If you have some frequent task, that require some commands to be send to the printer, you can put them into these scripts. In the manual control are five commands to send these scripts to the printer. You can view and modify the scripts by right clicking on the buttons.

New / Save

With the new button you remove all content from the editor.

The save button stores the G-Code in a selectable file. All other scripts are saved as part of the current printer configuration.


Not everyone is familiar with the g-codes for 3d printer. To assist you, you can see the meaning of the current code at the bottom, if the help tab is selected. Not all commands will be displayed and some may have a different meaning on your firmware, but the most important are the same on all printers.

Visual screening

G-code editor showing single layer

When a g-code is loaded you see the filament model on the left, if not disabled. Normally higher layers hide the content of the lower layer. If you select the “Visualization” tab at the bottom of the editor you can select, which part you want to see. Default is the complete code, but you can also select a single layer or multiple layers. If you search the matching g-code, look at the status bar of the editor. It shows the layer, the row with cursor belongs to. If the current line will produce a printed line, that line will be highlighted in the preview. You can even mark a larger code range and all contained print moves will be highlighted.


You can add some host specific codes that do not get executed on the board, but inside the host when that position is reached.
This of course only works when you are printing from the host and not from sd card. All host commands start with @ or if you like
to have valid g-code with ;@ followed by command name and eventually some parameter.


The info command writes the text to the log.

@info Hello world


Plays the sound defined in preferences for the sound command.



Waits with sending g-code until the user presses the continue button. Shows the text in the info screen.

@pause My Message


Executes a file. Command should be the absolute path.

@execute command param1 param2


Tells the host the extruder is at it’s origin. You need this if you don’t have endstops to do the normal homing.


Continue with “Manual Control”