AuthMe VS Code ExtensionVS Code extension for handling AuthMe authentication and project setup for Salesforce development. Works WithThis extension works seamlessly with the Salesforce Dev Pack extension, which provides additional development tools and utilities for Salesforce. The Dev Pack is automatically recommended when you install AuthMe. FeaturesCore Features
Developer Tooling (New in 0.2.0)
InstallationInstall the extension from the VS Code marketplace by searching for "AuthMe".
Org Context & Copilot IntegrationThe extension generates and maintains an org context that enhances GitHub Copilot's understanding of your Salesforce org. This context includes:
GitHub Copilot Customization FrameworkThe extension provides a comprehensive GitHub Copilot customization framework following GitHub's official guidelines for custom instructions and agents. This framework is designed to be extensible and Salesforce-specific. Framework Architecture
InstructionsRepository-Wide Instructions (
|
| File | Applies To | Purpose |
|---|---|---|
apex-classes.instructions.md |
force-app/**/classes/** |
Service classes, security, bulkification |
test-classes.instructions.md |
force-app/**/classes/**/*Test*.cls |
Testing guidelines, schema validation |
triggers.instructions.md |
force-app/**/triggers/** |
Trigger framework patterns, handler best practices |
lwc.instructions.md |
force-app/**/lwc/** |
Component architecture, LDS, accessibility |
aura.instructions.md |
force-app/**/aura/** |
Aura component patterns |
objects.instructions.md |
force-app/**/objects/** |
Object/field schema guidelines |
flows.instructions.md |
force-app/**/flows/** |
Flow development best practices |
Custom Agents
The extension generates GitHub Copilot Custom Agents (.agent.md files) that provide specialized AI assistance for different tasks. Agents can use specific tools and hand off work to other agents.
Available Agents
| Agent | Category | Tools | Description |
|---|---|---|---|
| code-review | Quality | shell, read | Comprehensive code reviews with SF Code Analyzer integration |
| test-writer | Testing | read, edit, shell | Apex test class generation with coverage analysis |
| doc-generator | Documentation | read, edit | ApexDoc and inline documentation generation |
| security-auditor | Security | read, search | CRUD/FLS, SOQL injection, and sharing rule audits |
| planner | Planning | read, search | Task breakdown and implementation planning |
| bug-fix | Quality | read, edit, search, shell | Systematic bug diagnosis and fixes |
| cleanup | Quality | read, edit, search | Code cleanup, unused code removal, standardization |
| apex-developer | Development | read, edit, search, shell | Full Apex development workflows |
| lwc-developer | Development | read, edit, search, shell | LWC component development |
Agent Tools Reference
| Tool | Purpose |
|---|---|
read |
Read files from the workspace |
edit |
Create or modify files |
search |
Search across the codebase |
shell |
Run terminal commands (SF CLI, etc.) |
web |
Fetch external documentation |
todo |
Manage task lists |
Using Agents
In GitHub Copilot Chat, you can invoke agents by name:
@code-review Review the AccountService class for security issues
@test-writer Create comprehensive tests for ContactTriggerHandler
@apex-developer Create a batch class to update all Account records
Agents automatically hand off to related agents when appropriate:
code-review→security-auditor,test-writertest-writer→code-reviewapex-developer→test-writer,code-review
Benefits
- Context-Specific: Right guidance appears for the file type you're working on
- Dynamic Content: Instructions include actual project metadata and org information
- Version Tracking: Smart updates that preserve user customizations
- Configurable: Enable/disable different instruction types via settings
- Extensible: Framework designed for easy addition of new agents and instructions
The org context is automatically refreshed based on the authme.org.cacheExpirationDays setting, or can be manually refreshed using the Authme: Refresh Org Context command.
Developer Tooling
The extension automatically sets up a complete development environment with best-practice configurations:
EditorConfig
Automatically generates .editorconfig to ensure consistent code formatting across your team:
- Apex files: 4-space indentation
- LWC (JS/HTML/CSS): 2-space indentation
- Aura components: 2-space indentation
- Metadata files: 2-space indentation
- UTF-8 encoding, LF line endings, trim trailing whitespace
VS Code Tasks (25+ Operations)
Access via Cmd+Shift+P > Run Task or keyboard shortcuts:
Deployment
- Deploy Source to Org
- Deploy This Source File
- Validate Deployment
- Quick Deploy
Testing
- Run All Apex Tests (with coverage)
- Run Apex Test Class
- Run This Apex Test Class
- Get Apex Test Coverage
Code Quality
- Run Code Analyzer (all files or current file)
- Format with Prettier (all files or current file)
LWC
- Generate Component
- Run Jest Tests / Coverage
Org Management
- Open Default Org
- List All Orgs
- Display Org Info
Code Snippets
Type these prefixes for instant code templates:
Apex
testclass→ Full test class with @TestSetup and success/failure testsbatchclass→ Database.Batchable implementationtriggerhandler→ Complete trigger handler with all contextsserviceclass→ Service class with sharingtestfactory→ Test data factory methodsoqlsafe→ SOQL with security and error handlingdmlpartial→ DML with partial success handling
LWC
lwccomponent→ Component JavaScript boilerplatelwcwire→ Wire adapter with error handlinglwcevent→ Event handler methodlwccustomevent→ Custom event dispatchlwctest→ Jest test templatelwchtml→ HTML template with lightning-card
Enhanced Settings
Automatically configured:
- Search Optimization: Excludes
.authme,.sfdx,.sf,.localdevserver,apex_logs,test-resultsfrom search - File Associations: Auto-detects Apex (
.cls,.trigger), SOQL, SOSL, Visualforce syntax - Salesforce Extensions: Disables push-on-save, enables SObject refresh on startup
Configuration
The extension provides the following configuration options:
General Settings
authme.workspace.path: Path to your Salesforce DX workspace folder
Org Context Settings
authme.org.autoContext: Automatically build org context when setting up new projects (Default: true)authme.org.cacheExpirationDays: Number of days after which the org metadata cache expires (1-30 days, Default: 7)
Copilot Instructions Settings
authme.copilot.autoSetup: Automatically setup Copilot instructions when creating new projects (Default: true)authme.copilot.enableRepositoryWide: Enable repository-wide instructions (.github/copilot-instructions.md) (Default: true)authme.copilot.enablePathSpecific: Enable path-specific instructions for Apex, LWC, Triggers, etc. (Default: true)authme.copilot.enableAgentInstructions: Enable AI agent instructions (AGENTS.md) for backward compatibility (Default: true)authme.copilot.enableCustomAgents: Enable custom agents (.github/agents/*.agent.md) for specialized AI assistance (Default: true)
Ollama Integration (Optional)
authme.ollama.enabled: Enable AI-enhanced documentation using Ollama (Default: false)authme.ollama.endpoint: Ollama API endpoint URL (Default: http://localhost:11434)authme.ollama.model: Ollama model to use for documentation generation (Default: codellama)
Commands
Access these commands through the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
Authme: Setup packages- Initial setup of required packagesAuthme: upgrade sfdx- Upgrade to latest SFDX versionAuthme: Refresh Org Context- Force refresh the current org contextAuthme: Setup/Update Copilot Instructions- Configure or update GitHub Copilot instructionsAuthme: Generate Apex Documentation- Generate documentation for the active Apex classAuthme: Upsert Fields metadata to Salesforce- Upsert field descriptions and metadata from local schema files to SalesforceAuthme: Download Apex Logs- Download Apex logs with configurable optionsAuthme: Download Apex Logs (Last Settings)- Quick download using previously saved settings
URI Handler
The extension handles AuthMe authentication URIs in the following format:
vscode://authme.authme?projectName=<project>&username=<username>&instance_url=<url>&sid=<sessionId>&orgId=<orgId>&autoformat=true
Parameters:
projectName: Salesforce project name (used for folder creation)username: Salesforce usernameinstance_url: Salesforce instance URLsid: Access token or valid session IDorgId: Salesforce organization IDautoformat: Enable automatic formatting (optional)
Apex Documentation
The extension provides automated Apex documentation generation for your Apex classes. Use the Authme: Generate Apex Documentation command on any .cls file to:
- Add class-level documentation with meaningful descriptions
- Generate method documentation with parameter and return type descriptions
- Preserve existing documentation
- Automatically detect and document:
- Batch classes
- Interfaces
- Virtual classes
- Method parameters and return types
Documentation is generated following Salesforce's ApexDoc format and includes:
@description- Automatically generated based on class/method names@param- Parameter descriptions with types@return- Return value descriptions@group- Optional grouping (when specified)@see- Related classes (for batch classes)
Apex Log Management
The extension provides comprehensive Apex log management capabilities for debugging and analysis:
Features
- Bulk Downloads: Download all or filtered Apex logs with parallel processing
- Smart Organization: Automatically organized logs with meaningful filenames
- Progress Tracking: Real-time download progress with ETA calculations
- Settings Persistence: Save and reuse download preferences
- Large File Support: Efficient handling of multi-MB debug logs
- Quick Access: One-click downloads with saved settings
Download Options
- Output Directory: Customize where logs are saved (relative to project root)
- Log Limit: Download all logs or specify a maximum number
- Parallel Downloads: Configure concurrent downloads (1-10) for faster processing
- Auto-Delete: Optionally remove logs from Salesforce after download
File Organization
project-root/
├── apex_logs/
│ └── 20250121_153045/ # Timestamped folders
│ ├── download_summary.txt # Download statistics
│ ├── apexlog_ids.csv # Log IDs (if delete option used)
│ └── 2025-01-21T10-30-45_John_Doe_Execution_03s123.log
Workflow
- First Time: Use "Download Apex Logs" to configure all settings
- Quick Downloads: Use "Download Apex Logs (Last Settings)" for one-click access
- Review Settings: Preview last used settings before confirming download
The log management system uses JSForce for reliable log discovery and the Salesforce CLI for efficient file downloads, ensuring compatibility with large orgs and extensive logging.
License
See LICENSE file for details.