DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

nylas audit logs show for Developers â Quick Reference

View and filter audit log entries. Supports filtering by date range, command, status, grant, request ID, invoker, and source. Essential for SOC 2 compliance and AI agent oversight.

The nylas audit logs show command displays recorded CLI activity with filters for date range, command name, exit status, grant ID, request ID, invoker (claude-code, cursor, terminal), and source (cli, mcp, sdk). Use it to trace what an AI agent did, investigate errors, or generate compliance reports.

Syntax

nylas audit logs show [--since DATE] [--until DATE] [--command CMD] [--invoker NAME]
Enter fullscreen mode Exit fullscreen mode

How It Works

Every entry in the audit log captures: the exact command, all arguments (with secrets redacted), the invoker identity (human or AI agent name), the exit code, and a nanosecond timestamp. This level of detail is what compliance auditors expect.

Examples

Show recent logs:

nylas audit logs show -n 20
Enter fullscreen mode Exit fullscreen mode

Filter by AI invoker:

nylas audit logs show --invoker claude-code --since 2024-01-01
Enter fullscreen mode Exit fullscreen mode

Filter by date range:

nylas audit logs show --request-id req_abc123
Enter fullscreen mode Exit fullscreen mode

JSON output piped to jq:

nylas audit logs show --json -n 100 | jq '.[] | select(.status == \
Enter fullscreen mode Exit fullscreen mode

Key Flags

Run nylas audit logs show --help to see all available flags. Add --json for machine-readable output — useful when piping into jq or feeding data to scripts.

nylas audit logs show --help
Enter fullscreen mode Exit fullscreen mode

Common Issues

No logs found
Ensure audit logging is enabled with nylas audit logs status. If recently initialized, run a few commands first.

Date filter not working
Use ISO 8601 format (YYYY-MM-DD) or relative formats like '7d', '24h'.


Full docs: nylas audit logs show reference — all flags, advanced examples, and troubleshooting.

All commands: Nylas CLI Command Reference

Get started: brew install nylas/nylas-cli/nylas — other install methods

Top comments (0)