Commandline tool that helps you to create, update, deploy, redeploy, delete forms in Kobo-toolbox.
-
Python v3.12.4. or greater should be installed. To install python. install python
To check python version installed on your system follow:
python --version
- Create a Kobo-toolbox account Signup kobotoolbox
To install/update Bifrost CLI Tool. Navigate to your terminal and run following command.
pip install git+https://github.com/sankalpa-adhikari-sa/Kobo-bifrost-cli.git@v0.0.2
_Note: It is recommended to install this package by creating a python virtual enviroment to avoid any conficts that may arise due to changes in dependencies packages version.
After successfully installing the CLI tool. Navigate to your terminal (if you are using python enviroment first activate your python enviroment on which cli is installed) and use bifrost
command to use it's funtions.
To uninstall Bifrost CLI Tool. Naviagate to your terminal and run following command.
pip uninstall bifrost
Command | Description | Options |
---|---|---|
init |
Initializes a new project by creating a structured Excel workbook with optional conditional formatting. | |
list-assets |
Lists all assets with basic information | |
create |
Creates a new asset in kobotoolbox | --filepath [--deploy, -d] |
preview |
Preview asset snapshots | --asset-id |
deploy |
Deploys an specified asset | --asset-id |
update |
Updates a specified existing asset | --asset-id --filepath [--deploy, -d] [--redeploy, -rd] [--preview-snapshots, -ps] |
redeploy |
Redeploys a specified asset | --asset-id |
delete |
Deletes a specified asset | --asset-id |
asset xls |
Downloads specified asset in Xls format. | --asset-id --download-path |
asset xml |
Downloads specified asset in Xml format. | --asset-id --download-path |
set-permissions |
Sets asset permissions | --asset-id --no-auth-sub |
clone-permissions |
Clones permissions from source project to another target project. | --from --to |
The config group allows you to set up and view your Bifrost CLI configuration.
Command | Description | Options |
---|---|---|
set-credentials |
Set credentials by providing an API key and API URL. | --api-key --api-url |
remove-credentials |
Clear saved API credentials (API key and API URL). | |
status |
Check the current credentials status. | bifrost config view |
Command | Option | Values | Description |
---|---|---|---|
export csv or export xls |
--output-name |
TEXT |
Output file name |
--asset-id |
TEXT |
The asset ID of the asset to export data. | |
--download-path |
TEXT |
Download path. Defaults to the current directory. | |
[--separator, -sep] |
TEXT |
Group Separator for data. Default= / | |
[--current-version, -c] |
Include data from all Versions default=False | ||
[--gheaders, -gh] |
Include group headers in the export. default=True | ||
[--language, -lang] |
[_default,_xml, <languagecode>] |
Language for the export: _default, _xml or language code. default=_default | |
-[-no-media-url, -nmu] |
Include media URL in the export. default=False | ||
[--multiple-select, -ms] |
[details, both, summary] |
Export select many question as default=summary | |
export xls |
[--xtext, -xt] |
Store data and number response as text. default=False |
To use Bifrost CLI you first need to setup your API URL and API Key.
bifrost set-credentials --api-key CONFIG_API_KEY --api-url CONFIG_API_URL
bifrost status
bifrost remove-credentials
Creates a new XLS form locally.
bifrost init
Creates a koboform as draft file in kobotoolbox.
bifrost create --filepath PATH_TO_XLS_FORM
bifrost deploy --asset-id ASSET_ID
bifrost preview --asset-id ASSET_ID
bifrost update --asset-id ASSET_ID --filepath PATH_TO_XLS_FORM
bifrost redeploy --asset-id ASSET_ID
bifrost create --filepath PATH_TO_XLS_FORM -d
bifrost update --asset-id ASSET_ID --filepath PATH_TO_XLS_FORM -rd
bifrost delete --asset-id ASSET_ID
bifrost export xls --asset-id ASSET_ID --output-name FILE_NAME --download-path DOWNLOAD_DIR_PATH -sep "/" -c -gh -lang "Nepali (ne)" -nmu -xt -ms "both"
bifrost set-permissions --asset-id ASSET_ID --no-auth-sub
bifrost clone-permissions --from SOURCE_ASSET_ID --to TARGET_ASSET_ID
SOURCE_ASSET_ID
is the uid of Koboform form which you want to copy premission to your target form.
Additionally Bifrost cli creates .bifrost/info.txt
folder in your project directory which saves asset-id , download-path, and file-path while using the commands. If the arguments are not provided bifrost uses the values from the bifrost/info.txt
file.
For example:
If both ASSET_ID and PATH_TO_XLS_FORM is availabe in info.txt file
bifrost update --asset-id ASSET_ID --filepath PATH_TO_XLS_FORM
will be reduced to just
bifrost update