Skip to content

hegner123/notab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notab

MCP server and CLI tool for normalizing whitespace — convert tabs to spaces or spaces to tabs.

Install

go build -o notab && codesign -s - notab
cp notab /usr/local/bin/

Usage

MCP Server

Default mode — communicates over stdin/stdout using JSON-RPC (MCP protocol).

notab

Add to Claude Code:

claude mcp add --transport stdio notab -- notab

Tool: notab

Parameter Type Required Default Description
file string yes Absolute path to the file to normalize
spaces integer no 4 Number of spaces per tab
tabs boolean no false Inverse mode: convert leading spaces to tabs

CLI

# Tabs to spaces (default)
notab --cli --file /path/to/file.go

# Custom spacing
notab --cli --file /path/to/file.py --spaces 2

# Spaces to tabs (for Makefiles, etc.)
notab --cli --file /path/to/Makefile --tabs

Exit codes

Code Meaning
0 Success
1 Error
2 No changes

Output

JSON with normalization results:

{
  "file": "/path/to/file.go",
  "replacements": 12,
  "lines_affected": 5,
  "direction": "tabs_to_spaces"
}

How it works

  • Tabs to spaces (default): Replaces all tab characters with the configured number of spaces.
  • Spaces to tabs (--tabs / tabs: true): Replaces leading space groups with tabs. Only converts complete groups at the start of lines — inline spaces are preserved.

File permissions are preserved during writes.

License

MIT

About

MCP server and CLI tool for normalizing whitespace. Convert tabs to spaces or spaces to tabs

Topics

Resources

Stars

Watchers

Forks

Contributors