Files and the cloud
datasight browse opens a file browser beside the table. Pick a file and it opens on
the right. Pick another and it replaces the first. No need to quit and restart.
datasight browse # the current directory
datasight browse ~/data/exports # a local folder
datasight browse az://my-container # Azure Blob Storage
datasight browse s3://my-bucket # Amazon S3
Getting around
| Key | Does |
|---|---|
| j / k | Move through the list |
| Enter / . | Open the file, or go into the folder |
| Esc | Up to the parent folder |
| Tab | Switch between the list and the open file |
| ctrl+e | Hide or show the list, to give the table the full width |
| / | Find a file by name |
| d | Download the selected cloud file |
| T | Change theme |
| q | Quit |
Once you Tab into an open table, every key from the rest of this manual works as usual.
Find a file
Press / and start typing. The letters only have to appear in order, so
ordcsv finds orders.csv. Best matches come first, and the matching letters are
highlighted.
- Lowercase ignores case. One capital letter makes the whole search case-sensitive.
- ↑ / ↓ (or ctrl+p / ctrl+n) move through the matches.
- Enter opens the highlighted match.
- ctrl+u clears what you typed. Esc brings the full list back.
What opens where
- Data files (
.csv,.tsv,.parquet,.json,.ndjson,.jsonl) open as a table. - Binary files (images, archives, executables, PDFs and the like) are greyed out and won’t open.
- Everything else (
.txt,.md,.log,.yaml, files with no extension) opens in a plain text viewer.
The text viewer has its own small set of keys:
| Key | Does |
|---|---|
| j / k, PageDown / PageUp | Scroll |
| gg / G | Top / bottom |
| h / l | Scroll sideways (when wrapping is off) |
| w | Wrap long lines on or off |
| L | Line numbers on or off |
| /, n / N | Search, next, previous |
Download a cloud file
On a file in an az:// or s3:// listing, press d. You’ll be asked where to
save it, with the file’s own name already filled in.
- Type a folder ending in
/, like~/Downloads/, to keep the original name. - The full destination is shown as you type, with a warning if a file is already there.
- Missing folders are created.
- Enter saves and Esc cancels.
If a download fails, no half-written file is left behind. d does nothing on local files, since they’re already on your disk.
Cloud storage
Cloud support has to be built in. See Install. Then datasight logs in using environment variables.
Azure: either a connection string:
export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=…;AccountKey=…"
or an account name and key:
export AZURE_STORAGE_ACCOUNT_NAME=myaccount
export AZURE_STORAGE_ACCOUNT_KEY=…
Amazon S3: the standard AWS variables:
export AWS_ACCESS_KEY_ID=…
export AWS_SECRET_ACCESS_KEY=…
export AWS_REGION=eu-west-1
Cloud files are downloaded into memory when you open them. Nothing is written to disk unless you press d.