@reaatech/structured-function-calling-ai-cli
Scaffold, validate, and dry-run tool definitions from the command line.
Installation
pnpm add @reaatech/structured-function-calling-ai-cliThe CLI exposes the tcc binary.
API
init
function init(name: string, cwd: string): Promise<void>;Scaffolds a new {name}.tool.ts file in cwd. Writes a ToolDefinition template with a Zod schema placeholder. Throws if name is empty. Skips without error if the file already exists.
validate
function validate(filePath: string): Promise<ValidationResult>;
type ValidationResult = { valid: boolean; errors?: string[] };Reads filePath, checks that the content contains the string ToolDefinition, and returns a ValidationResult. Throws if the file does not exist. Returns { valid: true } on pass or { valid: false, errors: [...] } on failure.
dryRun
function dryRun(
toolName: string,
input: Record<string, unknown>,
registry: ToolRegistry,
): Promise<void>;Executes toolName from registry with input using a fresh ToolExecutor (no middleware). Prints the ExecutionResult as JSON to stdout. Exits with code 1 if the tool is not found in registry.
main
function main(argv: string[]): Promise<void>;Parses argv via node:util.parseArgs and dispatches to init, validate, or dryRun. The module re-exports all command functions for testability; the actual CLI entry point is bin/tcc.mjs.
CLI usage
tcc init <name> Scaffold a new tool definition file
tcc validate <file> Validate a tool definition file
tcc dry-run <tool> Dry-run a tool (requires --input)
Options:
-h, --help Show help
-v, --version Show version
-i, --input <json> Input JSON for dry-runUsage example
# Scaffold a new tool
tcc init get_weather
# Validate it
tcc validate ./get_weather.tool.ts
# Dry-run it (tool must be registered in the registry first)
tcc dry-run get_weather --input '{"city":"NYC"}'For programmatic use:
import { init, validate } from '@reaatech/structured-function-calling-ai-cli';
await init('my_tool', process.cwd());
const result = await validate('./my_tool.tool.ts');
// → { valid: true } or { valid: false, errors: ['...'] }Dependencies
@reaatech/structured-function-calling-ai-core(workspace:*)@reaatech/structured-function-calling-ai-engine(workspace:*)zod4.4.3
