1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

gcode-comments command-line tool (CLI)

Discussion in 'Software' started by OutsourcedGuru, Jan 7, 2018.

  1. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    139
    In case it's useful, I've created a command-line tool (CLI) in Node.js/JavaScript that will create a commented version of a GCODE file. It will add one comment per line which isn't already a one-line comment itself.

    github

    Assuming that you have Node installed on your computer, you could put this script somewhere that's in your path and then just...

    Code:
    $ gcode-comments file.gcode
    
    ;FLAVOR:RepRap
    ;TIME:11265
    ;Generated with Cura_SteamEngine 2.3.1
    M104 S205                                         ; Set extruder temperature
    M109 S205                                         ; Set extruder temperature and wait (blocking)
    
    ;LAYER_COUNT:28
    ;LAYER:0
    M107                                              ; Turn off fan
    M205 X10                                          ; Adjust jerk speed
    G1 F2400 E-1                                      ; Move and/or extrude to the indicated point
    ...
    
    Input:   file.gcode
    Output:  file_commented.gcode
    ...and it will do the rest.
     
    mark tomlinson likes this.

Share This Page