Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-4558 Updated setup steps instructing users to supply token #16

Merged
merged 3 commits into from
Aug 26, 2024
Merged
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
61 changes: 32 additions & 29 deletions docs-src/astra-cli-core/modules/ROOT/pages/getting-started.adoc
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
= 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`.
Run the following command.
You will be asked to provide your 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
astra setup --token *APPLICATION_TOKEN*
----

Output:
Replace `*APPLICATION_TOKEN*` with your <<get-credentials,application token>>.
The token format is `AstraCS:` followed by a unique token string.

.Result
[%collapsible]
====
[source,bash]
----
_____ __
/ _ \ _______/ |_____________
/ /_\ \ / ___/\ __\_ __ \__ \
/ | \\___ \ | | | | \// __ \_
\____|__ /____ > |__| |__| (____ /
\/ \/ \/

------------------------
--- SETUP ---
------------------------

🔑 Enter token (starting with AstraCS...):
[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, validating setup is complete.
* Display the 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:
Expand All @@ -58,8 +62,7 @@ Output:
+-----------------------------------------+
| configuration |
+-----------------------------------------+
| default ([email protected]) |
| [email protected] |
| [email protected] |
+-----------------------------------------+
----

Expand Down