Skip to content
0ndrecPublic

About

Terminal NC/G-code editor and toolkit for CNC programmers.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

nctab

Terminal NC/G-code editor and toolkit for CNC programmers.

CI PyPI PyPI Downloads Python License: MIT uv Ruff

nctab demo

Features

  • TUI editor with a tool-section outline, file browser, live word/modal-state inspector, find & replace with preview, bookmarks, snippets and a command palette.
  • Safe by default — every transform prints a diff and writes nothing unless you pass -i / -o. Writes are atomic; --backup keeps a .bak.
  • Exact arithmetic — Decimal throughout; untouched lines round-trip byte for byte.
  • Transforms — renumber, strip, case, shift, scale, mirror, rotate, address math, feed/speed scaling, limited to a line, block or tool range.
  • Analysis — stats, tool list, 21 validation rules, NC-aware diff.
  • Machine profiles for Fanuc (mill/turn), Haas, Siemens ISO and generic ISO, plus your own TOML profiles.
  • CI-friendly — versioned --json output and meaningful exit codes.

Installation

Requires Python 3.13+.

uv tool install nctab      # or: pipx install nctab
# one-off, without installing:
uvx nctab --help

Optional DNC/serial support: uv tool install "nctab[dnc]".

Quick start

nctab part.nc                              # open the editor
nctab stats part.nc                        # summary: axes, codes, tools, feeds
nctab check part.nc --strict               # validate; non-zero exit on problems
nctab shift part.nc --z -0.02              # preview the change as a diff
nctab shift part.nc --z -0.02 -o part_z.nc # write it
nctab diff --ignore-n old.nc new.nc        # compare ignoring block numbers

Documentation

Guide Contents
Editor Layout, key bindings, find & replace
CLI reference All commands, ranges, JSON output, exit codes
Configuration Config layers, machine profiles, snippets
Architecture Package layout and design rules
Development Setup, testing, releasing

Contributing

Contributions are welcome — please read CONTRIBUTING.md and the Code of Conduct. Security issues: see SECURITY.md. Changes are tracked in CHANGELOG.md.

License

MIT © 0ndrec

About

Terminal NC/G-code editor and toolkit for CNC programmers.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages