From 46db5f482e162d59d7efd38784c089058671ffd6 Mon Sep 17 00:00:00 2001 From: Erick Ramirez Date: Wed, 21 Aug 2024 16:45:00 +1000 Subject: [PATCH 1/2] DOC-4558 Updated setup steps instructing users to supply token --- .../modules/ROOT/pages/getting-started.adoc | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc b/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc index a2b03be..1b75cc1 100644 --- a/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc +++ b/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc @@ -4,32 +4,22 @@ Read this topic to learn how to get started with {astra_cli}. == Setup -Before issuing CLI `astra` commands, initialize the configuration file `~/.astrarc`. -Run the following command. -You will be asked to provide your token, which begins with `AstraCS:\...`. +Before issuing CLI `astra` commands, initialize the configuration file `~/.astrarc` by running the +`setup` command with your application token which begins with `AstraCS:...`. The token will be saved so that you're authorized to run the CLI commands. [source,bash] ---- -astra setup +astra setup --token ---- Output: [source,bash] ---- - _____ __ - / _ \ _______/ |_____________ - / /_\ \ / ___/\ __\_ __ \__ \ -/ | \\___ \ | | | | \// __ \_ -\____|__ /____ > |__| |__| (____ / - \/ \/ \/ - - ------------------------ - --- SETUP --- - ------------------------ - -🔑 Enter token (starting with AstraCS...): +[OK] Configuration has been saved. +[OK] Setup completed. +[INFO] Enter 'astra help' to list available commands. ---- You are all set. @@ -37,18 +27,18 @@ The configuration (mainly your token) is stored in file `~/.astrarc`. == First commands -* Display current version of the cli, validating setup is complete. +* Display current version of the CLI. [source,bash] ---- astra --version ---- -* Display your configuration list. +* Display your configuration list, validating setup is complete. [source,bash] ---- -bash astra config list +astra config list ---- Output: @@ -58,8 +48,7 @@ Output: +-----------------------------------------+ | configuration | +-----------------------------------------+ - | default (cedrick.lunven@datastax.com) | - | cedrick.lunven@datastax.com | + | your_email@domain.tld | +-----------------------------------------+ ---- From e9c146e010bc39eb75116890b7df754a9d8f9096 Mon Sep 17 00:00:00 2001 From: Eric Schneider <37347760+eric-schneider@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:12:58 -0700 Subject: [PATCH 2/2] Clarify application token --- .../modules/ROOT/pages/getting-started.adoc | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc b/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc index 1b75cc1..a2fb274 100644 --- a/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc +++ b/docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc @@ -1,33 +1,47 @@ -= Getting Started with {astra_cli} += Getting started with {astra_cli} -Read this topic to learn how to get started with {astra_cli}. +Initialize the Astra CLI and run your first commands. -== Setup +[#get-credentials] +== Retrieve your application token -Before issuing CLI `astra` commands, initialize the configuration file `~/.astrarc` by running the -`setup` command with your application token which begins with `AstraCS:...`. -The token will be saved so that you're authorized to run the CLI commands. +The Astra CLI requires an _application token_ to authenticate with Astra. +For instructions on how to create an application token, see xref:astra-db-serverless:administration:manage-application-tokens.adoc[]. -[source,bash] +To increase the security of your Astra account, DataStax recommends that you grant your application token only the bare minimum xref:astra-db-serverless:administration:manage-database-access.adoc[permissions] required to perform the tasks you'll be running in Astra. + +== Set up a new configuration + +Use the `astra setup` command to initialize the Astra CLI: + +[source,bash,subs="verbatim,quotes"] ---- -astra setup --token +astra setup --token *APPLICATION_TOKEN* ---- -Output: +Replace `*APPLICATION_TOKEN*` with your <>. +The token format is `AstraCS:` followed by a unique token string. +.Result +[%collapsible] +==== [source,bash] ---- [OK] Configuration has been saved. [OK] Setup completed. [INFO] Enter 'astra help' to list available commands. ---- +==== + +The Astra CLI is now initialized and ready to use. -You are all set. -The configuration (mainly your token) is stored in file `~/.astrarc`. +The Astra CLI configuration, including your application token, is stored in `~/.astrarc`. +The information in this file is used whenever you run the `astra` command. +[#first-commands] == First commands -* Display current version of the CLI. +* Display the current version of the CLI. [source,bash] ---- @@ -48,7 +62,7 @@ Output: +-----------------------------------------+ | configuration | +-----------------------------------------+ - | your_email@domain.tld | + | alex@altostrat.com | +-----------------------------------------+ ----