Installation
📦 Install from npm (Recommended)
sf plugins install @salesforce/plugin-agentscript
🔧 Install from GitHub (Latest)
sf plugins install https://github.com/composable-delivery/sf-agentscript
💻 Development Installation
git clone https://github.com/composable-delivery/sf-agentscript.git
cd sf-agentscript/plugin-agentscript
npm install
npm run build
sf plugins link .
Features
- Fast WASM-based parsing - Built with Rust for maximum performance
- Syntax validation - Quickly validate AgentScript files
- AST inspection - View and query the Abstract Syntax Tree
- Element listing - List topics, variables, actions, and messages
- AST queries - Extract specific parts using path notation
- CI/CD integration - Perfect for automation and pipelines
Commands
sf agentscript-parser parse
Parse an AgentScript file and output its AST in JSON or pretty format.
sf agentscript-parser parse \
--file MyAgent.agent
sf agentscript-parser validate
Validate the syntax of an AgentScript file.
sf agentscript-parser validate \
--file MyAgent.agent
sf agentscript-parser list
List topics, variables, actions, or messages from an agent.
sf agentscript-parser list \
--file MyAgent.agent \
--type topics
sf agentscript-parser query
Query specific parts of the AST using dot-notation paths.
sf agentscript-parser query \
--file MyAgent.agent \
--path config.agent_name
sf agentscript-parser version
Display the version of the AgentScript parser.
sf agentscript-parser version
Usage Examples
List all topics in an agent
$ sf agentscript-parser list --file CustomerService.agent --type topics
Topics (3):
• start_agent: topic_selector
• support: Handle customer support requests
• billing: Process billing inquiries
Query configuration values
$ sf agentscript-parser query --file CustomerService.agent --path config.agent_name
Query: config.agent_name
Result: "CustomerService"
CI/CD Integration
# Validate all .agent files in your repository
find . -name "*.agent" -exec sf agentscript-parser validate --file {} \;
# Extract agent names for documentation
sf agentscript-parser query --file *.agent --path config.agent_name --format json