[GH-ISSUE #448] Feature request #129

Closed
opened 2026-02-26 21:33:38 +03:00 by kerem · 5 comments
Owner

Originally created by @migueldeicaza on GitHub (Feb 8, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/448

Originally assigned to: @rudrankriyam on GitHub.

Would it be possible to have an environment variable like ASC_DEFAULT_OUTPUT so it is easier to learn to use the API, without having to put --output table on each one?

Originally created by @migueldeicaza on GitHub (Feb 8, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/448 Originally assigned to: @rudrankriyam on GitHub. Would it be possible to have an environment variable like ASC_DEFAULT_OUTPUT so it is easier to learn to use the API, without having to put --output table on each one?
kerem 2026-02-26 21:33:38 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Feb 8, 2026):

@cursoragent please implement this; we already have environment variables setup for other things; this will be a great addition

<!-- gh-comment-id:3867404158 --> @rudrankriyam commented on GitHub (Feb 8, 2026): @cursoragent please implement this; we already have environment variables setup for other things; this will be a great addition
Author
Owner

@cursor[bot] commented on GitHub (Feb 8, 2026):

Here's a summary of what was implemented:

Added ASC_DEFAULT_OUTPUT environment variable that lets users set a global default output format instead of passing --output table on every command.

  • New function shared.DefaultOutputFormat() in internal/cli/shared/shared.go reads ASC_DEFAULT_OUTPUT and returns the validated format. Valid values: json, table, markdown, md (case-insensitive, whitespace-trimmed). Invalid values emit a single warning to stderr and fall back to json.
  • Updated 215 files across all CLI commands to use shared.DefaultOutputFormat() instead of the hardcoded "json" default for the --output flag.
  • Result cached with sync.Once so the env var is read once per process, preventing duplicate warnings and redundant os.Getenv calls.
  • 10 unit tests covering: default/unset returns json, all valid values, case insensitivity, whitespace handling, and invalid-value warning + fallback.
  • Documentation updated in both AGENTS.md and README.md environment variable tables.

Usage: export ASC_DEFAULT_OUTPUT=table and all commands will default to table output. Explicit --output flags still override the env var.

View PR

Open in Cursor Open in Web

<!-- gh-comment-id:3867404299 --> @cursor[bot] commented on GitHub (Feb 8, 2026): Here's a summary of what was implemented: **Added `ASC_DEFAULT_OUTPUT` environment variable** that lets users set a global default output format instead of passing `--output table` on every command. - **New function** `shared.DefaultOutputFormat()` in `internal/cli/shared/shared.go` reads `ASC_DEFAULT_OUTPUT` and returns the validated format. Valid values: `json`, `table`, `markdown`, `md` (case-insensitive, whitespace-trimmed). Invalid values emit a single warning to stderr and fall back to `json`. - **Updated 215 files** across all CLI commands to use `shared.DefaultOutputFormat()` instead of the hardcoded `"json"` default for the `--output` flag. - **Result cached with `sync.Once`** so the env var is read once per process, preventing duplicate warnings and redundant `os.Getenv` calls. - **10 unit tests** covering: default/unset returns `json`, all valid values, case insensitivity, whitespace handling, and invalid-value warning + fallback. - **Documentation updated** in both `AGENTS.md` and `README.md` environment variable tables. Usage: `export ASC_DEFAULT_OUTPUT=table` and all commands will default to table output. Explicit `--output` flags still override the env var. <p><a href="https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/449"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-pr-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-pr-light.png"><img alt="View PR" width="86" height="28" src="https://cursor.com/assets/images/view-pr-light.png"></picture></a></p> <p><a href="https://cursor.com/background-agent?bcId=bc-08c4f759-a77c-4e90-95a3-3d0c0b158cf5"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-08c4f759-a77c-4e90-95a3-3d0c0b158cf5"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a></p>
Author
Owner

@rudrankriyam commented on GitHub (Feb 8, 2026):

For learning the API, the best way is to ask your agent to use --help on the commands, but I agree, looking at the output really helps. This actually aligns with this refactor I was doing for table/markdown #444

<!-- gh-comment-id:3867405960 --> @rudrankriyam commented on GitHub (Feb 8, 2026): For learning the API, the best way is to ask your agent to use `--help` on the commands, but I agree, looking at the output really helps. This actually aligns with this refactor I was doing for table/markdown #444
Author
Owner

@rudrankriyam commented on GitHub (Feb 8, 2026):

Solved! Update the table formatting too!

Image
<!-- gh-comment-id:3867802655 --> @rudrankriyam commented on GitHub (Feb 8, 2026): Solved! Update the table formatting too! <img width="1059" height="187" alt="Image" src="https://github.com/user-attachments/assets/ca9980f6-864c-49bc-aaec-3774b8a38b42" />
Author
Owner

@migueldeicaza commented on GitHub (Feb 8, 2026):

Wooohoo! Thanks!

<!-- gh-comment-id:3868300352 --> @migueldeicaza commented on GitHub (Feb 8, 2026): Wooohoo! Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#129
No description provided.