JSPM

  • Created
  • Published
  • Downloads 2276
  • Score
    100M100P100Q147836F
  • License UNLICENSED

Zondax CLI

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@zondax/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Zondax CLI

    A comprehensive CLI tool for Zondax development workflows, featuring infrastructure management, CI/CD integration, and TypeScript refactoring tools.

    Installation

    npm install -g @zondax/cli
    # or
    npx @zondax/cli@latest

    Commands

    Infrastructure Management (infra)

    • cloudsql - Cloud SQL Proxy management
    • devpod - Development pod management
    • kubeconfig - Kubernetes configuration management
    • images - Container image management
    • onboard - Developer onboarding tools

    CI/CD Integration (ci)

    • checkout - GitHub App authentication and checkout

    Environment Management (env)

    • Environment variable management using GCP Secret Manager

    Model Context Protocol (mcp)

    • ts-server - TypeScript MCP server for refactoring tools

    MCP TypeScript Server

    The MCP TypeScript server provides advanced refactoring capabilities through the Model Context Protocol, enabling AI assistants like Claude to perform sophisticated TypeScript operations.

    Usage

    # Start the TypeScript MCP server
    npx @zondax/cli@latest mcp ts-server
    
    # With custom project path
    npx @zondax/cli@latest mcp ts-server -p /path/to/your/project
    
    # With verbose logging
    npx @zondax/cli@latest mcp ts-server -v
    
    # With file watching
    npx @zondax/cli@latest mcp ts-server -w

    Available MCP Tools

    The TypeScript MCP server exposes the following tools:

    rename_symbol

    Rename a symbol (variable, function, class, etc.) across the entire codebase.

    Parameters:

    • filePath: Path to the file containing the symbol
    • position: Character position of the symbol in the file
    • newName: New name for the symbol

    extract_function

    Extract selected code into a new function.

    Parameters:

    • filePath: Path to the file containing the code
    • startPosition: Start position of the code to extract
    • endPosition: End position of the code to extract
    • functionName: Name for the new function

    move_declaration

    Move a declaration (function, class, interface) to another file.

    Parameters:

    • sourceFilePath: Path to the source file
    • targetFilePath: Path to the target file
    • declarationName: Name of the declaration to move

    find_references

    Find all references to a symbol across the codebase.

    Parameters:

    • filePath: Path to the file containing the symbol
    • position: Character position of the symbol in the file

    analyze_imports

    Analyze import statements for unused imports and optimization opportunities.

    Parameters:

    • filePath: Path to specific file (optional - analyzes all files if not provided)
    • optimize: Whether to automatically optimize imports

    get_project_info

    Get information about the TypeScript project structure.

    Parameters: None

    Integration with AI Assistants

    The MCP TypeScript server can be integrated with AI assistants like Claude by configuring the MCP client to connect to the server's stdio interface. This enables the AI to perform complex refactoring operations with full TypeScript AST analysis.

    Example MCP Client Configuration

    {
      "mcpServers": {
        "zondax-typescript": {
          "command": "npx",
          "args": ["@zondax/cli@latest", "mcp", "ts-server", "-p", "/path/to/project"],
          "env": {}
        }
      }
    }

    Development

    Prerequisites

    • Node.js 20+
    • Bun 1.1+
    • TypeScript 5.8+

    Setup

    bun install

    Testing

    bun test

    Code Quality

    bun run check    # Format and lint
    bun run lint     # Lint only
    bun run format   # Format only

    Architecture

    The CLI follows a modular command structure:

    • src/cmd/ - Command definitions grouped by functionality
    • src/lib/ - Shared utilities and libraries
    • src/main.ts - Main entry point using Commander.js

    Key Libraries

    • Commander.js - CLI framework
    • ts-morph - TypeScript AST manipulation
    • @modelcontextprotocol/sdk - MCP server implementation
    • Biome - Code formatting and linting
    • Vitest - Testing framework

    License

    UNLICENSED - Proprietary to Zondax AG