Skip to content

Locksmith CLI

A developer first CLI for incorporating auth infrastructure to your AI applications

Version License: MIT

Locksmith is a powerful CLI tool that helps developers quickly integrate enterprise-grade authentication into their AI applications. It supports modern auth providers, generates secure configurations, and integrates with popular LLM tools for seamless development.

Terminal window
# should have node latest table
# should have either of claude or cursor-agent or gemini
npx locksmith generate
  • Node.js 16+ and npm/pnpm
  • Access to authentication provider (ScaleKit recommended)
Terminal window
npm install -g locksmith-cli
# or
pnpm add -g locksmith-cli
Terminal window
locksmith --version
locksmith --help
  1. Initialize your project:

    Terminal window
    locksmith init
  2. Configure LLM broker:

    Terminal window
    locksmith configure llm
  3. Add authentication modules:

    Terminal window
    locksmith add
  4. Generate configurations:

    Terminal window
    locksmith generate

Initialize authentication in your project with an interactive setup wizard.

Terminal window
# Interactive setup (recommended)
locksmith init
# Non-interactive setup (ScaleKit only)
locksmith init --provider=scalekit --environment-id=your-env-id --client-id=your-client-id --client-secret=your-secret --environment-url=https://your-env.scalekit.cloud

Flags:

  • --provider, -p - Authentication provider (scalekit, auth0, fusionauth)
  • --environment-id, -e - ScaleKit environment ID
  • --client-id, -c - ScaleKit client ID
  • --client-secret, -s - ScaleKit client secret
  • --environment-url, -u - ScaleKit environment URL
  • --interactive, -i - Force interactive mode
  • --no-interactive, -I - Skip interactive prompts

Configure authentication settings, LLM brokers, and preferences.

Terminal window
# Configure LLM broker
locksmith configure llm --broker=claude
# Configure authentication provider
locksmith configure auth --provider=scalekit
# Interactive configuration
locksmith configure

Subcommands:

  • llm - Configure preferred LLM broker (claude, gemini, cursor-agent)
  • auth - Configure authentication provider settings

Flags:

  • --broker, -b - LLM broker (claude, gemini, cursor-agent)
  • --provider, -p - Authentication provider
  • --interactive, -i - Force interactive mode

Add authentication providers and modules to your project.

Terminal window
# Interactive module selection
locksmith add
# Add specific module
locksmith add --module=full-stack-auth
# Add multiple modules
locksmith add --module=full-stack-auth --module=sso

Available Modules:

  • full-stack-auth - Complete authentication system
  • sso - Enterprise SSO integration
  • mcp - Model Context Protocol authentication

Flags:

  • --module - Authentication module to add
  • --interactive, -i - Force interactive mode

Generate secure authentication configurations and integrate with LLM tools.

Terminal window
# Generate with all configured modules
locksmith generate
# Generate specific module
locksmith generate --module=full-stack-auth
# Generate with custom output
locksmith generate --format=yaml --output=./config/auth.yaml
# Save prompt for review
locksmith generate --prompt-out=./prompt.txt

Flags:

  • --module - Specific module to generate
  • --format, -F - Output format (json, yaml, env)
  • --output, -o - Output file path
  • --count, -n - Number of configurations to generate
  • --prompt-out - Save generation prompt to file
  • --verbose, -v - Show detailed output
  • --dry-run, -d - Show what would be done
  • --help, -h - Show help message
  • --version, -v - Show version number
  • --verbose, -v - Enable verbose output
  • --dry-run, -d - Show what would be done without making changes
  • --force, -f - Skip confirmation prompts
  • --interactive, -i - Force interactive mode
  • --no-interactive, -I - Skip interactive prompts

Enterprise-grade authentication for AI applications with full support for:

  • SSO and multi-tenant authentication
  • Custom auth flows
  • Production-ready security

Setup:

Terminal window
locksmith init --provider=scalekit

Support for Auth0 and FusionAuth is planned for future releases.

Locksmith integrates with popular LLM tools to generate authentication code:

Terminal window
locksmith configure llm --broker=claude
locksmith generate --module=full-stack-auth
Terminal window
locksmith configure llm --broker=gemini
locksmith generate --module=sso
Terminal window
locksmith configure llm --broker=cursor-agent
locksmith generate --module=mcp

Credentials are securely stored in ~/.locksmith/credentials.json:

{
"provider": "scalekit",
"environmentId": "your-env-id",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"environmentUrl": "https://your-env.scalekit.cloud"
}
  • ~/.locksmith/credentials.json - Authentication credentials
  • ~/.locksmith/config.json - CLI preferences and settings
  • ~/.locksmith/llm-brokers.json - LLM broker configurations
Terminal window
# 1. Initialize with ScaleKit
locksmith init
# 2. Configure Claude as LLM broker
locksmith configure llm --broker=claude
# 3. Add authentication modules
locksmith add --module=full-stack-auth --module=sso
# 4. Generate configurations
locksmith generate --format=json --output=./auth-config.json
Terminal window
# Non-interactive setup for CI
locksmith init \
--provider=scalekit \
--environment-id=$SCALEKIT_ENV_ID \
--client-id=$SCALEKIT_CLIENT_ID \
--client-secret=$SCALEKIT_CLIENT_SECRET \
--environment-url=$SCALEKIT_ENV_URL \
--no-interactive
# Generate configs in CI
locksmith generate --format=env --output=.env.auth
Terminal window
# Quick setup for development
locksmith init --interactive
# Generate and review prompt
locksmith generate --prompt-out=./auth-prompt.txt --dry-run
# Generate with verbose output
locksmith generate --verbose --module=full-stack-auth
  • ScaleKit authentication provider integration
  • Interactive CLI setup wizard
  • LLM broker integration (Claude, Gemini, Cursor Agent)
  • Multiple authentication modules
  • Secure credential management
  • JSON/YAML/ENV output formats
  • Auth0 provider integration
  • FusionAuth provider integration
  • Advanced SSO configurations
  • Docker container support
  • Web dashboard for configuration
  • Plugin system for custom providers
  • Multi-environment support
  • Audit logging
  • Backup/restore functionality

We welcome contributions! Please see our Contributing Guide for details.

Terminal window
# Clone the repository
git clone https://github.com/Saif-Shines/locksmith.git
cd locksmith
# Install dependencies
pnpm install
# Run in development
pnpm start --help
# Run tests
pnpm test

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by Saif Ali Shaik