Skip to main content
Operator tool presets are pre-configured definitions for common DevOps and SRE tools. Each preset bundles the correct capability pair, scope ID, suggested commands, and typical use cases so you do not have to repeat that configuration across plugins.
Start from the operator fixtures in examples/fixtures/ rather than building preset usage from scratch. The operator-kubernetes-plugin.fixture.ts and operator-terraform-plugin.fixture.ts files show the full authoring pattern.

Available presets

Preset IDLabelSuggested commandsTypical use cases
docker-cliDocker CLIdocker, docker composeContainer dashboards, compose orchestration, image inspection
kubectlkubectlkubectlCluster dashboards, resource inspection, namespace operations
helmHelmhelmRelease dashboards, chart upgrade flows, Helm diff workflows
terraformTerraformterraformPlan review, apply orchestration, workspace management
ansibleAnsibleansible, ansible-playbookPlaybook runners, inventory inspection, ops automation
aws-cliAWS CLIawsCloud inventory, operational runbooks, SSM/EKS workflows
gcloudGoogle Cloud CLIgcloudGKE workflows, project inspection, operational tooling
azure-cliAzure CLIazAKS workflows, resource group inspection, operational runbooks
podmanPodmanpodmanRootless container dashboards, image inspection, local runtime
kustomizeKustomizekustomize, kubectl kustomizeManifest preview, overlay inspection, GitOps helpers
ghGitHub CLIghPR dashboards, workflow triage, repository automation
gitGitgitDiff dashboards, status inspection, repository automation
vaultVaultvaultSecret inspection, lease operations, auth troubleshooting
nomadNomadnomadJob dashboards, allocation inspection, cluster operations

OperatorToolPresetDefinition

Each preset is a fully typed OperatorToolPresetDefinition object:
type OperatorToolPresetDefinition = {
  id: OperatorToolPresetId;
  label: string;
  description: string;
  scopeId: string;
  capabilities: ["system.process.exec", ProcessScopeCapability];
  suggestedCommands: string[];
  typicalUseCases: string[];
};
The capabilities field always contains exactly two entries: the broad system.process.exec capability and the narrow system.process.scope.<scope-id> capability.

Getting a preset definition

getOperatorToolPreset(presetId) returns the full preset definition for a given ID:
import { getOperatorToolPreset } from "@anikitenko/fdo-sdk";

const preset = getOperatorToolPreset("kubectl");
// {
//   id: "kubectl",
//   label: "kubectl",
//   description: "Kubernetes cluster inspection and controlled mutation workflows...",
//   scopeId: "kubectl",
//   capabilities: ["system.process.exec", "system.process.scope.kubectl"],
//   suggestedCommands: ["kubectl"],
//   typicalUseCases: ["Cluster dashboards", "Resource inspection", "Namespace operations"],
// }
listOperatorToolPresets() returns all preset definitions sorted alphabetically by ID:
import { listOperatorToolPresets } from "@anikitenko/fdo-sdk";

const presets = listOperatorToolPresets();
// all 14 presets, sorted by id

Declaring capabilities

Use createOperatorToolCapabilityPreset(presetId) to get the capability array for use in declareCapabilities() or host configuration:
import {
  FDO_SDK,
  FDOInterface,
  PluginMetadata,
  createOperatorToolCapabilityPreset,
} from "@anikitenko/fdo-sdk";

export default class TerraformOperatorPlugin extends FDO_SDK implements FDOInterface {
  private readonly _metadata: PluginMetadata = {
    name: "Fixture: Terraform Operator",
    version: "1.0.0",
    author: "FDO SDK Team",
    description: "Reference fixture for Terraform-style operator plugins",
    icon: "predictive-analysis",
  };

  get metadata(): PluginMetadata {
    return this._metadata;
  }

  declareCapabilities() {
    return createOperatorToolCapabilityPreset("terraform");
    // ["system.process.exec", "system.process.scope.terraform"]
  }

  init(): void {
    this.info("Terraform operator initialized", {
      declaredCapabilities: this.declareCapabilities(),
    });
  }

  render(): string {
    return `<div>Terraform Operator</div>`;
  }
}

Running a command with a preset

requestOperatorTool(presetId, payload, options?) is the primary way to execute a command using a preset. It wires up the scope ID and correlation ID prefix automatically:
import { requestOperatorTool } from "@anikitenko/fdo-sdk";

const response = await requestOperatorTool("kubectl", {
  command: "/usr/local/bin/kubectl",
  args: ["get", "pods", "--all-namespaces", "-o", "json"],
  timeoutMs: 5000,
  dryRun: true,
  reason: "preview cluster workload inventory",
});

Payload fields

FieldTypeRequiredDescription
commandstringYesAbsolute path to the executable
argsstring[]NoCommand arguments
cwdstringNoAbsolute working directory path
envRecord<string, string>NoAdditional environment variables
timeoutMsnumberNoExecution timeout in milliseconds
inputstringNoStandard input for the process
encoding"utf8" | "base64"NoInput/output encoding
dryRunbooleanNoValidate without executing
reasonstringNoHuman-readable reason for auditing

Building a request without sending it

createOperatorToolActionRequest(presetId, payload) builds a ProcessExecActionRequest without dispatching it. Use this when you need to inspect or log the request before sending, or to construct the request at plugin init time:
import {
  createOperatorToolActionRequest,
  requestPrivilegedAction,
  isPrivilegedActionSuccessResponse,
} from "@anikitenko/fdo-sdk";

const request = createOperatorToolActionRequest("terraform", {
  command: "/usr/local/bin/terraform",
  args: ["plan", "-input=false"],
  timeoutMs: 10000,
  dryRun: true,
  reason: "preview infrastructure plan",
});

// Inspect or log the request:
this.info("Built terraform plan request", { request });

// Then send it later:
const response = await requestPrivilegedAction(request, {
  correlationIdPrefix: "terraform",
});

if (isPrivilegedActionSuccessResponse(response)) {
  // handle success
}

Generic scoped execution for custom tools

For tools not in the curated preset list, use requestScopedProcessExec(scopeId, payload, options?):
import { requestScopedProcessExec } from "@anikitenko/fdo-sdk";

const response = await requestScopedProcessExec("internal-runner", {
  command: "/usr/local/bin/internal-runner",
  args: ["status"],
  timeoutMs: 3000,
  dryRun: true,
  reason: "preview internal runner status",
});
If you need to build the request without sending it, use createScopedProcessExecActionRequest(scopeId, payload):
import { createScopedProcessExecActionRequest } from "@anikitenko/fdo-sdk";

const request = createScopedProcessExecActionRequest("internal-runner", {
  command: "/usr/local/bin/internal-runner",
  args: ["status"],
  timeoutMs: 3000,
  dryRun: true,
});
For generic custom scopes, declare capabilities using createProcessCapabilityBundle(scopeId):
import { createProcessCapabilityBundle } from "@anikitenko/fdo-sdk";

const capabilities = createProcessCapabilityBundle("internal-runner");
// ["system.process.exec", "system.process.scope.internal-runner"]

Examples by tool

import {
  createOperatorToolCapabilityPreset,
  requestOperatorTool,
  isPrivilegedActionSuccessResponse,
  isPrivilegedActionErrorResponse,
} from "@anikitenko/fdo-sdk";

// Declare capabilities
declareCapabilities() {
  return createOperatorToolCapabilityPreset("docker-cli");
  // ["system.process.exec", "system.process.scope.docker-cli"]
}

// Run docker ps
async listContainers(): Promise<unknown> {
  return requestOperatorTool("docker-cli", {
    command: "/usr/local/bin/docker",
    args: ["ps", "--format", "json"],
    timeoutMs: 5000,
    dryRun: true,
    reason: "list running containers for dashboard",
  });
}

Missing capability diagnostics

When a request fails because a capability is not granted, use parseMissingCapabilityError() to get a structured diagnostic instead of parsing the error message yourself:
import { parseMissingCapabilityError } from "@anikitenko/fdo-sdk";

try {
  await requestOperatorTool("kubectl", { /* ... */ });
} catch (error) {
  const diagnostic = parseMissingCapabilityError(error);
  if (diagnostic) {
    console.error("Missing capability:", diagnostic.capability);
    console.error("Category:", diagnostic.category);
    // "process" for system.process.exec
    // "process-scope" for system.process.scope.<id>
    console.error("Remediation:", diagnostic.remediation);
  }
}
This is especially useful for distinguishing a missing broad capability (system.process.exec) from a missing narrow scope capability (system.process.scope.kubectl), which require different remediation steps in the host configuration.