A command-line interface to interact with your Bedrock encrypted drive on Aleph. Upload, list, and download files — all end-to-end encrypted and fully compatible with the Bedrock web app.
- Upload files with automatic client-side encryption
- List all files on your drive with size, date, and status
- Download and decrypt files back to your local machine
- Directory support — organise files into virtual folders
- Wallet-compatible — uses the same key-derivation as the web app, so files show up everywhere
| Requirement | Version |
|---|---|
| Node.js | ≥ 18 |
| npm | ≥ 9 |
The CLI depends on the local bedrock-ts-sdk package (linked via file:../bedrock-sdk), so make sure the SDK is built before installing.
# 1. Build the SDK first
cd ../bedrock-sdk
npm install && npm run build
# 2. Install CLI dependencies
cd ../aleph-cli
npm installThe CLI needs an Ethereum private key to derive your Bedrock account. You can provide it in two ways:
-
Environment variable — create a
.envfile in thealeph-cli/directory:PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
-
CLI flag — pass it directly with
--key:npx tsx index.ts upload ./photo.png --key 0xYOUR_PRIVATE_KEY
Important
Use the same private key as your wallet in the Bedrock web app.
The CLI signs the message "Bedrock.im" to derive the same sub-account, so your files will be consistent across both interfaces.
These options are available on every command:
| Flag | Description | Default |
|---|---|---|
-k, --key <key> |
Ethereum private key | PRIVATE_KEY env var |
-c, --channel <channel> |
Aleph channel name | GENERAL |
-a, --api <url> |
Aleph API server URL | https://poc-aleph-ccn.reza.dev |
Run any command with:
npx tsx index.ts <command> [arguments] [options]Encrypts and uploads a local file to your Bedrock drive.
npx tsx index.ts upload <filePath> [options]| Option | Description | Default |
|---|---|---|
-d, --directory <dir> |
Target directory on the drive | / |
Examples:
# Upload to root
npx tsx index.ts upload ./report.pdf
# Upload to a specific folder
npx tsx index.ts upload ./photo.png -d /images/vacation/Displays all files on your Bedrock drive in a formatted table.
npx tsx index.ts list [options]| Option | Description | Default |
|---|---|---|
-d, --directory <dir> |
Filter by directory path | (all files) |
--include-deleted |
Show trashed files too | false |
Examples:
# List all files
npx tsx index.ts list
# List only files in /documents/
npx tsx index.ts list -d /documents/
# Include trashed files
npx tsx index.ts list --include-deletedSample output:
Found 3 file(s):
Path Size Created Status
--------------------------------------------------------------------------------
/report.pdf 1.2 MB 2/17/2026, 3:45 PM ✅ active
/images/vacation/photo.png 824.5 KB 2/18/2026, 10:12 AM ✅ active
/old-draft.txt 3.1 KB 2/15/2026, 9:00 AM 🗑️ trashed
Downloads and decrypts a file from your Bedrock drive to your local machine.
npx tsx index.ts download <remotePath> [options]| Option | Description | Default |
|---|---|---|
-o, --output <path> |
Local output file path | Current dir, same filename |
Examples:
# Download to current directory
npx tsx index.ts download /report.pdf
# Download to a specific location
npx tsx index.ts download /images/photo.png -o ~/Downloads/photo.pngaleph-cli/
├── index.ts # CLI entry point — all commands defined here
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript configuration
└── .env # Your private key (create this, git-ignored)
-
Key derivation — The CLI signs the message
"Bedrock.im"with your private key (usingweb3.eth.accounts.sign), producing the same signature the web app generates via MetaMask. This ensures both interfaces derive the same Aleph sub-account. -
Encryption — Files are encrypted client-side by the Bedrock SDK before being stored on Aleph. Only your derived key can decrypt them.
-
Storage — Encrypted file blobs are stored on the Aleph decentralised network. File metadata (paths, sizes, timestamps) is stored in an Aleph aggregate, also encrypted.
# Run in development
npx tsx index.ts --help
# Or use the npm script
npm start -- --helpPart of the Bedrock project.