feat(cli): move raw OASF retrieval to dirctl pull; drop --format=oasf from export#1707
Merged
Conversation
akijakya
force-pushed
the
feat/pull-batch-export-oasf
branch
2 times, most recently
from
June 29, 2026 11:48
7ab8a42 to
aceb27c
Compare
…asf` from export Signed-off-by: András Jáky <ajaky@cisco.com>
akijakya
force-pushed
the
feat/pull-batch-export-oasf
branch
from
June 29, 2026 11:49
aceb27c to
c2e52f2
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR updates the CLI so that “raw OASF record JSON” retrieval lives under dirctl pull (including batch-to-files behavior), and dirctl export is limited to module-derived formats (rejecting --format=oasf and requiring --format explicitly).
Changes:
- Extend
dirctl pullto default to JSON stdout, add--output-file, and add batch pull via--output-dirwith standard search filters. - Remove
oasfas an export format indirctl export, adding validation + tests and updating docs accordingly. - Introduce shared bulk record helpers in
cli/util/recordsand refactor export batch utilities to reuse them.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/local/11_pull_test.go | Adds E2E coverage for pull’s default JSON output and new file/dir output modes. |
| tests/e2e/local/10_export_test.go | Updates E2E expectations for export requiring --format and rejecting oasf. |
| docs/content/dir/dir-cli-reference.md | Documents pull’s new defaults/flags and export’s removal of oasf. |
| cli/util/records/records.go | Adds shared search→CID→pull helpers plus filename/dedup utilities for batch operations. |
| cli/util/records/records_test.go | Unit tests for sanitize/dedup/filename helper behavior. |
| cli/presenter/output.go | Adds AddOutputFlagsWithDefault to allow per-command output defaults. |
| cli/presenter/output_test.go | Tests the new output-default helper behavior. |
| cli/cmd/pull/pull.go | Adds batch-mode branching and --output-file behavior; defaults pull output to JSON. |
| cli/cmd/pull/options.go | Adds pull flags for output destinations and standard search filters. |
| cli/cmd/pull/batch.go | Implements batch pull to directory with validation and per-record JSON writing. |
| cli/cmd/pull/batch_test.go | Unit tests for pull invocation validation logic. |
| cli/cmd/export/options.go | Makes --format required (no default) and updates help text to direct users to pull for raw OASF. |
| cli/cmd/export/format_test.go | Adds unit tests for rejecting empty format and oasf. |
| cli/cmd/export/export.go | Enforces --format required and rejects --format=oasf; refactors batch pull to shared helpers. |
| cli/cmd/export/batch.go | Refactors batch utilities to use cli/util/records helpers. |
| cli/cmd/export/batch_test.go | Removes tests for the inlined batch utilities that were moved to the shared package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: András Jáky <ajaky@cisco.com>
ramizpolic
approved these changes
Jun 30, 2026
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.
Closes #1702