Skip to main content
The AWX CLI follows a consistent pattern for all operations: awx [options] <resource> <action> [arguments]. This guide covers common usage patterns and workflows.

Command Structure

Every AWX CLI command follows this format:
  • global-options: Configuration flags like --conf.host, -f, -v
  • resource: The type of AWX object (users, jobs, projects, etc.)
  • action: The operation to perform (list, get, create, modify, delete, etc.)
  • arguments: Action-specific parameters

Discovering Resources

To see all available resources:
This displays resources like:
  • users - User accounts
  • organizations - Organizations
  • projects - Project definitions
  • inventories - Inventory definitions
  • job_templates - Job templates
  • jobs - Job executions
  • credentials - Credentials
  • And many more…

Discovering Actions

To see available actions for a resource:
Common actions include:
  • list - List all resources
  • get - Get a specific resource by ID or name
  • create - Create a new resource
  • modify - Update an existing resource
  • delete - Delete a resource
Some resources have special actions like launch, update, monitor, etc.

Basic Operations

Listing Resources

List all resources of a type:
With human-readable output:
With custom columns:

Getting a Specific Resource

Retrieve by ID:
Retrieve by name (for resources that support it):
With human-readable output:

Creating Resources

Create a new resource:
To see required arguments:

Modifying Resources

Update an existing resource:

Deleting Resources

Delete by ID or name:

Advanced Operations

Filtering Lists

Filter results using query parameters:

Pagination

By default, the CLI returns the first page of results. To get all pages:

Sorting

Sort results by field:

Working with JSON/YAML Data

Many fields accept JSON or YAML input:

File References

For fields containing file data (like SSH keys):

Special Actions

Launching Jobs

Launch a job template:

Monitoring Jobs

Watch job output in real-time:
Get job stdout:

Updating Projects

Trigger a project update:

Inventory Updates

Update an inventory source:

Working with Relationships

Associating Resources

Associate credentials with job templates:
Associate notification templates:

Disassociating Resources

Granting and Revoking Permissions

Grant roles to users:
Revoke roles:
Grant roles to teams:

Bulk Operations

Bulk Host Creation

Bulk Host Deletion

Bulk Job Launch

Import/Export

Exporting Resources

Export all resources:
Export specific resource types:
Export specific resources by name:
Export by ID:
Export in YAML format:

Importing Resources

Import from JSON:
Import from YAML:

Configuration Commands

View Current Configuration

Output:

View System Settings

View specific setting category:

Modify Settings

Control Resources

Some resources provide metadata or system information:

Ping

Check API connectivity:

Config

View AWX configuration:

Me

View current user information:

Metrics

View system metrics:

Working with Ad Hoc Commands

Run ad hoc commands:

Output Formatting Examples

JSON Output (Default)

Human-Readable Tables

YAML Output

JQ Filtering

All Fields

Practical Examples

Create a Complete Job Template

Monitor Job History

Backup and Restore

Tips and Best Practices

  1. Use --help liberally - Every resource and action has detailed help
  2. Use names instead of IDs - More readable and maintainable
  3. Use --all for listings - Ensures you get all results, not just first page
  4. Use -f human for exploration - Easier to read during development
  5. Use -f json for automation - Consistent, parseable output
  6. Use --monitor during development - See job output in real-time
  7. Use --wait in scripts - Ensures jobs complete before continuing
  8. Store credentials in environment - More secure than command-line flags
  9. Use @file for large data - Cleaner than inline JSON
  10. Enable verbose mode for debugging - awx -v shows HTTP requests

Getting Help