Overview
The Nudgen CLI is designed with an AI-First approach. While it provides a beautiful TUI for humans, every command is also optimized for machine-to-machine communication.The Agentic Pattern
When an AI agent (like a Claude, GPT, or specialized automation agent) uses the CLI, it should follow these patterns:- JSON Output: Append
--jsonto every command to get machine-parseable data. - Context Awareness: Always verify the team context before performing operations.
- Non-Interactive: Use flags to bypass interactive TUI prompts.
JSON Automation
Every list and status command supports a--json flag. This returns a clean JSON structure instead of a formatted table.
Multi-tenant Workflow for Agents
Since Nudgen supports multiple teams, an agent must ensure it is operating on the correct team before creating or updating resources. Recommended Workflow:- Check Current Team:
- Switch Team (if needed):
If the
idfrom the previous step doesn’t match the target team, switch: - Execute Data Command:
Proceed with
campaigns,contacts, orbrandcommands.
Best Practices for Agent Developers
- Error Handling: Monitor the exit code of CLI commands. A non-zero exit code indicates an error (validation, network, or auth).
- Rate Limiting: The CLI communicates with the Nudgen API. Ensure your agent scripts handle potential rate limits gracefully.
- Silent Mode: If a command doesn’t support a specific flag for every prompt, ensure your agent can handle stdout/stderr streams without getting stuck in a TUI loop.