diff --git a/orcli b/orcli index cf6b837..9273e1d 100755 --- a/orcli +++ b/orcli @@ -1121,9 +1121,17 @@ orcli_list_command() { orcli_info_command() { # src/info_command.sh # shellcheck shell=bash disable=SC2154 + # get project id projectid="$(get_id "${args[project]}")" - echo "$projectid" + + if ! response="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-project-metadata")"; then + error "reading metadata of ${args[project]} failed!" + else + columns="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-models" | jq '[ .columnModel | .columns[] | .name ]')" + jq "{ id: ${projectid} } + . + {columns: $columns }" <<<"$response" + fi + } # :command.function diff --git a/src/info_command.sh b/src/info_command.sh index bb89eee..8cdf727 100644 --- a/src/info_command.sh +++ b/src/info_command.sh @@ -1,4 +1,11 @@ # shellcheck shell=bash disable=SC2154 + # get project id projectid="$(get_id "${args[project]}")" -echo "$projectid" \ No newline at end of file + +if ! response="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-project-metadata")"; then + error "reading metadata of ${args[project]} failed!" +else + columns="$(curl -fs --get --data "project=${projectid}" "${OPENREFINE_URL}/command/core/get-models" | jq '[ .columnModel | .columns[] | .name ]')" + jq "{ id: ${projectid} } + . + {columns: $columns }" <<<"$response" +fi