DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Initialize audit logging for the Nylas CLI. Creates the log directory, default configuration, and optionally enables logging ...

Compliance and debugging both need logs. nylas audit init handles the initialize audit logging for the nylas cli. creates the log directory, default configuration, and optionally enables logging immediately.

The nylas audit init command sets up audit logging to record every CLI command execution with timestamps, arguments, and outcomes. Logs are stored locally in JSON or text format with configurable retention (default 90 days) and max file size (default 50 MB).

Syntax

nylas audit init [--path DIR] [--retention DAYS] [--enable]
Enter fullscreen mode Exit fullscreen mode

Examples

Interactive setup:

nylas audit init
# Follow prompts to configure retention, format, and storage
Enter fullscreen mode Exit fullscreen mode

Non-interactive (CI/automation):

nylas audit init --retention 30 --format json --enable --no-prompt
Enter fullscreen mode Exit fullscreen mode

Custom storage path:

nylas audit init --path /var/log/nylas-audit --max-size 100 --enable
Enter fullscreen mode Exit fullscreen mode

When to Use This

Reach for nylas audit init for compliance reporting, AI agent oversight, or debugging automation failures. Combine with --json to pipe output into other tools.

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.

Related Commands

  • nylas audit logs show — View and filter audit log entries. Supports filtering by date range, command, st
  • nylas audit logs summary — View summary statistics of audit log entries including command counts, error rat
  • nylas audit logs clear — Clear all audit log entries. This is a destructive action — consider exporting l
  • nylas audit export — Export audit logs to JSON or CSV for compliance, analysis, or backup

Full docs: nylas audit init 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)