CLI Reference — ODAC Docs
Docs / ODAC / Server / Getting Started / CLI Reference

📖 CLI Reference

This comprehensive reference covers all Odac CLI commands and their usage patterns, including both interactive and single-line modes with prefix arguments.

Command Structure

Odac CLI follows a hierarchical command structure:

odac [command] [subcommand] [prefixes] [arguments]

Prefix Arguments

Most commands support prefix arguments that allow you to provide values directly in the command line, avoiding interactive prompts. This is especially useful for automation, scripting, and quick operations.

Common Prefixes

  • -d, --domain: Domain name
  • -e, --email: Email address
  • -p, --password: Password
  • -i, --id: Service ID or name
  • -k, --key: Authentication key

Authentication Commands

odac auth

Define your server to your Odac account.

Interactive:

odac auth

Single-line:

odac auth -k your-auth-key
odac auth --key your-auth-key

Basic Server Commands

odac (no arguments)

Display server status, uptime, and statistics.

odac restart

Restart the Odac server.

odac monit

Monitor websites and services in real-time.

odac debug

View live server and application logs.

odac help

Display help information for all commands.

Service Management

odac run <file>

Add a new service by specifying the entry file path.

Example:

odac run /path/to/your/app.js
odac run ./index.js

odac service delete

Delete a running service.

Interactive:

odac service delete

Single-line:

odac service delete -i service-name
odac service delete --id service-name

Website Management

odac web create

Create a new website configuration.

Interactive:

odac web create

Single-line:

odac web create -d example.com
odac web create --domain example.com

odac web delete

Delete a website configuration.

Interactive:

odac web delete

Single-line:

odac web delete -d example.com
odac web delete --domain example.com

odac web list

List all configured websites.

odac web list

Domain Management

odac domain add

Add a new domain and link it to an application. This automatically sets up DNS and SSL.

Interactive:

odac domain add

Single-line:

odac domain add -d example.com -i my-app
odac domain add --domain example.com --id my-app

odac domain delete

Delete a domain configuration and its DNS records.

Interactive:

odac domain delete

Single-line:

odac domain delete -d example.com
odac domain delete --domain example.com

odac domain list

List all domains or filter by application.

Interactive:

odac domain list

Single-line:

odac domain list -i my-app
odac domain list --id my-app

SSL Certificate Management

odac ssl renew

Renew SSL certificate for a domain.

Interactive:

odac ssl renew

Single-line:

odac ssl renew -d example.com
odac ssl renew --domain example.com

Mail Account Management

odac mail create

Create a new email account.

Interactive:

odac mail create

Single-line:

odac mail create -e user@example.com -p password123
odac mail create --email user@example.com --password password123

odac mail delete

Delete an email account.

Interactive:

odac mail delete

Single-line:

odac mail delete -e user@example.com
odac mail delete --email user@example.com

odac mail list

List all email accounts for a domain.

Interactive:

odac mail list

Single-line:

odac mail list -d example.com
odac mail list --domain example.com

odac mail password

Change password for an email account.

Interactive:

odac mail password

Single-line:

odac mail password -e user@example.com -p newpassword
odac mail password --email user@example.com --password newpassword

Usage Tips

Automation and Scripting

Single-line commands with prefixes are perfect for automation:

#!/bin/bash
# Create multiple email accounts
odac mail create -e admin@example.com -p admin123
odac mail create -e support@example.com -p support123
odac mail create -e sales@example.com -p sales123

# Set up subdomains
odac domain add -d blog.example.com -i my-app
odac domain add -d shop.example.com -i my-app
odac domain add -d api.example.com -i my-app

Mixed Usage

You can mix interactive and single-line modes as needed:

# Specify domain, but let the system prompt for other details
odac web create -d example.com

Password Security

When using password prefixes (-p, --password):

  • Interactive mode requires password confirmation
  • Single-line mode skips confirmation for automation
  • Consider using environment variables for sensitive data in scripts
# Using environment variable
odac mail create -e user@example.com -p "$MAIL_PASSWORD"

Error Handling

If a command fails or you provide invalid arguments, Odac will display helpful error messages and suggest corrections. Use odac help [command] to get specific help for any command.