Skip to content

RW.Core Keyword Reference

RW.Core is the standard Robot Framework keyword library that every Skill Template uses. Import it in your .robot file:

*** Settings ***
Library RW.Core

Secrets

# Required secret — fails if not found
RW.Core.Import Secret kubeconfig
# Optional secret — returns None if not found
${slack}= RW.Core.Import Optional Secret slack_webhook

Dev mode: reads from env vars or local files. Use RW_SECRET_REMAP to map variable names and RW_FROM_FILE to read values from files:

Terminal window
export RW_MODE=dev
export RW_FROM_FILE='{"kubeconfig":"/home/user/auth/kubeconfig"}'
export RW_SECRET_REMAP='{"my_token":"MY_LOCAL_TOKEN_VAR"}'

Production: resolves via fetchsecrets from Vault, Kubernetes secrets, Azure, GCP, or AWS providers based on RW_SECRETS_KEYS configuration.

User Variables

${NAMESPACE}= RW.Core.Import User Variable NAMESPACE
${THRESHOLD}= RW.Core.Import User Variable THRESHOLD default=80

Dev mode: reads from env vars. Use RW_ENV_REMAP to map names:

Terminal window
export RW_ENV_REMAP='{"NAMESPACE":"MY_K8S_NAMESPACE"}'

Platform Variables

${RW_WORKSPACE}= RW.Core.Import Platform Variable RW_WORKSPACE
${RW_LOOKBACK_WINDOW}= RW.Core.Import Platform Variable RW_LOOKBACK_WINDOW

Dev mode: delegates to Import User Variable (reads from env).

Metrics

# Push a raw metric value (0–1 for SLIs)
RW.Core.Push Metric ${metric_value}
# Push with metadata
RW.Core.Push Metric ${value} sub_name=latency_p99 metric_type=gauge
# Run a keyword and push its return value as a metric
RW.Core.Run Keyword And Push Metric My SLI Keyword arg1 arg2

Dev mode: logs to console. Production: pushes to OpenTelemetry Collector.

Issues

RW.Core.Add Issue
... severity=2
... title=Pod CrashLooping
... expected=Pod should be Running
... actual=Pod in CrashLoopBackOff
... next_steps=Check pod logs with kubectl logs
... details=${pod_details}

Severity constants: ${RW_CORE_SEV_1} (critical) through ${RW_CORE_SEV_4} (low).

Dev mode: logs to console. Production: writes to issues.jsonl.

Reports

RW.Core.Add To Report ${summary_text}
RW.Core.Add Pre To Report ${raw_output}
RW.Core.Add Json To Report ${json_data}
RW.Core.Add Table To Report ${title} ${body} ${headers}

Dev mode: logs to console. Production: writes to report.jsonl.

Logging

RW.Core.Info Log Processing ${count} items console=True
RW.Core.Debug Log ${detailed_data}
RW.Core.Error Log Failed to connect: ${error}

Services and Shell

# Import a pre-configured service (e.g. a kubectl context)
RW.Core.Import Service kubectl_service
# Run a shell command through a service
${result}= RW.Core.Shell kubectl get pods service=${kubectl_service}
# Run a shell command directly
${result}= RW.Core.Shell curl -s https://example.com

Session Files

# Upload a file for cross-task sharing
RW.Core.Upload Session File results.json ${json_contents}
# Retrieve a previously uploaded file
${data}= RW.Core.Get Session File results.json

Dev mode: no-op (returns None).

Utility

# Normalize a lookback window to short units
${window}= RW.Core.Normalize Lookback Window seconds=3600 format_type=2
# Returns "60m"

Full keyword docs

The auto-generated keyword reference (every argument, return type, and example) is at docs/keywords.md in the rw-core-keywords repo, regenerated on every push to main.

For the package/module architecture and dev vs production mode details, see rw-core-keywords in the Runtime Stack section.