Skip to main content
The Aiven command-line interface (CLI) enables you to manage Aiven services and platform resources through terminal commands. The CLI uses the Aiven API and is ideal for scripting, automation, and rapid development workflows.

Installation

The Aiven CLI (avn) is distributed as a Python package and can be installed using pip or Homebrew.
For Python 3 specifically:

Verify installation

Check that the CLI is installed correctly:

Authentication

Authenticate with Aiven using your email and password or a personal token.
1

Login with email

2

Enter password

Enter your password when prompted

Getting started

After authentication, you can start managing your Aiven resources.

List projects

Set default project

List services

Common operations

Service management

Create a service

Create a PostgreSQL service:
Create a Kafka service with custom configuration:

Get service details

Get specific fields in custom format:
Get output in JSON:

Update a service

Scale to a different plan:
Move to a different cloud region:
Update configuration:

Power management

Power off a service (stops billing for compute):
Power on a service:

Delete a service

This permanently deletes the service and all data. This action cannot be undone.
Force deletion without confirmation:

Wait for service to be ready

Database operations

PostgreSQL and MySQL databases

List databases:
Create a database:
Delete a database:

User management

List service users:
Create a new user:
Reset user password:
Delete a user:

Apache Kafka operations

Topic management

List topics:
Create a topic:
Update topic configuration:
Delete a topic:

ACL management

List ACLs:
Add an ACL entry:
Delete an ACL:

Connection information

Get connection details:
Get specific connection format:

Service integrations

List available integration types:
Create an integration:
List integrations:

Advanced features

VPC management

List VPCs:
Create a VPC:
Create a VPC peering connection:

Service logs

View service logs:
Follow logs in real-time:

Metrics

Get service metrics:
Available periods: hour, day, week, month, year

Query statistics

List slow queries (PostgreSQL/MySQL):
Reset query statistics:

Maintenance

Start maintenance immediately:

Interactive shells

Open an interactive shell to a service:

Configuration

Output format

Get JSON output for any command:
Use custom formatting:

Project switching

Switch between projects:
Run a single command against a different project:

Configuration file

The CLI stores configuration in ~/.config/aiven/aiven-credentials.json

Service types and plans

List available service types:
View detailed service type information with all configuration options:
List available plans for a service type:
List available cloud regions:

Scripting tips

Error handling

Parse JSON output

Wait for service creation

Bulk operations

Common use cases

Troubleshooting

Check CLI version

Enable debug output

Re-authenticate