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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sf-user-manager

v1.0.0

Published

Salesforce User Management CLI with Web UI - Salesforce CLI Integration

Readme

Salesforce User Manager CLI

A powerful Node.js CLI tool with a modern web interface for managing Salesforce user creation in bulk using real Salesforce CLI commands.

Features

  • 🎨 Dark-themed UI with Tailwind CSS
  • 📊 Three-pane layout with resizable splitters
  • Bulk user selection with checkboxes
  • 🔄 Real-time status updates and logging
  • 🚀 Real Salesforce CLI integration for user creation
  • 📝 CSV import with optional and required fields (command-line or UI upload)
  • 💾 Export status and logs to CSV and TXT files
  • ✔️ User verification to check created users
  • 🔍 Duplicate detection before creation
  • 💡 Persistent user IDs after creation

Screenshots

User Management

Installation


npm install -g  sf-user-manager

Prerequisites

  • Node.js v14 or higher
  • Salesforce CLI installed and configured (sf command available)
  • Authenticated Salesforce org with sf org login web or similar
  • Proper permissions to create users in target org

Usage

# Basic usage with CSV file
sf-user-mgr -o your-org-username -i users.csv

# Start without CSV (upload from UI)
sf-user-mgr -o your-org-username

# Custom port
sf-user-mgr -o your-org-username -i users.csv -p 8080

CSV Format

Required Columns

  • username - Email-format username for the user (example: [email protected])
  • email - Email address

Optional Columns (with defaults)

  • firstName - First name (default: extracted from username)
  • lastName - Last name (default: extracted from username or "User")
  • alias - User alias (default: first 8 chars of username)
  • timeZoneSidKey - Timezone (default: "America/New_York")
  • localeSidKey - Locale (default: "en_US")
  • emailEncodingKey - Email encoding (default: "UTF-8")
  • languageLocaleKey - Language (default: "en_US")

Example CSV

username,email,firstName,lastName,alias,timeZoneSidKey,localeSidKey,emailEncodingKey,languageLocaleKey
[email protected],[email protected],John,Doe,jdoe,America/New_York,en_US,UTF-8,en_US
[email protected],[email protected],Jane,Smith,jsmith,America/Los_Angeles,en_US,UTF-8,en_US
[email protected],[email protected],Bob,Johnson,bjohnson,America/Chicago,en_US,UTF-8,en_US
[email protected],[email protected],Alice,Williams,awilliam,America/Denver,en_US,UTF-8,en_US
[email protected],[email protected],Charlie,Brown,cbrown,America/New_York,en_US,UTF-8,en_US

Minimal CSV (using defaults)

username,email
[email protected],[email protected]
[email protected],[email protected]

UI Layout

Left Pane: User List (30% width, resizable)

  • View all users from CSV with detailed information
  • CSV Upload Button - Upload a new CSV file to replace current users
  • Select individual users via checkboxes
  • "Select All" option for bulk selection
  • Real-time status indicators:
    • ⏳ Pending (gray)
    • ⚙️ Processing (blue, pulsing)
    • ✅ Success (green) with Salesforce User ID
    • ❌ Error (red) with error message
  • Display user details: username, email, first name, last name, alias

Center Pane: Configuration (40% width, resizable)

  • Profile Selection (Required)
    • Dropdown populated from target org
    • Must be selected before user creation
  • License Information (Info only)
    • Shows available licenses
    • Displays remaining capacity
    • License is actually determined by Profile
  • Selection Summary
    • Count of selected users
    • Count by status (pending, success, error)
  • Action Buttons
    • Create Selected Users (with confirmation)
    • Verify Created Users (queries Salesforce)
  • Download Options
    • 📊 Download User Status (CSV) - Export all users with status, IDs, and errors
    • 📜 Download Logs (TXT) - Export complete log history with commands

Right Pane: Status & Logs (30% width, resizable)

  • Real-time log stream with timestamps
  • Color-coded messages:
    • 🔵 Info (blue)
    • 🟢 Success (green)
    • 🔴 Error (red)
  • Shows executed Salesforce CLI commands for transparency
  • Auto-scroll to latest logs
  • Clear logs button
  • Shows up to 100 most recent log entries

Resizable Splitters

  • Drag the vertical dividers between panes to resize
  • Minimum width of 200px per pane
  • Customizable layout for your workflow preferences

Command Line Options

| Option | Alias | Description | Required | |--------|-------|-------------|----------| | --org | -o | Salesforce org username or alias | Yes | | --input | -i | Path to input CSV file | No* | | --port | -p | Web server port (default: 3000) | No |

*The -i option is now optional. You can start the tool without a CSV and upload one through the UI.

How It Works

Salesforce Commands

  1. Query Profiles:

    sf data query -q "SELECT Id, Name FROM Profile ORDER BY Name" -o <org> -r csv
  2. Query Licenses:

    sf data query -q "SELECT Id, Name, Status, TotalLicenses, UsedLicenses FROM UserLicense WHERE Status = 'Active'" -o <org> -r csv
  3. Check User Exists:

    sf data query -q "SELECT Id, Username FROM User WHERE Username='<username>'" -o <org> -r csv
  4. Create User:

    sf data create record -s User -v "Username=<username> Email=<email> FirstName=<firstName> LastName=<lastName> Alias=<alias> ProfileId=<profileId> TimeZoneSidKey=<tz> LocaleSidKey=<locale> EmailEncodingKey=<encoding> LanguageLocaleKey=<lang>" -o <org> --json
  5. Verify User:

    sf data query -q "SELECT Id, Username, IsActive, Profile.Name FROM User WHERE Id='<userId>'" -o <org> -r csv

User Creation Flow

  1. Load CSV file (via command-line -i option or upload through UI)
  2. Query Salesforce for available Profiles and Licenses
  3. User selects which users to create and which Profile to assign
  4. For each selected user:
    • Check if user already exists (duplicate detection)
    • Create user using sf data create record command
    • Capture Salesforce User ID from response
    • Update status in real-time
  5. Optionally verify all created users
  6. Download status report (CSV) or logs (TXT) for record-keeping

Features in Detail

CSV Upload

  • Upload CSV files directly from the web interface
  • Replace current user list with newly uploaded data
  • No need to restart the application
  • Validates CSV format before processing
  • Shows current loaded CSV filename in header

Download Options

  • User Status CSV: Exports username, email, name, alias, status, User ID, and error messages
  • Logs TXT: Exports timestamped logs with all executed Salesforce CLI commands
  • Files include timestamps in filename for easy organization
  • Perfect for audit trails and record-keeping

Duplicate Detection

Before creating each user, the tool checks if a user with that username already exists in the org. If found, it skips creation and logs an error.

Error Handling

  • Invalid CSV format
  • Missing required fields
  • Salesforce CLI errors
  • Network issues
  • Insufficient permissions
  • All errors are logged with details and exact commands executed

Real-time Updates

  • Status updates every 2 seconds during processing
  • Logs refresh automatically
  • Processing animation on active operations
  • Disabled checkboxes during processing
  • Command visibility in logs for debugging

User Experience

  • Confirmation dialog before creating users
  • Progress indication during bulk operations
  • Detailed error messages for troubleshooting
  • Success confirmation with Salesforce IDs
  • Browser auto-opens on startup
  • No page refresh needed - fully interactive SPA

Common Salesforce TimeZones

  • America/New_York - Eastern Time
  • America/Chicago - Central Time
  • America/Denver - Mountain Time
  • America/Los_Angeles - Pacific Time
  • America/Phoenix - Arizona
  • Europe/London - GMT
  • Europe/Paris - CET
  • Asia/Tokyo - JST

Troubleshooting

"SF CLI Error" messages

  • Ensure Salesforce CLI is installed: sf --version
  • Verify org is authenticated: sf org list
  • Check permissions to create users
  • Review executed commands in the logs pane

"User already exists"

  • Use the verify button to check existing users
  • Update CSV to remove duplicates
  • Download status CSV to identify which users already exist

"Profile is required"

  • Select a profile from the dropdown before clicking create

No profiles/licenses loaded

  • Verify org authentication
  • Check network connectivity
  • Ensure proper permissions

CSV upload fails

  • Check CSV format (must have username and email columns)
  • Ensure file is valid CSV format
  • Check browser console for detailed error messages

Security Notes

  • Users are created with the fields provided
  • No default password is set (users must reset on first login)
  • Ensure CSV files with user data are kept secure
  • Validate target org before running bulk operations
  • Downloaded status files contain sensitive user information - handle appropriately
  • Uploaded CSV files are temporarily stored and immediately deleted after processing

License

MIT (c) Mohan Chinnappan