### Start Interactive Astra CLI Setup Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-setup.adoc Initiates the interactive setup process for the Astra CLI. This is the primary command for users who prefer guided configuration. ```bash # Start the interactive setup process $ astra setup ``` -------------------------------- ### Interactive Setup for Configuration Profile Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config.adoc Initiate an interactive setup process to create a new configuration profile. This is useful for guided configuration. ```shell astra config setup ``` -------------------------------- ### Interactively create a new profile Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config-create.adoc Use the interactive setup command to guide through the process of creating a new profile. ```bash astra setup ``` -------------------------------- ### Astra CLI Setup and Database Management Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/index.adoc Use 'astra setup' to configure connection profiles. Create databases with 'astra db create' specifying the region. Manage streaming tenants with 'astra streaming list'. ```bash # Set up connection profiles astra setup ``` ```bash # Manage databases astra db create my_db -r us-east1 ``` ```bash # Manage streaming tenants astra streaming list ``` ```bash # Run built-in utilities astra db cqlsh start my_db ``` ```bash astra streaming pulsar shell my_tenant ``` -------------------------------- ### Display cqlsh Version Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-cqlsh-version.adoc Use this command to display the currently installed cqlsh's version. No special setup is required. ```bash astra db cqlsh version ``` -------------------------------- ### Astra CLI Command Help Output Example Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/manage-cli.adoc This is an example of the help output for the 'astra org' command. It details usage, common options, connection options (including `--token`), and available subcommands for organization management. ```console Usage: astra org [-qV] [--no-input] [--[no-]spinner] [--dump-logs[=FILE]] [--color=WHEN] [-o=FORMAT] [[[-cf=PATH] [-p=NAME]] | [--token=TOKEN [--env=ENV]]] [COMMAND] Get organization information The --token flag is handy to quickly get information about another organization. Use the --token @file syntax to read the token from a file, to avoid potential leaks. Common Options: --color=WHEN One of: auto, never, always (default: auto) --dump-logs[=FILE] Write all logs to an optionally specified file (default: ~/.astra/logs/.log) --no-input Don't ask for user input (e.g. confirmation prompts) -o, --output=FORMAT One of: human, json, csv (default: human) -q, --quiet Only output essential information --[no-]spinner Enable/disable loading spinners (default: enabled if tty) -V, --verbose Enable verbose logging output Connection Options: -cf, --config-file=PATH The .astrarc file to use for this command (default: ~/.astrarc) --env=ENV Override the target astra environment -p, --profile=NAME The .astrarc profile to use for this command --token=TOKEN The astra token to use for this command. Use the --token @file syntax to read the token from a file, to avoid potential leaks. Commands: get Get your organization's information id Get your organization's ID name Get your organization's name Examples: # Get your organization's information $ astra org # Get information about another organization $ astra org get --token AstraCS:... See 'astra --help' for help on a specific subcommand. ``` -------------------------------- ### Get Organization Information Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org-get.adoc Use this command to retrieve your organization's information. No specific setup is required if you are already authenticated. ```shell astra org get [-qV] [--no-input] [--[no-]spinner] [--color[=WHEN]] [--dump-logs [=FILE]] [-o=FORMAT] [[[-cf=PATH] [-p=NAME]] | [--token=TOKEN [--env=ENV]]] ``` -------------------------------- ### List Astra Databases Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-list.adoc Use this command to list all your Astra databases. No special setup is required beyond having the astra-cli installed and configured. ```bash astra db list ``` -------------------------------- ### Verify Datastax CLI Installation Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc Run this command from any directory to verify that the Datastax CLI has been successfully installed. The response will include available commands and options. ```shell astra ``` -------------------------------- ### Create New Configuration Profile Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/manage-cli.adoc Creates a new configuration profile with a specified name and application token. An interactive setup is also available via 'astra setup'. ```shell astra config create '**PROFILE_NAME**' --token ** APPLICATION_TOKEN ** ``` -------------------------------- ### Display Pulsar Version Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-streaming-pulsar-version.adoc Use this command to show the currently installed Pulsar version. No specific setup is required beyond having the Astra CLI installed. ```bash astra streaming pulsar version ``` -------------------------------- ### Get Help for a Specific Command Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/manage-cli.adoc Append the `-h` or `--help` option to any command to get specific help information and examples for that command. This is useful for understanding command-specific options and subcommands. ```shell astra org -h ``` -------------------------------- ### Add Datastax CLI to PATH (Binary Install) Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc Add these lines to your shell profile to make the 'astra' command executable from any directory after a binary installation. ```bash export PATH=$PATH:**INSTALLATION_DIRECTORY**/astra-cli/bin ``` -------------------------------- ### Create a basic streaming tenant Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-streaming-create.adoc Creates a new streaming tenant named 'my_tenant' in the 'us-east1' region. This is a fundamental example of tenant provisioning. ```bash # Create a basic streaming tenant in the 'us-east1' region $ astra streaming create my_tenant --region us-east1 ``` -------------------------------- ### Display DSBulk Version Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-dsbulk-version.adoc Use this command to display the currently installed DSBulk version. No special setup is required beyond having the Astra CLI installed. ```shell astra db dsbulk version [-qV] [--no-input] [--[no-]spinner] [--color[=WHEN]] [--dump-logs[=FILE]] [-o=FORMAT] [[[-cf=PATH] [-p=NAME]] | [--token=TOKEN [--env=ENV]]] ``` ```bash # Display dsbulk's version information $ astra db dsbulk version ``` -------------------------------- ### Get Help for a Specific Subcommand Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/manage-cli.adoc Append the `-h` or `--help` option to any subcommand to get specific help information and examples for that subcommand. This provides detailed usage for actions within a command. ```shell astra db list --help ``` -------------------------------- ### List Available Cloud Providers Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-list-clouds.adoc Use this command to see all cloud providers and regions supported by Astra DB. No special setup is required beyond having the Astra CLI installed. ```bash astra db list-clouds ``` -------------------------------- ### Start cqlsh for a database Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-cqlsh-start.adoc Launches the cqlsh shell for a specified Astra database. Ensure the database name or ID is provided. ```bash astra db cqlsh start my_db ``` -------------------------------- ### List All Users in Organization Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-user-list.adoc Use this command to display all users associated with your organization. No special setup is required beyond having the Astra CLI installed and authenticated. ```bash # List all users in your organization $ astra user list ``` -------------------------------- ### Get Organization Information (Default) Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org-get.adoc Run this command without any flags to get information about your current organization. Ensure you are authenticated. ```bash # Get your organization's information $ astra org ``` -------------------------------- ### Describe a collection in the default keyspace Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-describe-collection.adoc Use this command to get details of a collection when it resides in the default keyspace. ```bash astra db describe-collection my_db -c my_collection ``` -------------------------------- ### List all PCU groups Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-pcu-list.adoc Use this command to display all your provisioned capacity unit groups. No additional setup is required if you are already authenticated. ```bash astra pcu list ``` -------------------------------- ### Install Astra CLI with Homebrew Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc Use this Homebrew command to install the latest version of the Astra CLI on macOS. After installation, verify by running the `astra` command. ```shell brew install datastax/astra-cli/astra ``` -------------------------------- ### Install Datastax CLI with Curl Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc Use this command to install the latest version of the Datastax CLI to the default location on macOS and Linux. ```shell curl -sSL https://ibm.biz/astra-cli | sh ``` -------------------------------- ### List Astra CLI Configurations Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config-list.adoc Use this command to list all configured Astra CLI environments. No special setup is required. ```bash astra config list ``` -------------------------------- ### Install Astra CLI on Windows (Scripted) Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc This PowerShell command installs the latest Astra CLI version to the default location on Windows. For a custom location, set the ASTRA_HOME environment variable first. ```powershell powershell -c "irm https://ibm.biz/astra-cli-win | iex" ``` -------------------------------- ### Describe a collection in a specific keyspace Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-describe-collection.adoc Use this command to get details of a collection when it is in a specific keyspace. ```bash astra db describe-collection my_db -k my_keyspace -c my_collection ``` -------------------------------- ### Transfer Datacenter Association Example Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-pcu-transfer-association.adoc Example of transferring a datacenter association from one PCU group to another using the astra CLI. Ensure you replace placeholder values with your actual IDs and group names. ```bash # Transfer a datacenter association association from one PCU group to another $ astra pcu transfer-association ee6991af-7783-4de9-8da0-c7fa250c89e2-1 --from pcu_1 --to pcu_2 ``` -------------------------------- ### Connect to a specific keyspace in cql-shell Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/quickstarts/pages/cqlsh.adoc Use the -k or --keyspace option when starting an interactive cql-shell session to connect directly to a specified keyspace. ```shell astra db cqlsh start **DB_ID** -k **KEYSPACE_NAME** ``` -------------------------------- ### Get dsbulk Path Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-dsbulk-path.adoc Retrieves the file system path to the currently installed dsbulk executable. If dsbulk is not installed, it may prompt for installation. ```APIDOC ## GET /api/v1/dsbulk/path ### Description Get the path to the currently installed dsbulk executable. ### Method GET ### Endpoint /api/v1/dsbulk/path ### Parameters #### Query Parameters - **if-exists** (boolean) - Optional - Only return path if dsbulk exists, don't install automatically. - **q**, **quiet** (boolean) - Optional - Only output essential information. - **V**, **verbose** (boolean) - Optional - Enable verbose logging output. - **spinner** (boolean) - Optional - Enable/disable loading spinners. - **no-input** (boolean) - Optional - Don't ask for user input (e.g. confirmation prompts). - **color** (string) - Optional - One of: auto, never, always. - **dump-logs** (string) - Optional - Write all logs to an optionally specified file. - **o**, **output** (string) - Optional - One of: human, json, csv. - **cf**, **config-file** (string) - Optional - The `.astrarc` file to use for this command. - **p**, **profile** (string) - Optional - The `.astrarc` profile to use for this command. Can be set via `ASTRA_PROFILE`. - **token** (string) - Optional - The astra token to use for this command. Use the `--token @file` syntax to read the token from a file, to avoid potential leaks. - **env** (string) - Optional - Override the target astra environment. ### Request Example ```bash astra db dsbulk path ``` ### Response #### Success Response (200) - **path** (string) - The file system path to the dsbulk executable. #### Response Example ```json { "path": "/usr/local/bin/dsbulk" } ``` ``` -------------------------------- ### Get cqlsh Path Conditionally Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-cqlsh-path.adoc Retrieve the cqlsh executable path only if cqlsh is already installed. If not installed, the command will not attempt to install it and will likely return an error or empty path. ```bash astra db cqlsh path --if-exists ``` -------------------------------- ### Create and set a new profile as default Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config-use.adoc This example demonstrates how to create a new profile and simultaneously set it as the default using the `--default` flag. Ensure `@token.txt` contains your authentication token. ```bash # Set a profile as the default when creating it $ astra config create my_profile -t @token.txt --default ``` -------------------------------- ### Get a specific configuration key Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config-get.adoc Retrieve the value of a single configuration key, such as the application token, for a specified profile. ```bash astra config get my_profile --key ASTRA_DB_APPLICATION_TOKEN ``` -------------------------------- ### Get API Endpoint for a Database in a Specific Region Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-endpoints-api.adoc This example shows how to get the API endpoint for an Astra database located in a particular region. ```bash # Get the API endpoint for the database in a specific region $ astra db endpoints api mydb --region us-east1 ``` -------------------------------- ### Get streaming tenant info Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-streaming-get.adoc Use this command to retrieve general information about a specific streaming tenant. Ensure the tenant name is provided. ```bash astra streaming get my_tenant ``` -------------------------------- ### Create .env file with specific keys Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-dotenv.adoc Create a .env file specifying only the desired keys to include. ```bash astra db create-dotenv --keys ASTRA_DB_APPLICATION_TOKEN,ASTRA_DB_API_ENDPOINT ``` -------------------------------- ### Get GraphQL Playground for a Database Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-endpoints-playground.adoc Use this command to open the GraphQL Playground for your specified Astra database. Ensure the database name is correct. ```bash # Get the GraphQL Playground for the database $ astra db endpoints playground mydb ``` -------------------------------- ### Create .env file with preset Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-dotenv.adoc Create a .env file using a preset, which defines a specific set of keys. ```bash astra db create-dotenv --preset data_api_client ``` -------------------------------- ### Load CSV with Header Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-dsbulk-load.adoc Example of loading a CSV file that includes a header row. Ensure the database, keyspace, and table names are correctly specified. ```bash # Load a CSV that includes a header row $ astra db dsbulk load my_db -k my_keyspace -t customers --url dsbulk_samples/customers.csv --header ``` -------------------------------- ### Get DSBulk Path Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-dsbulk-path.adoc Retrieves the path to the currently installed dsbulk executable. This is the most basic usage. ```bash astra db dsbulk path ``` -------------------------------- ### Create .env file Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-dotenv.adoc Create a fully-populated .env file, updating the existing one if it exists. Defaults to '.env'. ```bash astra db create-dotenv ``` -------------------------------- ### Create .env file with keyspace and region Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-dotenv.adoc Create a .env file targeting a specific keyspace and region. ```bash astra db create-dotenv -k my_keyspace -r us-east1 ``` -------------------------------- ### Astra CLI Setup Command Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-setup.adoc Use this command to interactively set up the Astra CLI and create new profiles. It prompts for necessary information like tokens and environment details. ```shell astra setup [-qV] [--no-input] [--[no-]spinner] [--color[=WHEN]] [--dump-logs [=FILE]] [-e=ENV] [--name=NAME] [-o=FORMAT] [-t=TOKEN] ``` -------------------------------- ### List Astra Tokens Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-token-list.adoc Use this command to list information about your API tokens. No special setup is required if you have already configured your Astra CLI. ```bash # List your tokens' information $ astra token list ``` -------------------------------- ### Get Organization Name Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org-name.adoc Use this command to retrieve the name of your current organization. No special setup is required if you are already authenticated. ```bash astra org name ``` -------------------------------- ### List Configuration Profiles Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config.adoc Use this command to list all available configuration profiles. This is the default action when no subcommand is specified. ```shell astra config ``` -------------------------------- ### Create Astra Database with Specific Keyspace Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create.adoc This example demonstrates how to create an Astra database and assign a specific default keyspace during creation. The keyspace must be specified using the `-k` flag. ```bash astra db create my_db --region us-east1 -k my_keyspace ``` -------------------------------- ### Execute a CQL file Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/quickstarts/pages/cqlsh.adoc Use the -f or --file option to execute a script containing multiple CQL statements from a file. The example file demonstrates creating a table and inserting data. ```shell astra db cqlsh exec **DB_ID** -f sample.cql ``` ```cql -- Use a specific keyspace USE default_keyspace; -- Create a table CREATE TABLE IF NOT EXISTS users ( id UUID PRIMARY KEY, name TEXT, email TEXT ); -- Insert some data INSERT INTO users (id, name, email) VALUES (uuid(), 'Alice', 'alice@example.com'); INSERT INTO users (id, name, email) VALUES (uuid(), 'Bob', 'bob@example.com'); -- Query the data SELECT * FROM users; ``` -------------------------------- ### Get cqlsh Path Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-cqlsh-path.adoc Retrieve the file system path of the currently installed cqlsh executable. This command is useful for scripting or direct invocation. ```bash astra db cqlsh path ``` -------------------------------- ### Create Configuration Profile Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config.adoc Programmatically create a new configuration profile using the `create` subcommand. You can specify the profile name and provide authentication token from a file. ```shell astra config create my_profile --token @token.txt ``` -------------------------------- ### Get Astra Organization ID Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org-id.adoc Use this command to retrieve your organization's ID. No additional setup is required if the CLI is already configured. ```shell astra org id ``` -------------------------------- ### Create a CDC with Keyspace and Topic Partitions Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-cdc.adoc Creates a CDC specifying the keyspace and the number of topic partitions. ```bash astra db create-cdc my_db -k my_keyspace --table my_table --tenant my_tenant --topic-partitions 5 ``` -------------------------------- ### Get SwaggerUI Endpoint for a Database in a Specific Region Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-endpoints-swagger.adoc This example demonstrates how to fetch the SwaggerUI endpoint for an Astra database located in a particular region. ```bash # Get the SwaggerUI endpoint for the database in a specific region $ astra db endpoints swagger mydb --region us-east1 ``` -------------------------------- ### Get Pulsar Token for a Tenant Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-streaming-pulsar-token.adoc Use this command to retrieve the Pulsar token for a specified streaming tenant. Ensure you have the Astra CLI installed and configured. ```bash astra streaming pulsar-token my_tenant ``` -------------------------------- ### Get PCU group status Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-pcu-status.adoc Use this command to retrieve the current status of a specified PCU group. Ensure you have the astra CLI installed and configured. ```bash astra pcu status my_db ``` -------------------------------- ### Create a new profile with token from file Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config-create.adoc Securely create a new profile by reading the token from a file. Ensure the file contains only the token as plain text or a JSON string. ```bash astra config create my_profile -t @token.txt ``` -------------------------------- ### Astra CLI General Help Output Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/manage-cli.adoc This is an example of the general help output when running the 'astra' command. It includes version information, usage instructions, common options, and a list of available commands. ```console _____ __ / _ \ _______/ |_____________ / /_ \ / ___/\ __\_ __ \__ \ / | \___ \ | | | | \ //__ \_ \____|__ /____ > |__| |__| (____ / \/ \/ \/ Version: x.x.x Documentation: https://docs.datastax.com/en/astra-cli Usage: astra [-qVv] [--no-input] [--[no-]spinner] [--dump-logs[=FILE]] [--color=WHEN] [-o=FORMAT] [COMMAND] -v, --version Print version information and exit. (default: false) Common Options: --color=WHEN One of: auto, never, always (default: auto) --dump-logs[=FILE] Write all logs to an optionally specified file (default: ~/.astra/logs/.log) --no-input Don't ask for user input (e.g. confirmation prompts) -o, --output=FORMAT One of: human, json, csv (default: human) -q, --quiet Only output essential information --[no-]spinner Enable/disable loading spinners (default: enabled if tty) -V, --verbose Enable verbose logging output Commands: setup Interactively set up the Astra CLI and create profiles config Manage your Astra CLI configuration profiles db Manage your Astra databases pcu Manage your PCU groups and associations org Get organization information role Discover Astra roles streaming Manage Astra streaming tenants token Manage your Astra tokens user Manage users in your organization upgrade Upgrade your Astra CLI installation shellenv Completions, configuration, and more nuke Entirely delete Astra CLI from your system Examples: # Create a new profile $ astra setup # List databases $ astra db list # Create a vector database $ astra db create demo -r us-east1 See 'astra --help' for help on a specific subcommand. ``` -------------------------------- ### Get Current Astra Token Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-token-get.adoc Use this command to display your current authentication token. No additional setup is required if you have already configured the Astra CLI. ```bash # Show your current token $ astra token get ``` -------------------------------- ### List All Vector Regions Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-regions-vector.adoc Use this command to list all available regions for vector Astra DB databases. No specific setup is required beyond having the astra-cli installed. ```shell astra db regions vector ``` -------------------------------- ### Create and set a new profile as default Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config-create.adoc Create a new profile and immediately set it as the default profile for subsequent commands. ```bash astra config create my_profile -t AstraCS:... --default ``` -------------------------------- ### Execute cqlsh Help with Path Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-cqlsh-path.adoc Use command substitution to get the cqlsh path and immediately pass it as an argument to the cqlsh executable to display its help information. ```bash $(astra db cqlsh path) --help ``` -------------------------------- ### Get Pulsar Executable Path Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-streaming-pulsar-path.adoc Retrieve the path to the currently installed Pulsar executable. This command can also be used to run custom Pulsar commands by using command substitution. ```bash astra streaming pulsar path ``` ```bash $(astra streaming pulsar path) --help ``` ```bash astra streaming pulsar path --if-exists ``` -------------------------------- ### Start interactive cql-shell session Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/quickstarts/pages/cqlsh.adoc Use this command to launch an interactive cql-shell session for a specific database. Type 'exit' or 'quit;' to close the session. ```shell astra db cqlsh start **DB_ID** ``` -------------------------------- ### List All Classic Astra DB Regions Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-regions-classic.adoc Use this command to display all available regions for classic Astra DB databases. No additional setup is required beyond having the astra-cli installed. ```bash astra db regions classic ``` -------------------------------- ### Show astra pcu create command syntax Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-pcu-create.adoc Displays the available options and arguments for creating a PCU group. Use this to understand the full range of configurations. ```shell astra pcu create [-qV] [--no-input] [--[no-]spinner] [--color[=WHEN]] [--dump-logs[=FILE]] [-c=CLOUD] [-d=DESC] [-it=TYPE] [--max=MAX] [--min=MIN] [-o=FORMAT] [-pt=TYPE] [-r=REGION] [--reserved=RESERVED] [[[-cf=PATH] [-p=NAME]] | [--token=TOKEN [--env=ENV]]] [--if-not-exists | --allow-duplicate-names] GROUP ``` -------------------------------- ### List Serverless Astra DB Regions Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-regions-serverless.adoc Use this command to list all available regions for serverless Astra DB databases. No additional setup is required beyond having the Astra CLI installed. ```bash astra db regions serverless ``` -------------------------------- ### Create a new keyspace asynchronously Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-keyspace.adoc To create a keyspace without waiting for the database to become active, use the `--async` flag. This is useful for scripting and automation where immediate confirmation of database state is not required. ```bash astra db create-keyspace my_db -k my_keyspace --async ``` -------------------------------- ### Get DSBulk Path if Exists Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-dsbulk-path.adoc Retrieves the path to the dsbulk executable only if it already exists on the system. If dsbulk is not found, the command will not install it and will likely return an error or no output, depending on the exact configuration. ```bash astra db dsbulk path --if-exists ``` -------------------------------- ### List Astra Streaming Cloud Providers Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-streaming-list-clouds.adoc Use this command to retrieve a list of all available cloud providers for your Astra streaming tenants. No specific setup is required beyond having the Astra CLI installed and configured. ```shell astra streaming list-clouds [-qV] [--no-input] [--[no-]spinner] [--color [=WHEN]] [--dump-logs[=FILE]] [-o=FORMAT] [[[-cf=PATH] [-p=NAME]] | [--token=TOKEN [--env=ENV]]] ``` ```bash # List all available cloud providers for streaming tenants $ astra streaming list-clouds ``` -------------------------------- ### Start cqlsh with a specific keyspace Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-cqlsh-start.adoc Connects to an Astra database using cqlsh and authenticates to a specific keyspace. Use the -k or --keyspace option followed by the keyspace name. ```bash astra db cqlsh start my_db -k my_keyspace ``` -------------------------------- ### Setup Astra CLI Shell Completions Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-completions.adoc Add this command to your shell profile (e.g., ~/.zprofile) to enable Astra CLI completions and set your PATH. Ensure the path to astra is correct. ```bash # Put this in your shell profile (e.g. ``~/.zprofile``) to generate completions and set your PATH $ eval "$(/path/to/astra shellenv)" ``` -------------------------------- ### Filter Serverless Astra DB Regions by Name Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-regions-serverless.adoc Filter the list of serverless Astra DB regions by providing a partial match for the region name. This allows for flexible searching, for example, to find all regions starting with 'us-' or 'ca-'. ```bash astra db regions serverless --filter us-,ca- ``` -------------------------------- ### Set Custom Installation Directory for Datastax CLI Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc Export the ASTRA_HOME environment variable before running the installation command to install the Datastax CLI to a custom location. ```bash export ASTRA_HOME=**INSTALLATION_DIRECTORY** ``` -------------------------------- ### List Tables in All Keyspaces Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-list-tables.adoc Use the --all flag to retrieve a list of tables across all keyspaces in the specified Astra database. ```bash astra db list-tables my_db --all ``` -------------------------------- ### Astra CLI Configuration Command Help Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-config.adoc This displays the general help and available commands for managing Astra CLI configuration. ```shell astra config [-qV] [--no-input] [--[no-]spinner] [--color[=WHEN]] [--dump-logs [=FILE]] [-cf=PATH] [-e=ENV] [-o=FORMAT] [COMMAND] ``` -------------------------------- ### Set Astra CLI Custom Installation Directory on Windows Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/install.adoc Export the ASTRA_HOME environment variable in PowerShell to specify a custom installation directory for the Astra CLI on Windows before running the scripted installation. ```powershell $env:ASTRA_HOME = "**INSTALLATION_DIRECTORY**" ``` -------------------------------- ### List Collections in All Keyspaces Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-list-collections.adoc Use the --all flag to list collections across all available keyspaces in your Astra database. ```bash astra db list-collections my_db --all ``` -------------------------------- ### Create a Basic Astra Vector Database Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create.adoc Use this command to create a new Astra vector database with a specified name and region. Ensure the region is valid. ```bash astra db create my_db --region us-east1 ``` -------------------------------- ### Create a Collection in a Non-Default Keyspace Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-collection.adoc If your database has multiple keyspaces, you can specify the target keyspace using the -k or --keyspace option. ```bash astra db create-collection my_db -k my_keyspace -c my_collection ``` -------------------------------- ### Astra CLI Completions Command Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-completions.adoc Use this command to display the syntax for setting up shell completions. Refer to the astra shellenv command for detailed setup instructions. ```shell astra completions [-n=<$cliName>] ``` -------------------------------- ### Create a CDC Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create-cdc.adoc Basic command to create a CDC for a specified table and tenant. ```bash astra db create-cdc my_db --table my_table --tenant my_tenant ``` -------------------------------- ### Uninstall Astra CLI with Homebrew Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/upgrade-pre-1.0.adoc For users who installed the Astra CLI via Homebrew, use this command to uninstall the previous version. This is a required step before installing the latest version from pre-1.0. Homebrew uninstallation preserves your configuration files. ```shell brew uninstall datastax/astra-cli/astra-cli ``` -------------------------------- ### Delete Astra CLI Executable from PATH Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/ROOT/pages/upgrade-pre-1.0.adoc If the Astra CLI was installed to a custom location and is in your PATH, use this command to remove the old 'astra' executable. This ensures that the new installation does not conflict with the old one. Your configuration files remain untouched. ```shell rm $(which astra) ``` -------------------------------- ### Get Information About Another Organization Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org.adoc To get information about a different organization, use the `--token` flag with the organization's API token. The `--token @file` syntax can be used to read the token from a file, which is recommended to avoid potential leaks. ```shell astra org get --token AstraCS:... ``` -------------------------------- ### Get Organization Name Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org-name.adoc Retrieves the name of your current Astra organization. ```APIDOC ## GET /api/orgs/name ### Description Retrieves the name of the current Astra organization. ### Method GET ### Endpoint /api/orgs/name ### Parameters #### Query Parameters - **-q, --quiet** (boolean) - Optional - Only output essential information. - **-V, --verbose** (boolean) - Optional - Enable verbose logging output. - **--no-input** (boolean) - Optional - Don't ask for user input (e.g. confirmation prompts). - **--spinner** (boolean) - Optional - Enable/disable loading spinners. - **--color** (string) - Optional - One of: auto, never, always. - **--dump-logs** (string) - Optional - Write all logs to an optionally specified file. - **-o, --output** (string) - Optional - One of: human, json, csv. - **-cf, --config-file** (string) - Optional - The `.astrarc` file to use for this command. - **-p, --profile** (string) - Optional - The `.astrarc` profile to use for this command. Can be set via `ASTRA_PROFILE`. - **--token** (string) - Optional - The astra token to use for this command. Use the `--token @file` syntax to read the token from a file, to avoid potential leaks. - **--env** (string) - Optional - Override the target astra environment. ### Request Example ```bash astra org name ``` ### Response #### Success Response (200) - **name** (string) - The name of the organization. #### Response Example ```json { "name": "MyOrganization" } ``` ``` -------------------------------- ### Create a basic PCU group Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-pcu-create.adoc Use this command to quickly create a new PCU group with essential parameters like name, cloud provider, and region. ```bash astra pcu create my_pcu -c AWS -r us-west-2 ``` -------------------------------- ### Download SCB to a specific file Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-download-scb.adoc Specify a destination file path for the secure connect bundle using the '-f' or '--file' option. ```bash astra db download-scb my_db -f /path/to/scb.zip ``` -------------------------------- ### Get Organization ID Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-org-id.adoc Retrieves the unique identifier for your Astra organization. ```APIDOC ## GET /api/orgs/id ### Description Retrieves the unique identifier for your Astra organization. ### Method GET ### Endpoint /api/orgs/id ### Parameters #### Query Parameters - **-q, --quiet** (boolean) - Optional - Only output essential information - **-V, --verbose** (boolean) - Optional - Enable verbose logging output - **--no-input** (boolean) - Optional - Don't ask for user input (e.g. confirmation prompts) - **--spinner** (boolean) - Optional - Enable/disable loading spinners - **--color** (string) - Optional - One of: auto, never, always - **--dump-logs** (string) - Optional - Write all logs to an optionally specified file - **-o, --output** (string) - Optional - One of: human, json, csv - **-cf, --config-file** (string) - Optional - The `.astrarc` file to use for this command - **-p, --profile** (string) - Optional - The `.astrarc` profile to use for this command. Can be set via `ASTRA_PROFILE`. - **--token** (string) - Optional - The astra token to use for this command. Use the `--token @file` syntax to read the token from a file, to avoid potential leaks. - **--env** (string) - Optional - Override the target astra environment ### Request Example ```bash astra org id ``` ### Response #### Success Response (200) - **id** (string) - The organization ID #### Response Example ```json { "id": "your-organization-id" } ``` ``` -------------------------------- ### astra user get Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-user-get.adoc Retrieves details for a specific user by their email or ID. ```APIDOC ## GET /api/users/{USER} ### Description Show details for a specific user. ### Method GET ### Endpoint /api/users/{USER} ### Parameters #### Path Parameters - **USER** (string) - Required - User email/id to get #### Query Parameters - **-o, --output** (string) - Optional - One of: human, json, csv - **-V, --verbose** (boolean) - Optional - Enable verbose logging output - **-q, --quiet** (boolean) - Optional - Only output essential information - **--spinner** (boolean) - Optional - Enable/disable loading spinners - **--no-input** (boolean) - Optional - Don't ask for user input (e.g. confirmation prompts) - **--color** (string) - Optional - One of: auto, never, always - **--dump-logs** (string) - Optional - Write all logs to an optionally specified file - **-cf, --config-file** (string) - Optional - The `.astrarc` file to use for this command - **-p, --profile** (string) - Optional - The `.astrarc` profile to use for this command. Can be set via `ASTRA_PROFILE`. - **--token** (string) - Optional - The astra token to use for this command. Use the `--token @file` syntax to read the token from a file, to avoid potential leaks. - **--env** (string) - Optional - Override the target astra environment ### Request Example ```bash astra user get john@example.com astra user get 12345678-abcd-1234-abcd-123456789012 ``` ### Response #### Success Response (200) - **(structure depends on output format)** #### Response Example ```json { "id": "12345678-abcd-1234-abcd-123456789012", "email": "john@example.com", "creationDate": "2023-01-01T10:00:00Z", "lastLogin": "2023-10-26T15:30:00Z" } ``` ``` -------------------------------- ### List Available Vector Database Regions Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-create.adoc This command lists the available regions for creating vector databases. Use this to determine valid values for the `--region` option. ```bash astra db list-regions-vector ``` -------------------------------- ### Use DSBulk Path in a Command Source: https://github.com/datastax/astra-cli-docs/blob/main/modules/commands/pages/astra-db-dsbulk-path.adoc Demonstrates how to use the output of `astra db dsbulk path` to execute another dsbulk command, such as `--help`. This is useful for dynamic command execution. ```bash $(astra db dsbulk path) --help ```