feat: add --agent-mode flag and AUTH0_AGENT_MODE env - #1612
Open
ramya18101 wants to merge 3 commits into
Open
Conversation
ramya18101
marked this pull request as ready for review
August 14, 2026 07:48
--agent-mode flag to output JSON and disable prompts/colors for AI agents--agent-mode flag and AUTH0_AGENT_MODE env
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.
🔧 Changes
ntroduces Agent Mode — a single switch that optimizes CLI output for AI agents and automation. When enabled, it applies three defaults in
PersistentPreRunE, before any subcommand runs: sets--json, --no-input,--no-color`Decisions:
flag.Changed).auth0 apps list --csvin agent mode still emits CSV.AUTH0_AGENT_MODE=false(or--agent-mode=false) forces it off even inside a detected agent; surfaced in a stderr notice on activation and in the flag help.--jsonregistrations. Agent mode rides the sharedcli.jsonfield thatconfigureRenderer()already consumes, so output flips without touching per-command flag wiring. Global---jsonconsolidation deferred to a separate ticket.--forcedeliberately excluded — agent mode never auto-confirms destructive operations.Applies to all commands (generic, CLI-wide).
📚 References
detectAgent()agent-client detection work.🔬 Testing
Unit (
TestResolveAgentMode, table-driven): env-true-over-flag, env-false-over-flag, invalid-env-falls-through-to-flag, flag-true, flag-false.Manual (live tenant):
📝 Checklist