CLI Reference¶
Complete documentation for all Blacklake CLI commands.
Overview¶
Blacklake provides a comprehensive command-line interface for managing data repositories with semantic metadata. All commands follow git-like conventions for familiarity.
Command Structure¶
Global Options¶
| Option | Description |
|---|---|
--version | Show version and exit |
--help | Show help and exit |
--verbose | Enable verbose output |
--quiet | Suppress output except errors |
Available Commands¶
Usage: [OPTIONS] COMMAND [ARGS]...
Blacklake: A git-like data storage and retrieval system for S3/object
stores.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
add Add file(s) to the staging area.
branch List, create, or delete branches.
checkout Checkout a branch or commit.
commit Commit staged changes.
index Index data into Solr.
init Initialize a new blacklake repository.
log Show commit logs.
meta Metadata management commands.
pull Pull commits from remote object store.
push Push commits to remote object store.
remote-add Add a remote repository.
remote-set-url Set remote repository URL.
rm Remove file(s) from the staging area.
search Search for data using Solr.
status Show the working tree status.
tag Create a tag.
Command Details¶
Repository Management¶
blacklake init¶
Initialize a new Blacklake repository.
Options: - --bare - Create bare repository - --s3-endpoint - S3 endpoint URL - --s3-bucket - S3 bucket name - --s3-region - S3 region (default: us-east-1) - --s3-access-key - S3 access key - --s3-secret-key - S3 secret key
Examples:
# Initialize with MinIO
blacklake init \
--s3-endpoint http://localhost:9000 \
--s3-bucket my-data \
--s3-access-key minioadmin \
--s3-secret-key minioadmin
# Initialize with AWS S3
blacklake init \
--s3-endpoint https://s3.amazonaws.com \
--s3-bucket company-data-lake \
--s3-region us-west-2
Expected Output:
blacklake status¶
Show working tree status.
Options: - --porcelain - Machine-readable output - --short - Short format output
Examples:
Expected Output:
File Operations¶
blacklake add¶
Add files to the staging area.
Options: - --all - Add all files - --force - Force add ignored files
Examples:
# Add specific file
blacklake add data.csv
# Add all files
blacklake add --all
# Add multiple files
blacklake add data.csv metadata.json
Expected Output:
blacklake rm¶
Remove files from working tree and staging area.
Options: - --cached - Remove from staging area only - --force - Force removal
Examples:
Expected Output:
blacklake commit¶
Record changes to the repository.
Options: - -m, --message - Commit message (required) - --author - Override author - --email - Override email
Examples:
# Simple commit
blacklake commit -m "Add sales data"
# Commit with author
blacklake commit -m "Add sales data" --author "Data Team" --email "data@company.com"
Expected Output:
Metadata Commands¶
blacklake meta¶
Metadata management commands.
blacklake meta init¶
Initialize metadata system.
Expected Output:
blacklake meta add¶
Add metadata to an object.
Options: - --title - Object title - --description - Object description - --creator - Creator name - --email - Creator email - --keywords - Comma-separated keywords - --rights - Rights statement - --license - License URL
Examples:
# Add metadata interactively
blacklake meta add data.csv --title "Sales Data"
# Add full metadata
blacklake meta add data.csv \
--title "Sales Data 2024" \
--description "Q1-Q4 sales data" \
--creator "Data Team" \
--email "data@company.com" \
--keywords "sales,revenue,2024" \
--rights "CC BY 4.0" \
--license "https://creativecommons.org/licenses/by/4.0/"
Expected Output:
blacklake meta validate¶
Validate metadata using SHACL shapes.
Options: - --all - Validate all metadata - --format - Output format (json, text)
Examples:
# Validate specific file
blacklake meta validate data.csv.meta.jsonld
# Validate all metadata
blacklake meta validate --all
Expected Output:
blacklake meta export¶
Export metadata in specified format.
Options: - --format - Export format (ttl, nquads, jsonld)
Examples:
# Export as Turtle
blacklake meta export --format ttl
# Export as N-Quads
blacklake meta export --format nquads
Expected Output:
@prefix bl: <https://sempervent.github.io/blacklake/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
bl:obj:sha256:abc123... a dct:Dataset ;
dct:title "Sales Data 2024" ;
dct:creator [ a foaf:Person ;
foaf:name "Data Team" ;
foaf:mbox <mailto:data@company.com> ] .
Exit Codes¶
| Code | Description |
|---|---|
0 | Success |
1 | General error |
2 | Configuration error |
3 | Network error |
4 | Validation error |
Examples¶
Complete Workflow¶
# Initialize repository
blacklake init --s3-endpoint http://localhost:9000 --s3-bucket my-data
# Add metadata to file
blacklake meta add data.csv --title "Sales Data" --creator "Data Team"
# Stage and commit
blacklake add data.csv
blacklake commit -m "Add sales data with metadata"
# Push to remote
blacklake push origin main
# Search data
blacklake search "sales"
Batch Operations¶
# Add multiple files with metadata
for file in *.csv; do
blacklake meta add "$file" --title "$(basename "$file" .csv)" --creator "Data Team"
blacklake add "$file"
done
blacklake commit -m "Add multiple datasets"
blacklake push origin main
Next Steps¶
- Server API - REST API documentation
- Metadata Model - Understanding semantic metadata
- Architecture - How Blacklake works