feat: add a LanceDB command line (#4600)

Add a LanceDB command line with the following functionality:

- `lancedb auth`: log in with OAuth, check cached OAuth session status,
or log out.
- `lancedb profile`: Create, edit, list, show, select, and delete
connection profiles.
- When no subcommand is given, we will attempt to create a SQL shell.

Update ci/check_cargo_lock.py and its regression tests to allow
pruning dependency edges while their target packages remain in
Cargo.lock. Removing the CLI from the Python source distribution
can disable optional features such as Axum tracing, even though
other SDK dependencies still require the tracing package.
This commit is contained in:
Colin Patrick McCabe
2026-10-29 12:39:46 -07:00
committed by GitHub
parent 2347e97e56
commit 301ccad3aa
32 changed files with 11206 additions and 1177 deletions
+45
View File
@@ -0,0 +1,45 @@
name: CLI
on:
push:
branches: [main]
pull_request:
paths:
- 'rust/lancedb/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/cli.yml'
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os: [ubuntu-24.04, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
components: clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
- name: Install Linux prerequisites
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libssl-dev clang
- name: Install macOS prerequisites
if: runner.os == 'macOS'
run: brew install protobuf
- name: Build standalone CLI binary
run: cargo build --locked --profile ci -p lancedb-cli --bin lancedb
- name: Test standalone CLI
run: cargo test --locked --profile ci -p lancedb-cli
- name: Test SDK SQL
run: cargo test --locked --profile ci -p lancedb --features remote --lib remote::sql
- name: Lint CLI
run: cargo clippy --locked --profile ci -p lancedb-cli --all-targets --all-features -- -D warnings
- name: Check SDK without remote support
# Feature-disabled SDK code has existing unused-code warnings; this is a compile check.
env:
RUSTFLAGS: ""
run: cargo check --locked --profile ci -p lancedb --no-default-features --tests
+5 -3
View File
@@ -187,12 +187,14 @@ jobs:
command: sdist
working-directory: python
args: --out dist
# maturin ships the nodejs-only pins in Cargo.lock. Remove this step when
# the pinned maturin fixes https://github.com/PyO3/maturin/issues/2609.
# maturin ships pins used only by other workspace members in Cargo.lock.
# Remove this step when the pinned maturin fixes
# https://github.com/PyO3/maturin/issues/2609.
- name: Sync Cargo.lock to the packaged workspace
shell: bash
run: |
# A repo lock in sync with every manifest means the prune only drops pins.
# A synced repo lock lets the prune drop packages and optional edges
# without changing the remaining pins or adding dependency edges.
cargo metadata --locked --format-version 1 > /dev/null
mkdir "$RUNNER_TEMP/sdist-src"
tar -xzf python/dist/lancedb-*.tar.gz -C "$RUNNER_TEMP/sdist-src"
+12 -4
View File
@@ -404,10 +404,18 @@ jobs:
# unreadable outside their own branch anyway, since GitHub scopes
# caches to the creating ref.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Downgrade dependencies
# aws-smithy-types 1.6.1+ requires rustc 1.94.1
run: cargo update -p aws-smithy-types --precise 1.5.0
- name: Resolve MSRV-compatible dependencies
# Resolve the AWS SDK and Smithy crates together: newer SDK releases
# require newer Smithy versions, so downgrading only Smithy can fail.
run: cargo +${{ matrix.msrv }} update --config 'resolver.incompatible-rust-versions="fallback"'
- name: Keep Xet dependencies compatible with the MSRV
# Xet 1.7 does not declare its MSRV, but requires sysinfo 0.39 (Rust 1.95).
# Downgrade parents before their dependencies to satisfy their constraints.
run: |
for crate in hf-xet xet-data xet-client xet-core-structures xet-runtime; do
cargo +${{ matrix.msrv }} update -p "$crate" --precise 1.6.0
done
- name: cargo +${{ matrix.msrv }} check
env:
RUSTUP_TOOLCHAIN: ${{ matrix.msrv }}
run: cargo check --profile ci --workspace --tests --benches --all-features
run: cargo check --locked --profile ci --workspace --tests --benches --all-features