Skip to content

Latest commit

 

History

History
102 lines (69 loc) · 1.74 KB

api_cmd.md

File metadata and controls

102 lines (69 loc) · 1.74 KB

ForkBase Commandline Console API

NOTE

Currently, we only support VString related object operations.

  [command] get

    // get the value of a branch head
    get $KEY -b $BRANCH
    // get the value of a version
    get $KEY -v $VERSION
  [command] put

    // put a value referring a branch
    put $KEY $VALUE -b $BRANCH

    // put a value referring an existing version
    put $KEY $VALUE -v $VERSION
  [command] merge

    // merge target branch to a refering branch
    merge $KEY $VALUE -b $BRANCH -b $BRANCH

    // merge target branch to a refering version
    merge $KEY $VALUE -b $BRANCH -v $VERSION

    // merge two existing versions
    merge $KEY $VALUE -v $VERSION -v $VERSION
  [command] branch

    // create a new branch which points to the head of a branch
    branch $NEW_BRANCH -b $OLD_BRANCH

    // create a new branch which points to an existing version
    branch $NEW_BRANCH -v $OLD_VERSION
  [command] rename

    // rename an existing branch
    rename $OLD_BRANCH $NEW_BRANCH
  [command] delete

    // delete an existing branch
    delete $OLD_BRANCH
  [command] list

    // list all keys
    list
    // list all branches of a key
    list $KEY
  [command] head

    // get head version of a branch
    head $KEY $BRANCH
  [command] latest

    // get all latest versions of a key
    latest $KEY