Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CLINT (CLI Navigator Tooklit): A tool for DevRel/DX folks working on CLI-based products. It allows you to get a clear view of their structure and 'replicate' CLI tools to create proposals to share with your team

License

Notifications You must be signed in to change notification settings

funnierinspanish/clint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLINT: CLI Navigator Toolkit

A Command Line Tool that helps you analyze, visualize, and navigate CLI applications with ease.

Note: This project has been developed for CLI apps that use the Cobra framework —initially. More to come soon.

CLINT is a complete rewrite and enhancement of cli-explorer-toolchain_legacy, built from the ground up in Rust for better performance and reliability (and because 🦀).

This is a WiP project. Several things work, but not everything is fully implemented yet.

Quick Start

Installation

Option 1: Quick Install (Recommended)

Install CLINT with a single command using our installation script:

# Download and install the latest release
curl -sSL https://raw.githubusercontent.com/funnierinspanish/clint/main/install.sh | bash

The script will:

  • Automatically detect your platform and architecture
  • Download the latest release from GitHub
  • Install CLINT to ~/.local/bin/
  • Provide instructions to add it to your PATH

Do Not run random scripts from the internet without inspecting them first!

https://raw.githubusercontent.com/funnierinspanish/clint/refs/heads/main/install.sh

# Download the script, inspect it, then run
curl -sSL https://raw.githubusercontent.com/funnierinspanish/clint/main/install.sh -o install.sh
cat install.sh  # Review the script
chmod +x install.sh
./install.sh

Option 2: Install from source with Cargo

# Install directly from the Git repository
cargo install --git https://github.com/unjs/clint.git

# Verify installation
clint --version

Option 3: Build from source

# Clone the repository
git clone https://github.com/unjs/clint.git
cd clint

# Build the project
cargo build --release

# Add to PATH or use directly
./target/release/clint --version

First Run

No setup required! CLINT works out of the box:

# Parse a CLI tool - creates data automatically
clint parse hugo

# Start web interface - downloads templates on first run
clint serve

On first use of the serve command, CLINT will:

  • Detect if web templates are missing
  • Offer to download them automatically from GitHub
  • Fall back to embedded templates if download fails
  • Provide manual template download instructions if needed

Optional: Manual Template Download

# Download web interface templates manually (optional)
clint get-template

Basic Usage

# Parse a CLI tool and extract its structure
clint parse git

# Serve an interactive web interface
clint serve

# Serve a specific JSON file on a custom port
clint serve --input my-cli-structure.json --port 9000

# Extract keywords from a parsed CLI
clint unique-keywords

# Generate a statistical summary
clint summary

# Replicate a CLI structure in Rust
clint replicate my-cli-structure.json --output ./replica

Commands Reference

Usage: clint [COMMAND]

Commands:
  parse            Parse a CLI program and generate JSON structure
  get-template     Download web interface templates to ~/.config/clint
  serve            Start HTTP server for interactive CLI exploration
  unique-keywords  Extract unique keywords from parsed CLI data
  summary          Generate statistical summary of CLI structure
  replicate        Generate Rust code replica using clap library
  help             Print help information

Options:
  -h, --help     Print help
  -V, --version  Print version

Serve Command Options

The serve command offers flexible options for exploring CLI data with automatic template management:

# Interactive mode - choose from detected CLI apps
clint serve

# Serve specific file with default port (8899)
clint serve --input path/to/cli-structure.json

# Use custom port
clint serve --port 3000

# Use custom template
clint serve --template my-theme

# Combine options
clint serve --input app.json --port 8080 --template dark

Features

CLI Structure Analysis

Recursively analyzes CLI tools by parsing their help output, extracting comprehensive information about:

  • Commands and subcommands hierarchy
  • All available flags (short and long forms)
  • Usage patterns and descriptions
  • Command depth and relationships

Data Export & Analysis

Generate detailed reports in multiple formats:

  • JSON: Structured data for programmatic use
  • Markdown: Human-readable documentation
  • Plain Text: Simple text summaries

Export types:

  • Complete Structure: Full CLI hierarchy with all details
  • Keywords Summary: Unique commands, subcommands, and flags
  • Statistical Summary: Counts and metrics about the CLI

Interactive Web Interface

Built-in HTTP server with a modern web interface featuring:

  • Interactive Navigation: Browse CLI structure visually
  • Search & Filter: Find commands and flags quickly
  • Template System: Customizable themes and layouts
  • Hot Reloading: Instant updates during development

Smart Serving Options

Flexible serving modes:

  • Interactive Selection: Choose from automatically detected CLI apps
  • Direct File Serving: Serve specific JSON files directly
  • Custom Port Selection: Use any available port (default: 8899)
  • Template Customization: Switch between different themes

CLI Replication

Generate working Rust code replicas using the clap library:

  • Complete command structure recreation
  • Placeholder implementations for rapid prototyping
  • Developer Experience (DX) experimentation platform

Schema Support

The CLI structure JSON files generated by clint are validated against well-defined schemas:

  • JSON Schema (<cli_framework>.cli_structure.schema.json): Standard JSON Schema for general validation and documentation
  • Zod Schema (<cli_framework>.cli_structure.zod.ts): TypeScript/JavaScript runtime validation with full type safety

Both schemas support enhanced metadata including:

  • depth: Command nesting level (0 for root, 1+ for subcommands)
  • command_path: Full command path (e.g., "my_cli open socket all")
  • Optional description field to handle CLI parsing edge cases

Template Management

  • Auto-download: On first run, CLINT will offer to download web templates from GitHub
  • Fallback: If templates are missing or download fails, embedded templates are used automatically
  • No interruption: The server always starts successfully regardless of template status
  • Customization: Downloaded templates can be customized in ~/.config/clint/templates/

Troubleshooting

Template Download Issues

If automatic template download fails:

  • Run clint get-template
  • Download the files from GitHub to ~/.config/clint/templates/default/

About

CLINT (CLI Navigator Tooklit): A tool for DevRel/DX folks working on CLI-based products. It allows you to get a clear view of their structure and 'replicate' CLI tools to create proposals to share with your team

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published