BYO resolves {{...}} tokens at runtime when it executes saved commands, workflow command steps, and string settings that contain tokens.
- Token format
- Resolution order
- Built-in tokens
- Command-line overrides
- Settings and secrets tokens
- Programmatic token overrides
- Object and JSON payload tokens
- Unresolved tokens
- Examples
- Use double curly braces:
{{TokenName}} - Token names can include letters, numbers,
_,:, and. - Token matching is case-insensitive
Examples:
{{Demo:ApiBaseUrl}}{{Demo:ApiToken}}{{context:region}}{{Project.Repository.Name}}{{UtcDateTimeNow}}{{Guid}}
Tokens are resolved in this order:
- Token overrides
- Command-line overrides parsed from the current process
- Explicit
tokenOverridespassed toTokenService.ResolveTokens(...)
- Built-in system tokens
- Saved settings and secrets
- Object or JSON payload values
- Unresolved tokens are replaced with an empty string
If the same token is supplied by multiple override sources, the explicit tokenOverrides dictionary wins over command-line values.
These tokens are resolved without needing a saved setting or secret:
| Token | Description | Format |
|---|---|---|
{{DateNow}} |
Current local date | yyyy-MM-dd |
{{DateTimeNow}} |
Current local date and time | yyyy-MM-dd HH:mm |
{{UtcDateNow}} |
Current UTC date | yyyy-MM-dd |
{{UtcDateTimeNow}} |
Current UTC date and time | yyyy-MM-dd HH:mm |
{{Guid}} |
New random GUID | Standard GUID string |
These are special override tokens. When supplied through command-line or programmatic overrides, BYO converts a relative time expression into an absolute datetime. {{DateTimeWindow}} uses local time; {{UtcDateTimeWindow}} calculates and formats the result using UTC.
Supported expressions:
1m,30m— minutes ago1h,8h— hours ago1d,7d— days ago1w,4w— weeks ago1mo,3mo— months ago
Behavior details:
- Output format:
yyyy-MM-dd HH:mm - Matching is case-insensitive
- Extra spaces are ignored, so
7 dand7Dare normalized - Invalid values are not converted and continue through normal resolution
Only space-separated CLI overrides are supported.
Supported forms:
--Tenant prod--context:region westus
Examples:
byo run --target command --name "Demo API Bearer Check" --Tenant prod --context:region westus
byo run --target command --name "Recent Errors" --DateTimeWindow 7d
byo run --target command --name "Recent Errors" --UtcDateTimeWindow 7dThose values can satisfy matching tokens such as {{Tenant}}, {{context:region}}, {{DateTimeWindow}}, and {{UtcDateTimeWindow}}.
Settings and secrets are commonly referenced with namespaced keys such as {{Demo:ApiToken}}.
BYO looks up saved keys by prefix. Exact token names are the simplest option, but if multiple saved keys start with the same token text, BYO asks you to choose which saved key to use.
If a resolved setting or secret value contains pipe-separated values such as value1|value2|value3, BYO asks you to choose one of those values at runtime.
You can also supply overrides directly when calling TokenService.ResolveTokens(...). BYO merges command-line overrides with the explicit dictionary you pass in.
Example:
var text = "Tenant={{Tenant}}, Region={{Deployment.Region}}, LocalFrom={{DateTimeWindow}}, UtcFrom={{UtcDateTimeWindow}}";
var payload = new
{
Deployment = new
{
Region = "westus"
}
};
var overrides = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
["Tenant"] = "prod",
["DateTimeWindow"] = "7d",
["UtcDateTimeWindow"] = "7d"
};
var resolved = TokenService.ResolveTokens(
text,
obj: payload,
tokenOverrides: overrides);BYO can resolve token values from an object payload or a JsonElement payload.
Use dot notation for nested values:
{{Project.Repository.Name}}{{project.repository.name}}{{Deployment.Region}}
Behavior details:
- Regular object payloads use case-insensitive public property lookup
- Regular object payloads do not resolve single-segment tokens such as
{{Name}} JsonElementpayloads support case-insensitive property lookup for both single-segment and dot-notation tokens
If BYO cannot resolve a token, it replaces that token with an empty string and shows a warning.
BYO does not keep unresolved token text in place, and it does not prompt for arbitrary missing token values.
Save a command that uses stored settings/secrets and built-in tokens:
byo commands set --name "Demo API Bearer Check" --bookmark "Examples/GettingStarted" --shell PowerShell --executable "curl.exe -s -H 'Authorization: Bearer {{Demo:ApiToken}}' '{{Demo:ApiBaseUrl}}/bearer?correlationId={{Guid}}'"Run a saved command with a time window override:
byo run --target command --name "Recent Errors" --DateTimeWindow 7d