Skip to content

Add text output mode for auth token#4903

Open
simonfaltum wants to merge 1 commit intomainfrom
simonfaltum/auth-token-text-output
Open

Add text output mode for auth token#4903
simonfaltum wants to merge 1 commit intomainfrom
simonfaltum/auth-token-text-output

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

Why

auth token always outputs JSON, ignoring the --output flag. If you want to pipe just the token string into another tool, you have to parse JSON. That's unnecessary friction for a common scripting pattern.

Changes

auth token now respects --output text when explicitly set, outputting just the access token string (with a trailing newline) suitable for piping. JSON remains the default for backward compatibility.

Only honors the explicit --output text flag, not implicit text mode (e.g. from DATABRICKS_OUTPUT_FORMAT), so existing scripts that parse JSON output won't break.

Also fixes discarded write errors (_, _ replaced with proper error returns).

Test plan

  • Unit tests for default (JSON), explicit --output json, and --output text modes
  • Existing cmd/auth tests pass

auth token now respects --output text when explicitly set, outputting
just the access token string suitable for piping. JSON remains the
default for backward compatibility.

Also returns write errors instead of discarding them.

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Suggested reviewers

Based on git history of the changed files, these people are best suited to review:

Confidence: low

Eligible reviewers

Based on CODEOWNERS, these people or teams could also review:

@andrewnester, @anton-107, @denik, @shreyas-goenka

Suggestions based on git history of 2 changed files (2 scored). See CODEOWNERS for path-specific ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant