Skip to content

deevus/neutils

Repository files navigation

neutils

Modern CLI utilities for everyday developer tasks.

urlparse demo

Philosophy

  • Each tool does one thing well
  • Instant startup, minimal memory
  • Consistent interface

Installation

From source

Requires Zig 0.15.x. Zig 0.16+ currently not supported due to breaking changes.

git clone https://github.com/deevus/neutils
cd neutils
zig build --release=small

Binaries in zig-out/bin/.

Pre-built binaries

Download from GitHub Releases for Linux, macOS, and Windows (x86_64 and aarch64).

npm

Tools listed with an npm package below can be installed globally or run on demand, e.g.:

npm i -g @neutils/og-check
# or
npx @neutils/og-check https://example.com

Tools

Tool Description npm
urlparse Parse and display URL components @neutils/urlparse
urlencode Percent-encode a string for use in URLs @neutils/urlencode
mbox-diff Find new emails between two mbox files
mbox-index Build an index of an mbox file by message identifier
mbox-gen Generate synthetic mbox files for testing
og-check Fetch a URL and render its OpenGraph / Twitter Card metadata @neutils/og-check

Usage

urlparse

# Default: rendered markdown on a TTY, raw markdown when piped
urlparse "https://user:pass@example.com:8080/path?q=1&lang=en#top"

# JSON output
urlparse --output-format json "https://example.com/api?page=2"
{
  "scheme": "https",
  "host": "example.com",
  "path": "/api",
  "query": "page=2",
  "queryParams": {
    "page": "2"
  }
}
# Markdown table output
urlparse --output-format markdown "https://example.com/api?page=2"

# Extract a single field
urlparse --field host "https://example.com/path"

urlencode

urlencode "hello world"
# hello%20world

urlencode "price=10&currency=€"
# price%3D10%26currency%3D%E2%82%AC

mbox-diff

Compare two mbox files and output only the new messages (by Message-ID) from the second file that don't exist in the first.

# Write new emails to a file
mbox-diff base.mbox new.mbox -o diff.mbox

# Example: sync a mailbox incrementally
mbox-diff yesterday.mbox today.mbox -o new-messages.mbox

mbox-index

Build an index mapping message identifiers to byte offsets. Messages without a Message-ID header are keyed by the SHA-256 of their contents.

# Write index next to the mbox (mail.mbox → mail.mbox-index)
mbox-index mail.mbox

# Write index to an explicit location
mbox-index -o mail.idx mail.mbox

mbox-gen

Generate synthetic mbox files for testing and benchmarking.

# Generate a 100 MB mbox
mbox-gen --size 100M out.mbox

# Reproducible 1 GiB fixture with larger message bodies
mbox-gen --size 1GiB --seed 42 --body-size 4096 fixture.mbox

# Simulate missing Message-IDs on 20% of messages
mbox-gen --size 10M --with-id-ratio 0.8 partial.mbox

og-check

Fetch a URL and render its OpenGraph / Twitter Card metadata. Useful for checking how a page will look when shared on social media.

# Rendered OpenGraph preview (default)
og-check https://github.com/deevus/neutils

# Twitter Card preview (falls back to og:* when twitter:* are absent)
og-check -o twitter https://github.com/deevus/neutils

# All meta tags as a table, grouped by namespace
og-check -o table https://github.com/deevus/neutils

# JSON for piping into other tools
og-check -o json https://github.com/deevus/neutils

Development

# Use mise for tooling
mise install

# Build all tools
zig build

# Build single tool
zig build urlparse

License

MIT

About

Modern CLI utilities for everyday developer tasks, written in Zig

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors