Skip to content

Commit f9a621d

Browse files
committed
attempt at improving install scripts, probably unsuccessfully
1 parent 5d648e3 commit f9a621d

File tree

8 files changed

+573
-171
lines changed

8 files changed

+573
-171
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,35 @@ Astra CLI v1.x supports both x64 and arm64 versions of Linux, macOS and Windows.
4141
The preferred installation method is via the installation script:
4242

4343
```bash
44-
# Unix
45-
sh -c "$(curl -fsSL ibm.biz/get-astra-cli)"
44+
# Unix (recommended)
45+
curl -fsSL ibm.biz/get-astra-cli | sh
46+
47+
# Unix (brew)
48+
brew install datastax/astra-cli/astra
4649

4750
# Windows
4851
powershell -c "irm https://raw.githubusercontent.com/datastax/astra-cli/main/scripts/install.ps1 | iex"
4952
```
5053

5154
The CLI can also be downloaded directly from the [releases page](https://github.com/datastax/astra-cli/releases).
5255

53-
Nix, docker, brew, and potentially other installation methods are coming soon. However, the installation script will always be the recommended way to install the Astra CLI.
56+
Nix, docker, and potentially other installation methods are coming soon.
57+
58+
### Migrating from v0.x
59+
60+
If you have previously installed Astra CLI v0.x, it is recommended to uninstall that version before installing v1.x to avoid any potential conflicts.
61+
62+
<details>
63+
<summary><strong>Uninstalling v0.x</strong></summary>
64+
65+
```bash
66+
# Unix (installation script)
67+
rm $(which astra)
68+
69+
# Unix (brew)
70+
brew uninstall astra-cli
71+
```
72+
</details>
5473

5574
### Upgrading
5675

@@ -64,12 +83,14 @@ You can also download a specific version, or the latest prerelease version, usin
6483

6584
```bash
6685
# Upgrade (or downgrade!) to a specific version
67-
astra upgrade --version 1.0.0-beta.4
86+
astra upgrade --version 1.0.0-rc-2
6887

6988
# Upgrade to the latest prerelease version
7089
astra upgrade --pre
7190
```
7291

92+
**Note:** If you installed Astra CLI via a package manager (e.g. brew), use that package manager to upgrade instead.
93+
7394
### ⚠️ MacOS warning
7495

7596
If you are running macOS and run into an error about the app being from an unidentified developer, you can either:
@@ -79,10 +100,6 @@ If you are running macOS and run into an error about the app being from an unide
79100
xattr -d com.apple.quarantine $(which astra)
80101
```
81102

82-
> [!NOTE]
83-
> To avoid running into this issue in the first place, **it is heavily recommended that you use the installation script**, which
84-
> will not trigger this issue.
85-
86103
### Uninstalling
87104

88105
To uninstall Astra CLI, you can simply delete the binary, either via `rm`, or via the package manager you installed it with.
@@ -96,7 +113,7 @@ astra nuke
96113

97114
## Setup
98115

99-
After installation, you can run `astra setup` to configure the CLI. This will interactively guide you through setting up your credentials in a central `.astrarc` file.
116+
After installation, run `astra setup` to interactively set up your credentials in a central `.astrarc` file.
100117

101118
```bash
102119
# You can run the `setup` command any time to add or update your credentials.
@@ -117,8 +134,8 @@ astra db list --token <your_token> [--env <your_env>]
117134
> It is highly recommended to use the `@file` syntax to avoid exposing your token in your shell history.
118135
>
119136
> ```bash
120-
> # Have a plain-text file containing just your token (the file can be named anything)
121-
> echo 'AstraCS:...' > my_token
137+
> # Create a plain-text file containing just your token (the file can be named anything)
138+
> vim my_token
122139
>
123140
> # Now the token can be passed securely via a file
124141
> astra db list --token @my_token
@@ -158,7 +175,7 @@ echo 'export ASTRARC=/path/to/your/.astrarc' >> ~/.bashrc
158175
echo 'eval "$(astra shellenv --rc "/path/to/your/.astrarc")"' >> ~/.bashrc
159176
```
160177

161-
### Response format
178+
### Output format
162179

163180
By default, Astra CLI outputs responses in a human-friendly format. However, you can change this to JSON or CSV if you prefer, via the `--output` (or `-o`) flag.
164181

@@ -175,7 +192,7 @@ The vast majority of commands will support all three output formats, but if any
175192
> [!TIP]
176193
> Generally, for GET requests, the JSON response will be the raw response from the server, while the human-friendly and CSV formats will be a simplified version of the data.
177194
178-
### Output level
195+
### Output style
179196

180197
You can control the verbosity and style of the output via a variety of flags.
181198

@@ -552,21 +569,24 @@ Some commands, namely the ones that build on `cqlsh`, `dsbulk`, and `pulsar-shel
552569

553570
### XDG spec compliance
554571

572+
The Astra CLI will now respect the `$XDG_DATA_HOME` and `$XDG_CONFIG_HOME` environment variables for determining where to store its home folder and `.astrarc` file respectively.
573+
555574
### Misc changes + bug fixes
556575

557576
<details>
558577
<summary>Other minor changes (not exhaustive)</summary>
559-
automatically patch cqlsh script to work on machines with a newer python version as default by testing for older python versions explicitly
560-
consistent support of the `--output` flag across all commands–either a format is supported, or the command will error out before doing anything
561-
removed `astra-init` script in favor of the `astra compgen` command
562-
removed `astra login` since it was just an alias of `astra setup`
563-
`setup` command has been completely rewritten and improved to be much more interactive and user-friendly
564-
fewer API calls will be made due to better internal caching and logic (commands may be much faster now!)
565-
fixed inconsistent shell coloring in places (--no-color now definitively works everywhere)
566-
fixed issues with not being able to use IDs in place of names in some places (e.g. `db delete [id]`)
567-
timeout durations can now be parsed using iso8601 durations or with simple time units (ms, s, m, h)
568-
.astrarc parsing is stricter now
569-
improved .env + .ini parsing + printing
578+
<li> automatically patch cqlsh script to work on machines with a newer python version as default by testing for older python versions explicitly
579+
<li> consistent support of the `--output` flag across all commands–either a format is supported, or the command will error out before doing anything
580+
<li> removed `astra-init` script in favor of the `astra compgen` command
581+
<li> removed `astra login` since it was just an alias of `astra setup`
582+
<li> `setup` command has been completely rewritten and improved to be much more interactive and user-friendly
583+
<li> fewer API calls will be made due to better internal caching and logic (commands may be much faster now!)
584+
<li> fixed inconsistent shell coloring in places (--no-color now definitively works everywhere)
585+
<li> fixed issues with not being able to use IDs in place of names in some places (e.g. `db delete [id]`)
586+
<li> timeout durations can now be parsed using iso8601 durations or with simple time units (ms, s, m, h)
587+
<li> .astrarc parsing is stricter now
588+
<li> improved .env + .ini parsing + printing
589+
<li> and more.
570590
</details>
571591

572592
## Troubleshooting

0 commit comments

Comments
 (0)