oxdock-cli 0.6.0-alpha

CLI tooling for executing OxDock's Docker-inspired language on native platforms.
Documentation
# All commands except RUN are intended to have similar cross-platform support.
# Hello examples for oxdock-cli DSL
#
# This file demonstrates:
# - unguarded commands (run always)
# - guarded commands using `[...]` (commas for AND, `or(...)` for OR)
# - guard-only lines that apply to the next command
# - `ENV` which sets variables for subsequent RUN/RUN_BG commands
# - platform guards, negation, and env-equality checks

# --- Unguarded commands run unconditionally ---
ECHO "This runs unconditionally"

# --- Platform-specific guarded RUNs (inline guards) ---
[mac] ECHO "Hello from Mac"
[linux] ECHO "Hello from Linux"
[windows] ECHO "Hello from Windows"

# Negation: run when NOT on Windows
[!windows] ECHO "Not on Windows"

# OR: run on mac OR linux
[or(mac, linux)] ECHO "mac or linux"

# --- ENV and env-guards ---
# Set an environment variable for subsequent RUN commands
ENV FOO=1

# Guard on the same line: only runs when FOO is set
[env:FOO] ECHO "(inline) Foo is set"

# Guard-only line (previous-line guard): applies to the next command
[env:FOO]
ECHO "(previous-line) Foo is set"

# Example mixing AND/OR: (FOO and linux) OR mac
[or((env:FOO, linux), mac)] ECHO "Foo on linux, or any mac"

# Show that ECHO can print the ENV we set earlier (cross-platform)
ECHO {{ env:FOO }}

# --- Notes ---
# - Guards in `[...]` support comma-separated AND, `or(...)` for OR, parentheses for grouping, and `!` for inversion.
# - Guard-only lines accumulate and apply to the next non-empty command line.
# - `ENV` affects subsequent RUN and RUN_BG commands and is also considered by guards.

# --- RUN (native commands) examples ---
# Use `ECHO` for cross-platform DSL output. Use `RUN` when you need to execute
# native shell/OS commands; these are often platform-specific so guard them.
# Example: list the current directory using the native command on each platform.
[unix] RUN ls -la
[windows] RUN dir

# Example: show the `FOO` env using native commands (guarded per-platform).
[unix] RUN env | grep FOO
[windows] RUN cmd /C "echo %FOO%"

# Note: The LS command is also a built-in command
# LS