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
NOTICKET Add adjustable output format per subcommand (#3)
* Add adjustable output format option per subcommand
Adds --format / -f flag to all 11 subcommands with choices: json (default), jsonl, csv, yaml, table. Nested objects are stringified for csv/table formats. Adds js-yaml dependency for YAML serialization.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix output format edge cases from code review
- Validate --format input; exit with error on unknown value
- Derive CSV/table headers from union of all row keys, not just rows[0]
- Replace Math.max(...array) spread with reduce to avoid call stack limit
- Fix CSV escaping: escape headers, handle \r, use \r\n line endings (RFC 4180)
- Remove dead default parameter from print() since Commander always passes the value
- Fix companies search: --industry no longer silently overwrites --query
- Add comment clarifying YAML intentionally skips toRows() to preserve full structure
- Add comment explaining FORMAT_OPTION tuple positional contract
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Document --format option in README and apollo-cli skill
Adds a "Output formats" section covering json/jsonl/csv/yaml/table,
when to use each, and the nested-response caveat for csv/table.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/apollo-cli/SKILL.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ version: 1.0.0
6
6
7
7
# Apollo CLI Skill
8
8
9
-
Use the `apollo` CLI to search and enrich people and companies, find job postings, and surface news from Apollo.io. All output is JSON — pipe with `jq` to extract specific fields.
9
+
Use the `apollo` CLI to search and enrich people and companies, find job postings, and surface news from Apollo.io. Output defaults to JSON for `jq` piping; use `-f, --format` to switch to `jsonl`, `csv`, `yaml`, or `table`.
10
10
11
11
## Authentication
12
12
@@ -114,9 +114,29 @@ apollo news search --id <organization_id>
114
114
115
115
---
116
116
117
+
## Output formats
118
+
119
+
Every subcommand accepts `-f, --format <format>`:
120
+
121
+
| Format | When to use |
122
+
|---|---|
123
+
|`json` (default) | Pretty-printed JSON. Pipe to `jq` for field extraction. |
124
+
|`jsonl`| One JSON object per line. Stream into log/data pipelines. |
125
+
|`csv`| Flat CSV with headers; nested objects/arrays are stringified. Open in spreadsheets or feed to `mlr`/`csvkit`. |
126
+
|`yaml`| Human-readable YAML. Good for inspecting deeply nested responses. |
127
+
|`table`| ASCII bordered table. Good for terminal browsing of small responses. |
128
+
129
+
```bash
130
+
apollo companies search --industry saas --format table
131
+
apollo people bulk-enrich --emails a@b.com c@d.com --format jsonl
132
+
apollo news search --company Stripe --format yaml
133
+
```
134
+
135
+
For nested responses (search/list endpoints with pagination + items), prefer `json` + `jq` or `yaml`. `csv`/`table` will stringify nested structures into a single cell.
136
+
117
137
## Piping with jq
118
138
119
-
All commands output JSON. Use`jq` to extract specific fields:
139
+
For default JSON output, use`jq` to extract specific fields:
Copy file name to clipboardExpand all lines: README.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# apollo-io-cli
2
2
3
-
A command-line interface for the [Apollo.io API](https://apolloio.github.io/apollo-api-docs/). Search and enrich people and companies, find job postings, and surface news — all from your terminal, pipeable with `jq`.
3
+
A command-line interface for the [Apollo.io API](https://apolloio.github.io/apollo-api-docs/). Search and enrich people and companies, find job postings, and surface news — all from your terminal, pipeable with `jq` and switchable to CSV / YAML / JSONL / table output.
@@ -218,9 +218,34 @@ For agents not using Claude Code, see [`AGENTS.md`](./AGENTS.md) at the root for
218
218
219
219
---
220
220
221
+
## Output formats
222
+
223
+
Every subcommand accepts `-f, --format <format>` (default `json`):
224
+
225
+
| Format | Description |
226
+
|---|---|
227
+
|`json`| Pretty-printed JSON. Default. Pipe to `jq` for field extraction. |
228
+
|`jsonl`| One JSON object per line. Useful for streaming into log/data pipelines. |
229
+
|`csv`| Flat CSV with headers; nested objects/arrays are stringified into a single cell. |
230
+
|`yaml`| Human-readable YAML. Easier to scan for deeply nested responses. |
231
+
|`table`| ASCII bordered table. Good for quick terminal browsing of small responses. |
232
+
233
+
```bash
234
+
apollo companies search --industry saas --format table
235
+
apollo people bulk-enrich --emails a@b.com c@d.com --format jsonl
236
+
apollo news search --company "Stripe" --format yaml
237
+
apollo people search --title "CTO" --domain stripe.com --format csv > ctos.csv
238
+
```
239
+
240
+
> Search/list responses include both pagination metadata and an array of records. `csv` and `table` formats render these as two columns with the array stringified — for analysis, prefer `json` + `jq` to project just the records:
0 commit comments