Skip to content

feat: support global --agent-token CLI flag for programmatic auth#89

Open
cyberalt3 wants to merge 1 commit into
zeriontech:mainfrom
cyberalt3:patch-1
Open

feat: support global --agent-token CLI flag for programmatic auth#89
cyberalt3 wants to merge 1 commit into
zeriontech:mainfrom
cyberalt3:patch-1

Conversation

@cyberalt3
Copy link
Copy Markdown

What does this PR do?

Currently, the zerion-cli does not parse or respect the --agent-token flag passed via command line arguments. Developers automating the CLI in CI/CD or wrapping it in child processes are forced to inject ZERION_AGENT_TOKEN into process.env.
This PR adds a global parser at the entry point to automatically map the --agent-token argument to process.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.

Added global interceptor for --agent-token flag to set environment variable.
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