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
All `dirctl` commands support multiple output formats via the `--output` (or `-o`) flag, making it easy to switch between human-readable output and machine-processable formats.
73
+
74
+
### Available Formats
75
+
76
+
| Format | Description | Use Case |
77
+
|--------|-------------|----------|
78
+
|`human`| Human-readable, formatted output with colors and tables (default) | Interactive terminal use |
79
+
|`json`| Pretty-printed JSON with indentation | Debugging, single-record processing |
80
+
|`jsonl`| Newline-delimited JSON (compact, one object per line) | Streaming, batch processing, logging |
81
+
|`raw`| Raw values only (e.g., CIDs, IDs) | Shell scripting, piping to other commands |
82
+
83
+
### Usage
84
+
85
+
```bash
86
+
# Human-readable output (default)
87
+
dirctl routing list
88
+
89
+
# JSON output (pretty-printed)
90
+
dirctl routing list --output json
91
+
dirctl routing list -o json
92
+
93
+
# JSONL output (streaming-friendly)
94
+
dirctl events listen --output jsonl
95
+
96
+
# Raw output (just values)
97
+
dirctl push my-agent.json --output raw
98
+
```
99
+
100
+
### Piping and Processing
101
+
102
+
Structured formats (`json`, `jsonl`, `raw`) automatically route data to **stdout** and metadata messages to **stderr**, enabling clean piping to tools like `jq`:
> **Note:** For streaming events, use `--output jsonl` format as it outputs one compact JSON object per line, making it ideal for real-time processing with tools like `jq`.
125
+
114
126
### Combine Filters
115
127
116
128
All filter types can be combined for precise event monitoring:
@@ -120,7 +132,7 @@ All filter types can be combined for precise event monitoring:
120
132
dirctl events listen \
121
133
--types RECORD_PUSHED,RECORD_PULLED \
122
134
--labels /skills/AI \
123
-
--json
135
+
--output jsonl
124
136
```
125
137
126
138
## Using the Go SDK
@@ -251,7 +263,7 @@ Track system activity for operational awareness:
251
263
252
264
```bash
253
265
# Monitor all operations in production
254
-
dirctl events listen --json| tee events.log
266
+
dirctl events listen --output jsonl| tee events.log
255
267
256
268
# Alert on failed syncs
257
269
dirctl events listen --types SYNC_FAILED | \
@@ -294,7 +306,7 @@ Maintain audit trails for critical operations:
0 commit comments