npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

apex-utils-cli

v1.0.1

Published

AI-powered Apex code utilities - generate inline documentation and test classes

Downloads

5

Readme

🚀 Apex Utils CLI

A powerful Node.js CLI tool for Salesforce Apex developers that leverages AI to generate inline documentation and comprehensive test classes for your Apex code.

Version License Node

demo-1 demo-2

✨ Features

  • 🤖 Multiple AI Providers: Support for Ollama, OpenAI, Anthropic, and Groq
  • 📝 Inline Documentation: Automatically generate comprehensive JavaDoc comments
  • 🧪 Test Class Generation: Create thorough test classes following Salesforce best practices
  • 🎨 Beautiful UI: Side-by-side Monaco editor with dark theme
  • 💾 Download Options: Export both original and generated code
  • 🔄 Live Editing: Edit generated code in the browser before downloading
  • 📊 Statistics: Real-time line and character counts

📦 Installation

npm install -g apex-utils-cli 

🎯 Usage

Generate Inline Documentation

Using Ollama (Local, No API Key Required):

apex-utils inlinedoc \
  -a MyApexClass.cls \
  -m ollama \
  --model-name llama3.2

Using OpenAI:

apex-utils inlinedoc \
  -a MyApexClass.cls \
  -m openai \
  --api-key sk-your-openai-key \
  --model-name gpt-4

Using Anthropic:

apex-utils inlinedoc \
  -a MyApexClass.cls \
  -m anthropic \
  --api-key sk-ant-your-key \
  --model-name claude-sonnet-4.5-20250929

Using Groq:

apex-utils inlinedoc \
  -a MyApexClass.cls \
  -m groq \
  --api-key gsk-your-groq-key \
  --model-name mixtral-8x7b-32768

Generate Test Class

Using Ollama:

apex-utils test-class \
  -a MyApexClass.cls \
  -m ollama
apex-utils test-class -m ollama --model-name llama3.2:latest -a ~/pricesync2/force-app/main/default/classes/PriceBookSyncController.cls

Using OpenAI:

apex-utils test-class \
  -a MyApexClass.cls \
  -m openai \
  --api-key sk-your-openai-key \
  --model-name gpt-4-turbo

Using Groq

apex-utils test-class -m groq --model-name openai/gpt-oss-20b  --api-key key  -a ~/pricesync2/force-app/main/default/classes/PriceBookSyncController.cls  

📋 Command Reference

Global Options

| Option | Alias | Description | Required | |--------|-------|-------------|----------| | --apex <file> | -a | Path to Apex class file | ✅ | | --model <provider> | -m | AI provider (ollama, openai, anthropic, groq) | ✅ | | --api-key <key> | | API key (not needed for Ollama) | ⚠️ | | --model-name <name> | | Specific model name | ❌ | | --ollama-url <url> | | Ollama server URL (default: http://localhost:11434) | ❌ |

Commands

inlinedoc

Generates comprehensive inline documentation with JavaDoc comments for classes, methods, and important code blocks.

test-class

Generates a complete test class with:

  • Positive and negative test scenarios
  • Bulk test cases
  • Proper test data setup
  • Comprehensive assertions
  • High code coverage focus

🤖 Supported AI Models

Ollama (Local - Free)

  • Default: llama3.2
  • Others: codellama, llama2, mistral, etc.
  • Setup: Install Ollama from ollama.ai

OpenAI

Anthropic

  • Recommended: claude-sonnet-4.5-20250929
  • Others: claude-opus-4.1, claude-sonnet-4
  • API Key: Get from console.anthropic.com

Groq

  • Recommended: mixtral-8x7b-32768
  • Others: llama2-70b-4096, gemma-7b-it
  • API Key: Get from console.groq.com

🖥️ HTML Viewer Features

The tool automatically opens a beautiful web interface with:

  • Dual Monaco Editors: Side-by-side comparison
  • Dark Theme: Easy on the eyes
  • Synchronized Scrolling: Navigate both files together
  • Syntax Highlighting: Full Apex language support
  • Editable Output: Modify generated code before downloading
  • Statistics: Live line and character counts
  • Download Buttons: Export original or generated code
  • Responsive Design: Works on any screen size

📝 Example Workflow

  1. Start with an Apex class:
public class AccountController {
    public static List<Account> getAccounts() {
        return [SELECT Id, Name FROM Account LIMIT 10];
    }
}
  1. Generate inline docs:
apex-utils inlinedoc -a AccountController.cls -m ollama
  1. Review in browser - The tool opens an HTML viewer automatically

  2. Download documented version - Click "Download Generated"

  3. Generate tests:

apex-utils test-class -a AccountController.cls -m ollama
  1. Download test class - Get AccountControllerTest.cls

🔒 Security Notes

  • API keys are passed via command line (use environment variables in production)
  • Never commit API keys to version control
  • Use .env files for sensitive data (not included in this basic version)
  • Ollama runs locally, keeping your code private

📄 License

MIT License - feel free to use this tool in your projects!

Happy Coding! 🎉 If you find this tool helpful, let the author knows about it!