### Install Nile CLI with bun Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Installs the Nile CLI globally using bun. Supports installing the latest stable or alpha versions. ```bash bun install -g niledatabase ``` ```bash bun install -g niledatabase@alpha ``` -------------------------------- ### Install Nile CLI with yarn Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Installs the Nile CLI globally using yarn. Supports installing the latest stable or alpha versions. ```bash yarn global add niledatabase ``` ```bash yarn global add niledatabase@alpha ``` -------------------------------- ### Install Nile CLI with npm Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Installs the Nile CLI globally using npm. Supports installing the latest stable or alpha versions. ```bash npm install -g niledatabase ``` ```bash npm install -g niledatabase@alpha ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/niledatabase/cli/blob/alpha/CONTRIBUTING.md Steps to clone the repository, install dependencies, build the project, and run tests. ```bash # Clone the repository git clone https://github.com/niledatabase/cli.git cd cli # Install dependencies npm install # Build the project npm run build # Run tests npm test ``` -------------------------------- ### Connect to Nile Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Establishes a connection to the Nile service. This is typically the first step in initial setup. ```bash nile connect ``` -------------------------------- ### Nile CLI Authentication Setup Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for setting up authentication in applications and generating environment variables. ```bash nile auth quickstart --nextjs ``` ```bash nile auth env ``` ```bash nile auth env --output .env.local ``` -------------------------------- ### Install Nile CLI Development Version Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Instructions for installing a specific development version of the Nile CLI using npm. This allows users to test pre-release features. ```bash npm install -g niledatabase@ ``` -------------------------------- ### Verify Nile CLI Installation Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Checks if the Nile CLI is installed correctly by displaying its version. ```bash nile --version ``` -------------------------------- ### Install Nile CLI with sudo (macOS/Linux) Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Installs the Nile CLI globally using sudo with npm, yarn, or bun, typically to resolve permission issues on macOS or Linux. ```bash sudo npm install -g niledatabase ``` ```bash sudo yarn global add niledatabase ``` ```bash sudo bun install -g niledatabase ``` -------------------------------- ### Build Nile CLI from Source Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Steps to build the Nile CLI from its source code. This involves cloning the repository, installing dependencies, building the project, and linking it globally. ```bash git clone https://github.com/niledatabase/nile-cli.git cd nile-cli npm install npm run build npm link ``` -------------------------------- ### Troubleshoot Nile CLI npm Installation Permissions Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Provides two methods to resolve permission errors during npm installation of the Nile CLI. The recommended method involves configuring npm to use a global directory, while the alternative uses sudo. ```bash # Recommended approach - Fix npm permission: mkdir ~/.npm-global npm config set prefix '~/.npm-global' export PATH=~/.npm-global/bin:$PATH # Alternative approach - Use sudo (not recommended): sudo npm install -g niledatabase ``` -------------------------------- ### Conventional Commits Examples Source: https://github.com/niledatabase/cli/blob/alpha/CONTRIBUTING.md Examples of commit messages following the Conventional Commits specification for different types of changes. ```bash feat: add new feature fix: resolve specific issue docs: update documentation ``` -------------------------------- ### Connect to Nile via Browser Authentication Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing browser-based authentication with Nile, including starting the login flow, checking status, and logging out. ```bash # Start the authentication flow nile connect login # Check connection status nile connect status # Logout when needed nile connect logout ``` -------------------------------- ### Start Development Branching Source: https://github.com/niledatabase/cli/blob/alpha/CONTRIBUTING.md Commands to create a new feature branch from the 'alpha' branch for development. ```bash git checkout alpha git pull origin alpha git checkout -b feature/your-feature-name ``` -------------------------------- ### Nile CLI Help and Version Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Displays the help information and version of the Nile CLI. ```bash nile --help ``` ```bash nile --version ``` -------------------------------- ### Verify Configuration Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Displays the current Nile CLI configuration, including workspace and database settings. ```bash nile config ``` -------------------------------- ### Nile CLI Database Listing and Creation Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing databases within the Nile CLI, including listing databases, showing specific database details, listing available regions, and creating new databases. ```bash # List all databases in current workspace nile db list # Show specific database details nile db show mydb # List available regions nile db create --region # Lists regions if no region specified # Create a new database nile db create --name mydb --region AWS_US_WEST_2 ``` -------------------------------- ### Connect to Nile using API Key Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Demonstrates how to use an API key for connecting to Nile, either directly in commands or by saving it to the CLI configuration. ```bash # Use API key directly in commands nile --api-key YOUR_API_KEY db list # Or save it in configuration nile config --api-key YOUR_API_KEY ``` -------------------------------- ### Nile CLI Database Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing databases in Nile, including listing, showing, creating, deleting, and connecting via psql. ```bash nile db list ``` ```bash nile db show ``` ```bash nile db create --name --region ``` ```bash nile db delete ``` ```bash nile db psql ``` ```bash nile db connectionstring --psql ``` ```bash nile db regions ``` ```bash nile db copy --table-name --format csv --file-name ``` -------------------------------- ### Connect to Nile using Environment Variables Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Shows how to set the Nile API key using an environment variable for authentication. ```bash export NILE_API_KEY=YOUR_API_KEY ``` -------------------------------- ### Connect using psql Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Opens a psql client connected to the specified Nile database. ```bash nile db psql --name mydb ``` -------------------------------- ### Nile CLI Workspace Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing workspaces in Nile, including listing, showing details, and setting the default workspace. ```bash nile workspace list ``` ```bash nile workspace show ``` ```bash nile config --workspace ``` -------------------------------- ### Nile CLI Configuration Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing Nile CLI configuration settings, including viewing, setting workspace and database, setting API key, and resetting configuration. ```bash # View current configuration nile config # Set workspace and database nile config --workspace demo --db mydb # Set API key nile config --api-key YOUR_API_KEY # Reset configuration nile config reset ``` -------------------------------- ### Create Tenant Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Creates a new tenant in Nile. You can either let Nile auto-generate an ID or provide a custom ID. ```bash nile tenants create --name "My Tenant" ``` ```bash nile tenants create --name "My Tenant" --id custom-id ``` -------------------------------- ### Run Tests and Linting Source: https://github.com/niledatabase/cli/blob/alpha/CONTRIBUTING.md Commands to execute tests and linting to ensure code quality and style compliance. ```bash npm test npm run lint ``` -------------------------------- ### Nile CLI Tenant Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing tenants in Nile, including listing, creating, updating, and deleting tenants. ```bash nile tenants list ``` ```bash nile tenants create --name "Name" ``` ```bash nile tenants create --name "Name" --id custom-id ``` ```bash nile tenants update --id --new_name "Name" ``` ```bash nile tenants delete --id ``` -------------------------------- ### List Databases (Human-readable) Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Lists databases in a human-readable format, which is the default output for the CLI. ```bash nile db list ``` -------------------------------- ### List Databases (JSON) Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Lists databases and formats the output as JSON for easier programmatic parsing. ```bash nile --format json db list ``` -------------------------------- ### Nile CLI Configuration Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for viewing, setting, and resetting Nile CLI configuration options. ```bash nile config ``` ```bash nile config --api-key ``` ```bash nile config --workspace ``` ```bash nile config --db ``` ```bash nile config reset ``` -------------------------------- ### Nile CLI Workspace Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing workspaces in the Nile CLI, including listing workspaces, showing current workspace details, and setting the default workspace. ```bash # List all available workspaces nile workspace list # Show current workspace details nile workspace show # Set default workspace nile config --workspace demo ``` -------------------------------- ### Nile CLI Environment Variables for Configuration Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Lists the environment variables that can be used to configure the Nile CLI, including API key, workspace, database, and custom host settings. ```bash - NILE_API_KEY: API key for authentication - NILE_WORKSPACE: Default workspace - NILE_DB: Default database - NILE_DB_HOST: Custom database host (optional) - NILE_GLOBAL_HOST: Custom global host (optional) ``` -------------------------------- ### Set Default Workspace and Database Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Configures the default workspace and database for subsequent Nile CLI commands. ```bash nile config --workspace demo --db mydb ``` -------------------------------- ### Nile CLI Database Connection and Deletion Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for connecting to databases using the Nile CLI, including using psql, retrieving connection strings, and deleting databases. ```bash # Connect using psql (requires PostgreSQL client tools) nile db psql --name mydb # Get connection string nile db connectionstring --name mydb # Delete a database (use --force to skip confirmation) nile db delete mydb ``` -------------------------------- ### Nile CLI Local Development Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing the local development environment for Nile. ```bash nile local start ``` ```bash nile local stop ``` ```bash nile local info ``` -------------------------------- ### Nile CLI Database Data Import Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Instructions for importing data into Nile database tables using the `nile db copy` command. It covers basic usage and optional parameters like delimiter and column list. ```bash # Basic usage nile db copy --table-name products --format csv --file-name products.csv # With optional parameters nile db copy \ --table-name products \ --format csv \ --file-name products.csv \ --delimiter "," \ --column-list "id,name,price" \ --debug # Parameters: # --table-name Target table name (required, must exist in database) # --format File format: csv or text (required) # --file-name Input file path (required) # --delimiter Column delimiter character (optional, default: comma for CSV) # --column-list Comma-separated list of column names (optional) ``` -------------------------------- ### Create Database Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Creates a new database within Nile, specifying the name and AWS region. ```bash nile db create --name mydb --region AWS_US_WEST_2 ``` -------------------------------- ### Nile CLI User Management Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Commands for managing users in Nile, including creating, listing, updating, and deleting users. ```bash nile users create --email "user@example.com" --password "password123" ``` ```bash nile users create --email "user@example.com" --password "pass123" --tenant tenant-123 ``` ```bash nile users list ``` ```bash nile users update --id user-123 --new_email "new@example.com" ``` ```bash nile users delete --id user-123 ``` -------------------------------- ### Nile CLI Global Options Source: https://github.com/niledatabase/cli/blob/alpha/readme.md These are global options that can be used with any Nile CLI command to control authentication, workspace, database, output format, and debugging. ```bash --api-key # API key for authentication --workspace # Workspace to use --db # Database to use --format # Output format: human (default), json, or csv --color # Enable colored output (default: true) --no-color # Disable colored output --debug # Enable debug output ``` -------------------------------- ### Nile CLI Authentication Commands Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Manages authentication with Nile, including logging in, checking status, and logging out. ```bash nile connect login ``` ```bash nile connect status ``` ```bash nile connect logout ``` -------------------------------- ### List Databases (CSV) Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Lists databases and formats the output as CSV, suitable for spreadsheet applications or data analysis. ```bash nile --format csv db list ``` -------------------------------- ### List Tenants Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Lists all tenants within the Nile system. This command is part of the tenant management functionality. ```bash nile tenants list ``` -------------------------------- ### Nile CLI Output Formats Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Demonstrates how to use the --format option to change the output of Nile CLI commands. Supports human-readable, JSON, and CSV formats. ```bash # Human-readable (default) nile db list # JSON format nile --format json db list # CSV format nile --format csv db list ``` -------------------------------- ### Enable Debug Output Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Enables detailed debug output for the 'db list' command, useful for troubleshooting. ```bash nile --debug db list ``` -------------------------------- ### TypeScript Coding Style Source: https://github.com/niledatabase/cli/blob/alpha/CONTRIBUTING.md Coding style guidelines for new TypeScript code, including indentation and linting. ```typescript // Use TypeScript for all new code // 2 spaces for indentation // Run `npm run lint` to ensure style compliance ``` -------------------------------- ### Add npm global bin to PATH (Linux) Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Adds the npm global bin directory to the PATH environment variable in .bashrc or .zshrc for Linux systems to ensure the CLI is accessible. ```bash export PATH="$PATH:$(npm config get prefix)/bin" ``` ```bash source ~/.bashrc # or source ~/.zshrc ``` -------------------------------- ### Delete Tenant Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Deletes a tenant from the Nile system. Requires the tenant's ID. ```bash nile tenants delete --id tenant-123 ``` -------------------------------- ### Update Tenant Name Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Updates the name of an existing tenant. Requires the tenant's ID and the new name. ```bash nile tenants update --id tenant-123 --new_name "New Name" ``` -------------------------------- ### Check Connection Status Source: https://github.com/niledatabase/cli/blob/alpha/readme.md Checks the current connection status of the Nile client. ```bash nile connect status ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.