VOOZH about

URL: https://cli.nylas.com/docs/commands/audit-init

⇱ nylas audit init command | Nylas CLI


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

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.

Related commands

nylas audit config set

Set an audit configuration value. Valid keys: retention_days, max_size_mb, rotate_daily, compress_old, log_request_id, log_api_details.

nylas audit config show

Show the current audit configuration, including log path, retention, rotation, and compression settings.

nylas audit export

Export audit logs to JSON or CSV for compliance, analysis, or backup.

nylas audit logs clear

Clear all audit log entries. This is a destructive action — consider exporting logs first with `nylas audit export`.

nylas audit logs disable

Disable audit logging. Stops recording CLI activity to the audit log file.

nylas audit logs enable

Enable audit logging. Records all CLI activity to a local log file for compliance and debugging.

Recommended guides

Thunderbird vs Nylas: GUI vs CLI email

Thunderbird is a desktop GUI email client with OAuth and calendar built in. Compare it to a scriptable, headless CLI for servers, cron jobs, and AI agents.

Pipedream vs Nylas for Email Automation

Pipedream wires 3,000+ apps with event workflows and code steps. Nylas is a native email API with a CLI for agents and cron. Compare as a Pipedream alternative.

Detect Calendar Conflicts from the CLI

Spot double-booked meetings and overlapping events from the terminal. AI conflict detection and jq scripts catch calendar conflicts before they derail your day.

Block Focus Time on Your Calendar (CLI)

Context-switching costs 23 minutes of focus per interruption. Block focus time on Google Calendar from your terminal so meetings can't eat your deep-work slots.

Build a Strands Email Agent

Give a Strands Agents SDK agent email access using the Nylas CLI as a @tool. One function reaches Gmail, Outlook, and 4 more providers — no OAuth code needed.

Cloudflare Agents Email Tools

Use the Cloudflare Agents SDK to build a stateful email agent on Workers — connect to the Nylas MCP server over HTTP and call email tools in TypeScript.

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