Command

nylas audit init

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

Written by Qasim Muhammad Staff SRE

What does nylas audit init do?

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). Use audit logs to track AI agent activity, meet compliance requirements, or debug automation pipelines.

Usage

nylas audit init [--path DIR] [--retention DAYS] [--enable]

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations
--pathCustom directory for audit log storage
--retentionLog retention period in days (default: 90)
--max-sizeMaximum log file size in MB (default: 50)
--formatLog format: json or text (default: json)
--enableEnable logging immediately after initialization
--no-promptSkip interactive prompts (use defaults)

Examples

The nylas audit init command sets up audit logging to record every CLI command execution with timestamps, arguments, and outcomes.

Interactive setup

nylas audit init
# Follow prompts to configure retention, format, and storage

Non-interactive (CI/automation)

nylas audit init --retention 30 --format json --enable --no-prompt

Custom storage path

nylas audit init --path /var/log/nylas-audit --max-size 100 --enable

Example output

✓ Audit logging initialized
  Log directory: ~/.config/nylas/audit
  Format: jsonl
  Retention: 90 days
  Max size: 50 MB
  Status: enabled

Troubleshooting

Permission denied when creating log directory

Ensure you have write permissions to the target path, or use --path to specify an accessible directory.

Audit already initialized

Run `nylas audit config show` to see current settings. Use `nylas audit config set` to modify individual values.

Recommended guides

Run nylas audit init --help for full help output.