feat: support global --agent-token CLI flag for programmatic auth#89
Open
cyberalt3 wants to merge 1 commit into
Open
feat: support global --agent-token CLI flag for programmatic auth#89cyberalt3 wants to merge 1 commit into
cyberalt3 wants to merge 1 commit into
Conversation
Added global interceptor for --agent-token flag to set environment variable.
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.
What does this PR do?
Currently, the
zerion-clidoes not parse or respect the--agent-tokenflag passed via command line arguments. Developers automating the CLI in CI/CD or wrapping it in child processes are forced to injectZERION_AGENT_TOKENintoprocess.env.This PR adds a global parser at the entry point to automatically map the
--agent-tokenargument toprocess.env.ZERION_AGENT_TOKEN, allowing commands like:zerion swap base 1 USDC ETH --agent-token <token>to work out-of-the-box as developers expect.Why is it important?
When building autonomous agents that juggle multiple wallets (e.g., an EVM wallet and a Solana wallet), developers need to switch agent tokens dynamically per command. Injecting environment variables into Node.js child processes is error-prone, whereas passing a CLI flag is standard and declarative.