oracle / oracle/oci-cli

ENH: Add `--output tsv` along with `table` and `json` options for tab-separated report output

Open
#754 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

I can't tell you how many times a day I do this:

oci iam compartment list --compartment-id-in-subtree true \
--query 'data[*].join(`\t`, [name, "lifecycle-state"]) | join(`\n`, @)' \
--raw-output

…In order to produce tab-separated report I can capture then paste to Excel, etc. (or format further by piping to column command or similar) please add an additional --output tsv option that would format the output similar to --output table but without the box lines and separating each column in the header and body by tab ASCII 9 symbols?

oci iam compartment list --compartment-id-in-subtree true \
--query 'data[*].[name, "lifecycle-state"]' \
--output tsv

Column1        Column2 
sandbox        ACTIVE
prod           ACTIVE
nonprod        ACTIVE
prod.biZVAxli  DELETED

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the CLI's existing --output table and --output json handling, using the shown oci iam compartment list command and query as the example input. Add the tsv output mode so headers and rows are tab-separated without table box lines, and verify the displayed compartment report matches the requested format.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.