Skip to main content

Library Tools

Library tools are built-in tool integrations you can include by listing them in .devassure/library.yaml.

# .devassure/library.yaml
tools:
- 'authenticator'
- 'faker:*'

faker — Fake Data Generators

Faker provides fake data generators for tests

ToolDescription
first_nameGenerate a random first name
last_nameGenerate a random last name
full_nameGenerate a random full name
emailGenerate a random email address
phoneGenerate a random phone number

authenticator — TOTP Helper

Authenticator provides TOTP (Time-based One-Time Password) helpers:

ToolDescription
get_authenticator_otpGenerate a TOTP code from an authenticator secret

Custom Tools

Custom tools let you run any command or script and pass its output to the agent. Configuration lives in .devassure/tools/index.yaml.

Requirement

tools/index.yaml must exist at .devassure/tools/index.yaml for tools to be available.

Tool Fields

FieldRequiredDescription
nameUnique identifier for the tool
descriptionWhat the tool does
execCommand to run; supports ${argName} substitution
cwdOptionalWorking directory relative to the tools/ folder
argsOptionalList of input parameters (each has name, type, and optional optional: true)

Supported arg types: string, number, boolean, object


Minimal Example

# .devassure/tools/index.yaml
tools:
- name: "getProjectDetails"
description: "Get project details from API"
cwd: "api-tools"
args:
- name: projectId
type: string
exec: npm run getProjectDetails ${projectId}

Multi-line exec

Use YAML block style for multi-command sequences:

exec: |
npm run warmupTestingProcess
npm run getProjectDetails ${projectId} "${projectName}"
npm run cleanupTestingProcess

Top-level Settings and Setup

settings — Default options applied to every tool and setup step:

OptionDescription
timeoutSecMax execution time in seconds
output.start / output.endStdout markers; only content between them is captured as tool output
envList of KEY: value environment variables
ignore_failureIf true, non-zero exit does not fail the run

setup — Optional steps run once per session before tests start (e.g., npm install). Each step can have name, cwd, and exec.


Capturing Output with Markers

When your script prints extra content (logs, progress), use output markers so only the relevant result is captured:

// In your script (e.g., getProjectDetails.js)
const startMarker = "__TOOL_OUTPUT_START__";
const endMarker = "__TOOL_OUTPUT_END__";

// ... do work, then:
console.log(startMarker);
console.log(JSON.stringify(result));
console.log(endMarker);
# In tools/index.yaml
settings:
output:
start: "__TOOL_OUTPUT_START__"
end: "__TOOL_OUTPUT_END__"

Full tools/index.yaml Example

settings:
timeoutSec: 10
output:
start: "__TOOL_OUTPUT_START__"
end: "__TOOL_OUTPUT_END__"
env:
- BUILD_ENV: "dev"
- DB_NAME: "legacy-db"
ignore_failure: false

setup:
- name: "Install dependencies"
cwd: "api-tools"
exec: "npm install"

tools:
- name: "getProjectDetails"
description: "Get project details from API"
cwd: "api-tools"
args:
- name: projectId
type: string
- name: projectName
type: string
optional: true
exec: |
npm run warmupTestingProcess
npm run getProjectDetails ${projectId} "${projectName}"
npm run cleanupTestingProcess