Client CLI & Shell Reference¶
This document is the comprehensive reference manual for the DVFS interactive terminal shell (dvfs>) and client binary commands.
1. Starting the Client¶
The client binary connects to the cluster either through the MetaServer (recommended) or directly to an individual FileServer.
Command-Line Flags¶
| Flag | Type | Default | Description |
|---|---|---|---|
-username |
string | "romit" |
Username for session authentication and root lookup |
-meta |
bool | true |
When true, connects via MetaServer coordinator for root discovery |
-ip_addr |
string | "127.0.0.1" |
IP address of target MetaServer or FileServer |
-port |
string | "" |
Port to connect to (50051 for MetaServer; 50052 for direct FileServer) |
-use_gist |
bool | true |
Enables dynamic discovery of node LAN IPs from GitHub Gist |
-gist_url |
string | "" |
Custom GitHub Gist URL (overrides default machines.json location) |
-insecure |
bool | false |
Disables TLS verification (for local loopback testing only) |
1.1 Interactive Google Authentication Flow (OAuth 2.0 + PKCE)¶
When built with Google Authentication (USE_GOOGLE_AUTH=1), the client initiates an interactive authentication flow on startup:
- Email Input:
- PKCE & Loopback Listener:
The client generates an RFC 7636 PKCE S256 code challenge/verifier pair and a cryptographic CSRF
statenonce, then spins up a local loopback HTTP listener on127.0.0.1:38485. - Browser Consent:
The client prints the generated Google authorization URL:
Please open the following URL in your web browser to sign in: ───────────────────────────────────────────────────────── https://accounts.google.com/o/oauth2/v2/auth?client_id=...&code_challenge=...&state=... ───────────────────────────────────────────────────────── After signing in, your browser will open the DVFS callback page. Copy the token displayed on that page and paste it below. - Token Exchange & Headless Fallback:
- Local Browser: Google redirects to
http://localhost:38485/logincallback. The client validates thestatenonce, exchanges the authorization code usingcode_verifier, and renders a styled HTML success page. - Headless SSH / Remote Terminal: If the browser is on a separate machine, the user copies the token displayed on the callback page and pastes it at the terminal prompt:
- Session Handshake (
RegisterClient): The client callsRegisterClientpresenting the Google ID token once. The FileServer validates the token and returns a Server Session Token (SST): - Transparent Bearer Injection:
The client automatically injects
Authorization: Bearer <SST>on all subsequent unary and streaming gRPC calls (ls,cat,upload,download,share, etc.). - Session Termination:
Typing
exitorquitautomatically invokesUnregisterClienton the FileServer, revoking the session token on the storage node.
1.2 Interactive Root Selection¶
When starting with -meta=true, the client displays a numbered menu:
Available roots:
[1] mydrive (personal)
[2] lab_data (shared by romit)
Select root [1-2] or 0 to exit: 1
dvfs> prompt.
2. Shell Commands Reference¶
Navigation & Inspection¶
ls¶
Lists the contents of the current working directory.
- Syntax: ls
- Behavior: Served instantaneously from local CNode cache without network calls.
- Example:
cd <dirname>¶
Changes the current working directory.
- Syntax: cd <dirname>
- Special paths:
- cd /: Navigates to the root of the active storage tree.
- cd ..: Moves to the parent directory. Running cd .. from the top of any root safely exits to the MetaServer root selection menu.
- Note: Multi-segment paths (e.g., cd dir1/dir2) are not supported. Only immediate child directories can be navigated to in a single command.
- Protection: Direct navigation into .trash is strictly forbidden.
pwd¶
Prints the current virtual working directory path.
- Syntax: pwd
- Example:
info¶
Displays metadata attributes for the current directory.
- Syntax: info
- Example:
viscache¶
Renders an indented tree visualization of the client's in-memory CNode cache.
- Syntax: viscache
- Example:
dvfs> viscache
Cache Structure:
- mydrive (directory)
- .trash (directory)
- report.txt (file (cached: true))
refresh¶
Forces an immediate re-fetch of current directory metadata from the FileServer, re-synchronizing the local cache tree.
- Syntax: refresh
- Session Auto-Recovery: Also re-establishes client session registration (ReRegister()) with the FileServer, restoring push notification callbacks without restarting the client if the FileServer had crashed and rebooted.
clear¶
Clears the terminal screen buffer.
- Syntax: clear
File & Directory Management¶
create <filename>¶
Creates a new, empty file in the current directory.
- Syntax: create <filename>
- Example:
mkdir <dirname>¶
Creates a new directory in the current working directory.
- Syntax: mkdir <dirname>
- Example:
read <filename>¶
Reads and displays the text content of a file.
- Syntax: read <filename>
- Behavior: If the file is already cached locally, reads from ./.cache/<UUID> with zero network round trips. If not cached, streams the file from the FileServer, caches it, and displays the content.
- Example:
upload <local_path>¶
Uploads a file or an entire directory tree from the host machine into the current DVFS directory.
- Syntax: upload <path_to_local_file_or_directory>
- Behavior: Splits files into 4 MB chunks and streams them via gRPC UploadFile. Automatically updates live streaming throughput telemetry.
- Example:
dvfs> upload C:\Users\user\Documents\dataset.csv
Uploading 'C:\Users\user\Documents\dataset.csv'...
'C:\Users\user\Documents\dataset.csv' uploaded successfully
download <name>¶
Downloads a remote file or folder into the local ./Download/ directory.
- Syntax: download <filename_or_dirname>
- Behavior: Streams chunks via gRPC DownloadFile into ./Download/<name>.
- Example:
Deletion & Recycle Bin¶
trash <name>¶
Soft-deletes a file or directory, moving it into the user's hidden .trash/ container.
- Syntax: trash [-r] <name>
- Flags: -r (recursive, required for non-empty directories).
- Example:
restore <name>¶
Restores an item from .trash/ back to its original parent directory.
- Syntax: restore <name>
- Example:
show_trash¶
Lists all items currently residing in .trash/.
- Syntax: show_trash
- Example:
clear_trash¶
Permanently destroys all files and directories currently present in .trash/.
- Syntax: clear_trash
- Example:
delete <name>¶
Permanently purges a file or directory immediately without sending it to .trash/.
- Syntax: delete [-r] [-t] <name>
- Flags:
- -r: Recursive delete (required for directories).
- -t: Permanently purges a single specific item directly from .trash/.
- Example:
Sharing & Collaboration¶
sharewith <username>¶
Shares the current working directory with another cluster user.
- Syntax: sharewith <username>
- Behavior: Updates the directory's ACL, propagates permissions down the subtree via recursive DFS, and registers the shared root with the MetaServer.
- Example:
dvfs> sharewith alice
Sharing root directory with 'alice'...
Root directory shared successfully with 'alice'
unsharewith <username>¶
Revokes sharing permissions for a user from the current working directory.
- Syntax: unsharewith <username>
- Example:
dvfs> unsharewith alice
Unsharing root directory with 'alice'...
Root directory unshared successfully with 'alice'
Session Teardown¶
exit¶
Exits the client gracefully.
- Syntax: exit
- Behavior:
1. Clears local UUID cache files via ClearCache().
2. Dispatches UnregisterClient gRPC RPC to the FileServer, immediately removing the active session and decrementing the active connections counter.
3. Closes background callback listeners and exits cleanly.
Diagrams¶
For visual architecture maps, sequence diagrams, and flowcharts describing the client shell, callback handlers, and interactive state lifecycle, please refer to: - Client System Architecture Diagrams