-
Notifications
You must be signed in to change notification settings - Fork 326
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
docs(bottomless-cli): move CLI documentation to a single README #1707
Open
jeremybarbet
wants to merge
1
commit into
tursodatabase:main
Choose a base branch
from
jeremybarbet:feat/bottomless-cli-readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Bottomless CLI | ||
|
||
The command-line interface helps inspect and manage replicated snapshots stored in S3-compatible storage. | ||
|
||
It can be installed as a standalone executable with: | ||
|
||
```sh | ||
RUSTFLAGS="--cfg uuid_unstable" cargo install bottomless-cli | ||
``` | ||
|
||
> [!WARNING] | ||
> The [CLI crate](https://crates.io/crates/bottomless-cli) hasn't been updated in over a year, and while it's being heavily worked on, we recommend building against the source for now. | ||
|
||
In order to build from the repository: | ||
|
||
```sh | ||
git clone [email protected]:tursodatabase/libsql.git | ||
cargo build -p bottomless-cli --release | ||
cargo install --path . | ||
``` | ||
|
||
You will now be able to use the `bottomless-cli` command. | ||
|
||
Available commands: | ||
``` | ||
$ bottomless-cli | ||
Bottomless CLI | ||
|
||
Usage: bottomless-cli [OPTIONS] <COMMAND> | ||
|
||
Commands: | ||
copy Copy bottomless generation locally | ||
create Create new generation from database | ||
ls List available generations | ||
restore Restore the database | ||
verify Verify integrity of the database | ||
rm Remove given generation from remote storage | ||
snapshot Generate and upload a snapshot for a given generation or timestamp | ||
help Print this message or the help of the given subcommand(s) | ||
|
||
Options: | ||
-e, --endpoint <ENDPOINT> | ||
-b, --bucket <BUCKET> | ||
-d, --database <DATABASE> | ||
-n, --namespace <NAMESPACE> | ||
--encryption-key <ENCRYPTION_KEY> | ||
--db-name <DB_NAME> | ||
-h, --help Print help | ||
``` | ||
|
||
## Examples | ||
|
||
### Listing generations | ||
|
||
```sh | ||
$ bottomless-cli -e http://localhost:9000 ls -v -l3 | ||
e4eb3c21-ff53-7b2e-a6ea-ca396f4df9b1 | ||
created at (UTC): 2022-12-23 08:24:52.500 | ||
change counter: [0, 0, 0, 51] | ||
consistent WAL frame: 0 | ||
WAL frame checksum: 0 | ||
main database snapshot: | ||
object size: 408 | ||
last modified: 2022-12-23T08:24:53Z | ||
|
||
e4eb3c22-0359-7af6-9acb-285ed7b6ed59 | ||
created at (UTC): 2022-12-23 08:24:51.470 | ||
change counter: [0, 0, 0, 51] | ||
consistent WAL frame: 1 | ||
WAL frame checksum: 5335f2a044d2f455 | ||
main database snapshot: | ||
object size: 399 | ||
last modified: 2022-12-23T08:24:52Z | ||
|
||
e4eb3c22-0941-73eb-85df-4e8552a0e88c | ||
created at (UTC): 2022-12-23 08:24:49.958 | ||
change counter: [0, 0, 0, 50] | ||
consistent WAL frame: 10 | ||
WAL frame checksum: 6ac65882f9a2dba7 | ||
main database snapshot: | ||
object size: 401 | ||
last modified: 2022-12-23T08:24:51Z | ||
``` | ||
|
||
### Restoring the database | ||
|
||
```sh | ||
$ RUST_LOG=info bottomless-cli -e http://localhost:9000 restore | ||
2022-12-23T10:16:10.703557Z INFO bottomless::replicator: Bucket bottomless exists and is accessible | ||
2022-12-23T10:16:10.709526Z INFO bottomless_cli: Database: test.db | ||
2022-12-23T10:16:10.713070Z INFO bottomless::replicator: Restoring from generation e4eb3c29-fe84-7347-a0c0-b9a3a71d0fc2 | ||
2022-12-23T10:16:10.727646Z INFO bottomless::replicator: Restored the main database file | ||
``` | ||
|
||
### Removing old snapshots | ||
```sh | ||
$ bottomless-cli -e http://localhost:9000 rm -v --older-than 2022-12-15 | ||
Removed 4 generations | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my assumption btw (related to #857)