Skip to main content
The Nile CLI provides a powerful set of commands for managing your databases. With the CLI, you can create, delete, and manage databases, connect to them using standard PostgreSQL tools, and more.
Available commands:
  • list - View all databases
  • show - Display database details
  • create - Create a new database
  • delete - Remove a database
  • regions - List available regions
  • psql - Connect using PostgreSQL CLI
  • connectionstring - Get connection details

Setting Workspace

Before using the nile db command, you can set the workspace to operate in.

Example

Workspace Example
The workspace can also be set using the NILE_WORKSPACE environment variable or by using the flag --workspace in the command.

Listing Databases

The list command shows all databases in your workspace.

Options

Examples

List Examples

Setting active database in config

You can set the active database in the config file. This simplifies other db commands. Youc an also override the db name using the flag --database in the command.

Example

Showing Database Details

The show command provides detailed information about a specific database.

Options

Examples

Show Examples

Listing Regions

The regions command shows available regions for database creation.

Options

Examples

Region Examples

Creating Databases

The create command sets up a new database in your workspace.

Required Options

Additional Options

Examples

Create Examples
Use the nile db region command to see the available regions. After creating the db, you can use the nile db show command to see the database details. You also want to set the config to the db you just created.

Deleting Databases

The delete command removes a database permanently.

Options

Examples

Delete Examples

Using PostgreSQL CLI

The psql command opens an interactive PostgreSQL terminal.

Options

Examples

PSQL Examples

Getting Connection Strings

The connectionstring command provides database connection details. Currently, it only supports the psql format.

Examples

Connection String Examples

Importing Data

The copy command allows you to import data from files into database tables. The target table must already exist in the database with the appropriate columns that match your input data.

Required Options

Additional Options

Examples

Copy Examples

Features

  • Shows progress bar with completion status and import speed
  • Supports CSV files with headers
  • Allows custom column mapping
  • Provides detailed progress information in debug mode
  • Processes data in batches for optimal performance
Make sure your target table exists and has the correct schema before running the import. The columns in your input file should match the table’s structure.

Common Workflows

Setting Up a New Database

New Database Workflow

Managing Multiple Environments

Environment Management

Database Cleanup

Cleanup Workflow

Getting Help

For detailed help on any command: