CLI¶
uc has the commands of upstream's bin/uc, with the same flags, and more: a
terminal UI, personal access tokens, backups, the Iceberg catalog, and a local server.
CLI commands lists every command and its flags.
Connect to a server¶
uc calls http://localhost:8080 by default. For another server, give --server, set
UC_CLI_SERVER, or write it in uc.toml:
--output json or --output jsonPretty prints JSON instead of a table.
Sign in¶
When the server needs a sign-in:
uc auth login signs you in to your identity provider in your browser, and keeps the server's
token for the next commands, until it expires (24 hours by default). It needs the provider's
OAuth settings, oauth_* in [cli]. uc auth logout removes the
sign-in.
For scripts, give a token with --auth_token or UC_CLI_TOKEN, such as a personal access token:
Without a token or a sign-in, uc signs in with the identity of the environment, as the
Python client does: an Azure, Google or AWS identity, an OAuth client in
UC_OAUTH_*, or a token in UC_TOKEN, at an identity provider that the server takes. A service
principal, a pod or a CI job thus needs no uc auth login. uc auth and --auth_token, also
--auth_token '', do not use that identity. uc auth login --access_token exchanges a
provider's access token instead of an identity token, such as the one
az account get-access-token --scope https://uc.example.com/.default prints.
Tables, volumes and functions¶
uc table create --full_name main.default.events \
--columns "id INT, name STRING" --storage_location /tmp/uc/events
uc table write --full_name main.default.events # 15 random rows
uc table read --full_name main.default.events
uc volume create --full_name main.default.files --storage_location /tmp/uc/files
uc volume write --full_name main.default.files --source ./report.csv
uc volume read --full_name main.default.files --path report.csv
uc function create --full_name main.default.add \
--input_params "a INT, b INT" --data_type INT --def "return a + b"
uc function call --full_name main.default.add --input_params "1,2"
uc table createwrites a Delta table at the location. With--table_type MANAGED, the server chooses the location.uc tableanduc volumeread and write with the server's temporary credentials: local paths, S3, ADLS and GCS.uc function callruns the function on your machine, withpython3.
Run a server¶
| Command | What it does |
|---|---|
uc dev |
Runs uc-server on 127.0.0.1:8080, with the catalog in memory (unless db.url is set) and its managed data in .uc, and opens the web UI. |
uc serve |
Runs uc-server with its flags, such as --port. |
uc web |
Serves the web UI on http://localhost:3000, for the server of --server. |
These need pip install 'unitycatalog-rs[server]', and [ui] for the web UI.
Differences from upstream's CLI¶
- The settings are in
uc.tomlandUC_CLI_*variables, not incli.properties. ucwith no command opens the terminal UI.- New commands:
token,group,admin,iceberg,tui,serve,devandweb.