Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,40 @@ endif::[]
This repository contains the https://docs.asciidoctor.org/asciidoc/latest/[AsciiDoc] source files for the {company} {product} documentation.

To learn how to update the documentation, see the https://datastax.jira.com/wiki/spaces/DOCS/overview[Docs team Confluence site].

== Regenerate the Astra CLI command reference

The Astra CLI command reference documentation is generated from the literal CLI help text in the Astra CLI code.
The command reference documentation should be regenerated and committed to the docs whenever a new version of the Astra CLI is released.

. If you haven't done so yet, clone the Astra CLI code repository:
+
[source,bash]
----
git clone https://github.com/datastax/astra-cli.git
----

. Change directory to the cloned repository:
+
[source,bash]
----
cd astra-cli
----

. Pull the latest changes:
+
[source,bash]
----
git switch main && git pull
----

. Run the following command to regenerate the command reference docs:
+
[source,bash]
----
source scripts/dev-alias.sh; astra docs && \
rsync -a --delete build/docs/commands/ ~/repos/astra-cli-docs/modules/commands/pages/ && \
cp -f build/docs/partial-nav.adoc ~/repos/astra-cli-docs/modules/commands/partials/
----
+
Replace `repos` with the appropriate path to your cloned repositories.
1 change: 0 additions & 1 deletion antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ asciidoc:
product: 'Astra CLI'
product-short: 'Astra'
product-version: '1.0'
product-repo: 'https://github.com/datastax/astra-cli'
db-serverless: 'Serverless (non-vector)'
db-serverless-vector: 'Serverless (vector)'
db-classic: 'Astra Managed Clusters'
Expand Down
6 changes: 3 additions & 3 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
.Quickstarts
* xref:quickstarts:cqlsh.adoc[]

include::ROOT:partial$partial-nav.adoc[]
include::commands:partial$partial-nav.adoc[]

.Release notes
* {product-repo}?tab=readme-ov-file#whats-changed[Release notes]
* https://github.com/datastax/astra-cli?tab=readme-ov-file#whats-changed[Release notes]

//-

* {product-repo}[GitHub repository]
* https://github.com/datastax/astra-cli[GitHub repository]
4 changes: 2 additions & 2 deletions modules/ROOT/pages/install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The response includes available commands and options for the {product}.

=== Binary installation on macOS and Linux

. Download the appropriate binary archive for your OS and CPU architecture from {product-repo}/releases[GitHub].
. Download the appropriate binary archive for your OS and CPU architecture from https://github.com/datastax/astra-cli/releases[GitHub].

. Extract the archive into the directory where you want to install the {product}.
For example:
Expand Down Expand Up @@ -162,7 +162,7 @@ The response includes available commands and options for the {product}.

=== Binary installation on Windows

. Download the `windows` zip file from {product-repo}/releases[GitHub].
. Download the `windows` zip file from https://github.com/datastax/astra-cli/releases[GitHub].

. Extract the zip file into the directory where you want to install the {product}:
+
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/manage-cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ The {product} home folder contains the following items:
* Cache files for <<command-auto-completion,command auto-completion>>
* Logs

For more information about `ASTRA_HOME`, see the {product-repo}?tab=readme-ov-file#home-folder-location[{product} README].
For more information about `ASTRA_HOME`, see the https://github.com/datastax/astra-cli?tab=readme-ov-file#home-folder-location[{product} README].

|`.astrarc`
a|The {product} configuration file.
Expand All @@ -544,7 +544,7 @@ _Default location_:

The {product} uses this file to store your <<manage-configuration-profiles,configuration profiles>> and their associated application tokens.

For more information about the {product} configuration file, see the {product-repo}?tab=readme-ov-file#astrarc-location[{product} README].
For more information about the {product} configuration file, see the https://github.com/datastax/astra-cli?tab=readme-ov-file#astrarc-location[{product} README].
|===

=== Override the default home folder location
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/upgrade-pre-1.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ However, there are some changes that might break certain scripted usage, such as
* New standardized xref:ROOT:manage-cli.adoc#output-formats[JSON and CSV output formats and exit codes].

* Minor command and flag name changes.
For a full list of name changes, see the {product-repo}?tab=readme-ov-file#whats-changed[release notes].
For a full list of name changes, see the https://github.com/datastax/astra-cli?tab=readme-ov-file#whats-changed[release notes].
====
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-config-create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Use the ``--token @<file>`` syntax to securely read the token from a file, witho
`NAME`:: Unique name for the profile
`-cf`, `--config-file`:: The .astrarc file to work with. See ``astra config path -h`` for how this is resolved.
`-t`, `--token`:: Astra token (``AstraCS:...``) or ``@<file>`` to read from file
`-e`, `--env`:: Astra environment the token targets
`-e`, `--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
`-d`, `--default`:: Set the created profile as the default profile. Same as 'config use <profile>'
`--overwrite`:: Overwrite any existing profile with the same name

Expand Down
8 changes: 5 additions & 3 deletions modules/commands/pages/astra-db-cqlsh-exec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ astra db cqlsh exec [-qV] [--debug] [--no-input] [--[no-]spinner] [--color
[--connect-timeout=TIMEOUT] [--encoding=ENCODING]
[-k=KEYSPACE] [-o=FORMAT] [-r=REGION]
[--request-timeout=TIMEOUT] [[[-cf=PATH] [-p=NAME]] |
[--token=TOKEN [--env=ENV]]] [-e[=STATEMENT] | -f=FILE] [DB]
[--token=TOKEN [--env=ENV]]] [-e[=STATEMENT] | -f=FILE]
[DB] [ARGS...]

----

Expand All @@ -20,7 +21,8 @@ Execute CQL statements for your db using cqlsh

== Options

`DB`:: The name/ID of the Astra database to connect to
`DB`:: The name/ID/endpoint of the Astra database to connect to
`ARGS`:: Verbatim arguments to pass to cqlsh directly (anything after '--' is passed through)
`--debug`:: Show additional debugging information
`--encoding`:: Output encoding (default: utf8)
`--connect-timeout`:: Connection timeout in seconds
Expand Down Expand Up @@ -49,7 +51,7 @@ Execute CQL statements for your db using cqlsh
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-db-cqlsh-path.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Get the path to the currently installed cqlsh executable
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
7 changes: 4 additions & 3 deletions modules/commands/pages/astra-db-cqlsh-start.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ astra db cqlsh start [-qV] [--debug] [--no-input] [--[no-]spinner] [--color
[--connect-timeout=TIMEOUT] [--encoding=ENCODING]
[-k=KEYSPACE] [-o=FORMAT] [-r=REGION]
[--request-timeout=TIMEOUT] [[[-cf=PATH] [-p=NAME]] |
[--token=TOKEN [--env=ENV]]] [] [DB]
[--token=TOKEN [--env=ENV]]] [] [DB] [ARGS...]

----

Expand All @@ -20,7 +20,8 @@ Connect to your Astra database using cqlsh

== Options

`DB`:: The name/ID of the Astra database to connect to
`DB`:: The name/ID/endpoint of the Astra database to connect to
`ARGS`:: Verbatim arguments to pass to cqlsh directly (anything after '--' is passed through)
`--debug`:: Show additional debugging information
`--encoding`:: Output encoding (default: utf8)
`--connect-timeout`:: Connection timeout in seconds
Expand All @@ -47,7 +48,7 @@ Connect to your Astra database using cqlsh
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-db-cqlsh-version.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Display the currently installed cqlsh's version
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-db-create-cdc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Create a CDC (Change Data Capture) for a table in a specific keyspace and tenant
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-db-create-collection.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Create a new Data API collection in the specified database and keyspace
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
4 changes: 2 additions & 2 deletions modules/commands/pages/astra-db-create-dotenv.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Create a env file to help you connect to your Astra DB instance.
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand All @@ -59,7 +59,7 @@ Create a env file to help you connect to your Astra DB instance.
$ astra db create-dotenv

# Create a .env file specifying the keys to include
$ astra db create-dotenv --keys ASTRA_DB_APPLICATION_TOKEN,ASTRA_DB_API_ENDPOINT
$ astra db create-dotenv --keys ASTRA_DB_TOKEN,ASTRA_DB_API_ENDPOINT

# Create a .env file with a preset specifying the keys to include
$ astra db create-dotenv --preset data_api_client
Expand Down
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-db-create-keyspace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Create a new keyspace in the specified database
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
2 changes: 1 addition & 1 deletion modules/commands/pages/astra-db-create-region.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Add a new region to an existing database
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand Down
11 changes: 6 additions & 5 deletions modules/commands/pages/astra-db-create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
astra db create [-qV] [--[no-]async] [--no-input] [--non-vector] [--[no-]
spinner] [--color[=WHEN]] [--dump-logs[=FILE]] [-c=CLOUD]
[--capacity-units=CAPACITY UNITS] [-k=KEYSPACE] [-o=FORMAT]
[-r=REGION] [--tier=TIER] [--timeout=<timeout>] [[[-cf=PATH]
[-p=NAME]] | [--token=TOKEN [--env=ENV]]] [--if-not-exists |
--allow-duplicate-names] DB
[-pg=PCU_GROUP] [-r=REGION] [--tier=TIER] [--timeout=<timeout>]
[[[-cf=PATH] [-p=NAME]] | [--token=TOKEN [--env=ENV]]]
[--if-not-exists | --allow-duplicate-names] DB

----

Expand All @@ -31,6 +31,7 @@ Create a new Astra database
`--tier`:: Tier to create the database in
`--capacity-units`:: Capacity units to create the database with
`--non-vector`:: Create a classic non-vector database
`-pg`, `--pcu-group`:: The PCU group to associate the database to.

.Common Options
[%collapsible]
Expand All @@ -50,7 +51,7 @@ Create a new Astra database
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Override the target astra environment
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


Expand All @@ -73,7 +74,7 @@ $ astra db create my_db --async
$ astra db create my_db --region us-east1 --if-not-exists

# List available vector database regions for creating a database
$ astra db list-regions-vector
$ astra db regions vector
----


71 changes: 71 additions & 0 deletions modules/commands/pages/astra-db-data-api-exec.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
= astra db data-api exec

[source,shell]
----
astra db data-api exec [-qV] [--no-input] [--[no-]spinner] [--color[=WHEN]]
[--dump-logs[=FILE]] [-c[=COLLECTION[,
COLLECTION...]]]... [-t[=TABLE[,TABLE...]]]... [-e=CODE]
[-k=KEYSPACE] [-o=FORMAT] [-r=REGION] [-a=PACKAGES[,
PACKAGES...]]... [[[-cf=PATH] [-p=NAME]] |
[--token=TOKEN [--env=ENV]]] [--node | --python |
--ipython] [DB] [ARGS...]

----


Execute Data API code against a database





== Options

`DB`:: The name or ID of the Astra database to operate on
`ARGS`:: Verbatim arguments to pass to the underlying node/python directly (anything after '--' is passed through)
`-k`, `--keyspace`:: The keyspace to use
`-a`, `--artifacts`:: Additional packages to include (e.g., pandas, lodash)
`-r`, `--region`:: The region to use
`-c`, `--collection`:: The collections to use
`-t`, `--table`:: The tables to use
`-e`, `--execute`:: Code to execute using the Data API
`--node`:: Use astra-db-ts with Node.js (default)
`--python`:: Use astrapy with Python
`--ipython`:: Use astrapy with IPython

.Common Options
[%collapsible]
====
`-o`, `--output`:: One of: human, json, csv
`-V`, `--verbose`:: Enable verbose logging output
`-q`, `--quiet`:: Only output essential information
`--spinner`:: Enable/disable loading spinners
`--no-input`:: Don't ask for user input (e.g. confirmation prompts)
`--color`:: One of: auto, never, always
`--dump-logs`:: Write all logs to an optionally specified file
====

.Connection Options
[%collapsible]
====
`-cf`, `--config-file`:: The ``.astrarc`` file to use for this command
`-p`, `--profile`:: The ``.astrarc`` profile to use for this command. Can be set via ``ASTRA_PROFILE``.
`--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.
`--env`:: Astra environment the token belongs to: prod (default), dev, or test. Leave unset unless you were issued a non-prod token.
====


== Examples
[source,bash]
----
# Insert a document using astra-db-ts (passing the -p flag to node)
$ astra db data-api exec my_db -c my_coll -e "my_coll.insertOne({ name: 'Joe' })" -- -p

# Find a row using python
$ astra db data-api exec my_db -l python -t my_table -e "print(my_table.find_one())"

# Execute a file
$ astra db data-api exec my_db -e @code.js
----


Loading