You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/cli-reference.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,22 @@ cel --version
15
15
16
16
The `cel` command-line tool provides a convenient way to evaluate CEL expressions from the command line, in scripts, or interactively. It supports context loading, file processing, and various output formats.
17
17
18
+
## Standard Library Functions
19
+
20
+
The CLI automatically includes all [standard library functions](../reference/cel-compliance.md#using-celstdlib-recommended) from `cel.stdlib`. These functions are available without any additional setup:
21
+
22
+
### Available Functions
23
+
24
+
-**`substring(str, start, end?)`** - Extract substring from a string
25
+
```bash
26
+
cel 'substring("hello world", 0, 5)'# → hello
27
+
cel 'substring("hello world", 6)'# → world
28
+
```
29
+
30
+
**Note**: Use function syntax `substring("text", 0, 5)`, not method syntax `"text".substring(0, 5)`.
31
+
32
+
For programmatic use (Python API), import and use `cel.stdlib.add_stdlib_to_context()` to add these functions to your context.
0 commit comments