NOTICKET Add adjustable output format per subcommand#3
Merged
Conversation
Kodem Security Scan Summary
Note: Kai marked all findings as likely false positives. |
apollotn
previously approved these changes
Mar 13, 2026
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>
- 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>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
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>
brandonapollo
added a commit
that referenced
this pull request
May 4, 2026
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
-f, --format <format>option to all 11 subcommands (people search/enrich/bulk-enrich/email/employees,companies search/enrich/bulk-enrich/get/jobs,news search).Supported formats:
json(default) — pretty-printed, existing behaviorjsonl— one JSON object per line, great for streaming/pipingcsv— flat CSV with headers; nested objects stringifiedyaml— human-readable YAML via js-yamltable— ASCII table with bordered columns; nested objects stringifiedWhy
Makes output composable with a wider range of downstream tools — spreadsheets,
mlr,csvkit, log pipelines, human-readable terminal output.Example
apollo people search --query "Brandon" --format csv apollo companies search --industry saas --format table apollo news search --company Apollo --format yaml apollo people bulk-enrich --emails a@b.com c@d.com --format jsonlAI Tooling