Command Line Tools

UDX CLI Tools

Powerful command-line utilities that enhance your development workflow with AI-assisted features, content processing, and intelligent operations. Our tools are designed to support Retrieval Augmented Generation (RAG) workflows, making it easier to build AI-powered applications.

RAG-Optimized Workflow

Our CLI tools are designed to work together in a Retrieval Augmented Generation (RAG) workflow:

RAG Workflow
  1. Fetch content from various sources using mcurl
  2. Process and transform the content with mq
  3. Convert to desired formats with md2html
  4. Analyze and extract components with udx.get.book
  5. Interact with AI assistants using udx and udx.sdlc

Quick Start Guide

Get started with UDX CLI tools in just a few steps:

  1. Install NPM tools: npm install -g @udx/mcurl @udx/mq
  2. Install shell tools via public gists: curl -sL https://gist.githubusercontent.com/andypotanin/udx-cli/raw/install.sh | bash
  3. Set up your OpenAI API key: export OPENAI_API_KEY="your-key"
  4. Start using tools immediately with global commands
CLI Tool

udx

A context-aware AI assistant that provides helpful commands and information based on your current development environment.

Installation

Prerequisites

Install the required dependencies first:

Terminal

# On macOS

brew install jq yq gh

# On Linux

sudo apt-get install jq yq gh xclip

Setup

Terminal

# Install via public gist (recommended)

curl -sL https://gist.githubusercontent.com/andypotanin/udx-cli/raw/install.sh | bash

# Set up your OpenAI API key

export OPENAI_API_KEY="your-api-key-here"

# Tool is now available globally as 'udx'

udx --help

Usage

The udx CLI tool provides context-aware assistance by analyzing your current directory, environment variables, and other relevant information.

Example Commands

Get environment variables

udx "give me all my env vars"

Get Docker and Git setup commands

udx "give me commands to bootstrap a docker git repo"

Set up VS Code command-line integration

udx "make VS code be callable from command line as 'code' so I can open files"

Get testing setup help

udx "give me a command to install mocha for repository and bootstrap testing of server.js: $(cat server.js)"

Key Features

Context Awareness

Analyzes your directory structure, environment, and Git repository to provide relevant assistance.

Code Analysis

Reads and analyzes code files in your current directory to provide targeted assistance.

Command Generation

Generates shell commands tailored to your specific development needs and environment.

Notebook Analyzer

udx.get.book

A Python utility that analyzes Jupyter notebooks to extract data models, views, and controllers using the MVC pattern.

Installation

Prerequisites

Install the required dependencies first:

Terminal

# Install Python dependencies

pip install pyperclip

Setup

Terminal

# Install via public gist

curl -sL https://gist.githubusercontent.com/andypotanin/udx-get-book/raw/install.py | python3

# Or install dependencies and download script

pip install pyperclip

curl -o udx.get.book https://gist.githubusercontent.com/andypotanin/udx-get-book/raw/udx.get.book.py

chmod +x udx.get.book

Usage

The udx.get.book tool analyzes Jupyter notebooks to extract different components based on the MVC pattern.

Basic Usage

Syntax

udx.get.book <notebook_path> [--model|--view|--controller]

Extract data model from a notebook

udx.get.book notebooks/analysis.ipynb --model

Extract view (visualization code) from a notebook

udx.get.book notebooks/analysis.ipynb --view

Extract controller logic from a notebook

udx.get.book notebooks/analysis.ipynb --controller

Output Options

The tool will copy the extracted content to your clipboard by default. You can also redirect the output to a file:

Save output to a file

udx.get.book notebooks/analysis.ipynb --model > model.py

Key Features

MVC Pattern Extraction

Separates notebook code into model, view, and controller components for better code organization.

Clipboard Integration

Automatically copies extracted code to clipboard for quick use in other applications.

Code Refactoring

Helps transform notebook prototypes into production-ready, modular Python code.

Git Assistant

udx.sdlc

An AI-powered tool that generates meaningful Git commit messages based on your code changes.

Installation

Prerequisites

Install the required dependencies first:

Terminal

# On macOS

brew install jq gh

# On Linux

sudo apt-get install jq gh

Setup

Terminal

# Install via public gist (recommended)

curl -sL https://gist.githubusercontent.com/andypotanin/udx-sdlc/raw/install.sh | bash

# Set up your OpenAI API key

export OPENAI_API_KEY="your-api-key-here"

# Tool is now available globally as 'udx.sdlc'

udx.sdlc --help

Usage

The udx.sdlc tool analyzes your Git changes and generates meaningful commit messages.

Basic Usage

Run the tool from within a Git repository with staged changes:

Terminal

# First stage your changes

git add .

# Then generate a commit message

udx.sdlc

# Or if you created the symlink

udx-sdlc

Workflow Example

Complete Git workflow with udx.sdlc

# Make your code changes

git add .

udx.sdlc

# The tool will generate a commit message and copy it to your clipboard

# You can now paste it directly into your git commit command

git commit -m "$(pbpaste)" # On macOS

git commit -m "$(xclip -selection clipboard -o)" # On Linux

Key Features

AI-Generated Messages

Uses OpenAI's GPT-4o to analyze code changes and generate meaningful, descriptive commit messages.

Clipboard Integration

Automatically copies generated commit messages to clipboard for quick use in your Git workflow.

Git-Aware

Analyzes your staged changes to provide context-specific commit messages that accurately describe your work.

CLI Tool

mcurl

curl but in markdown - fetches content from URLs and converts to clean, readable markdown format. Perfect for extracting content for AI processing, documentation, or content analysis. A key component in RAG workflows for high-quality data retrieval.

Installation

Prerequisites

Install the required dependencies first:

Terminal

# Node.js (v14 or higher)

# npm (comes with Node.js)

Installation Steps

Terminal

# Install globally via NPM

npm install -g @udx/mcurl

# After installation, mcurl command is available globally

# Optional: Set up configuration file

mkdir -p ~/.udx

touch ~/.udx/mcurl.yml

Usage

The mcurl CLI tool fetches content from URLs and converts it to clean, readable markdown format.

Basic Usage

Fetch and convert web content to markdown

mcurl https://udx.io

Extract specific content using CSS selector

mcurl --selector "article.main-content" https://udx.io/about

Save output to file

mcurl --output result.md https://udx.io

Use custom headers and user agent

mcurl --header "Authorization: Bearer token" --user-agent "MyBot/1.0" https://api.example.com

Key Features

Content Extraction

Intelligently extracts main content from web pages, filtering out navigation, ads, and other non-essential elements.

Format Conversion

Converts HTML to clean markdown and formats JSON responses in a structured, readable format.

Pluggable Architecture

Extensible with custom handlers for different content types and sources.

AI Integration

Designed for AI tool integration and chaining with SERP API responses for automated content processing.

CLI Tool

mq

Markdown Query - think of it as "jq for markdown" - a powerful tool for querying and transforming markdown documents. Extract, filter, and analyze markdown content with precision. Essential for the transformation phase of RAG pipelines.

Installation

Prerequisites

Install the required dependencies first:

Terminal

# Node.js (v14 or higher)

# npm (comes with Node.js)

Installation Steps

Terminal

# Install globally via NPM

npm install -g @udx/mq

# After installation, mq command is available globally

Usage

The mq CLI tool provides powerful querying and transformation capabilities for markdown documents.

Common Usage Patterns

Extract clean content without code blocks

mq --clean-content --input document.md

Analyze document structure

mq --structure --input document.md

Extract images from markdown

mq --images --input document.md

Chain with mcurl for web content processing

mcurl https://udx.io | mq --clean-content

Key Features

Clean Content Extraction

Pull narrative content without code blocks for cleaner analysis and better focus on conceptual information.

Structured Querying

Filter and transform markdown content like jq does for JSON with powerful query capabilities.

Document Analysis

Generate actionable insights and understand document structure for better content organization.

Format Conversion

Transform between JSON, markdown, and other formats for flexible integration with other tools.

CLI Tool

md2html

A lightweight markdown to HTML converter with customizable styling and template support. Perfect for generating documentation, reports, and web content from markdown files.

Installation

Prerequisites

Install the required dependencies first:

Terminal

# Node.js (v14 or higher)

# npm (comes with Node.js)

Installation Steps

Terminal

# Install via NPM (coming soon)

npm install -g @udx/md2html

# Or install via public gist

curl -sL https://gist.githubusercontent.com/andypotanin/md2html/raw/install.sh | bash

# Tool is now available globally as 'md2html'

md2html --help

Usage

The md2html CLI tool converts markdown files to HTML with customizable styling and templates.

Common Usage Patterns

Convert markdown to HTML

md2html input.md output.html

Use custom CSS styling

md2html --css styles.css input.md output.html

Apply HTML template

md2html --template template.html input.md output.html

Batch convert multiple files

md2html --batch docs/*.md --output-dir html/

Key Features

Custom Styling

Apply custom CSS styles and HTML templates to create professional-looking documents.

Batch Processing

Convert multiple markdown files at once with consistent styling and organization.

Syntax Highlighting

Built-in syntax highlighting for code blocks with support for multiple programming languages.

Responsive Output

Generates mobile-friendly HTML with responsive design patterns and clean markup.