Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces several plumbing CLI commands for dvc-data.
fsck
: Checks all of the objects in the database, similar togit fsck
.ls
: List all items of the tree, similar togit ls-tree
.stage
: Stage, and optionally write objects to database with--write/-w
. Can write in shallow mode with--shallow
.cat
: Print contents of the object to the terminal (and optionally verify object with--check/-c
.p2o
/o2p
-> Path to oid and Oid to path.genrand
-> Generate file with random content (eg:./cli.py genrand sample.txt 1GB
).gensparse
-> Create sparse file in a portable way (eg:./cli.py gensparse sample.txt 1GB
).hash
-> Compute hashes of file, in--text
(dos2unix) vs--binary
mode, with different hashing algorithms specified via--name/-n
.(
./cli.py hash sample.txt -n blake2b --progress --text
)These are small programs meant to assist for local testing/development.
Installation
pip install -e ".[dev]"
Usage:
./cli.py <command> <args>
The default odb is created in
.dvc/cache
folder relative to current working directory by default. Most of the commands take--db
option, that can be used to pass any alternative odb locations. You can also setODB_PATH
envvar so that you don't need to provide that again and again on the commands.eg:
export ODB_PATH=$(mktemp -d)