CLI tool to manage Central servers

Buen trabajo compa!!! will there be one for central? or would we have to build that from the ground up?

1 Like

Its probably worth mentioning, in case you are not aware, that Central provide a very nice fully-functional REST API. This allows you to do pretty much anything, and can be driven using standard command-line web tools like the ubiquitous cURL. cURL is obviously pretty generic and non-specific to Central (unlike aggregate-cli) but if you dont mind getting your hands dirty you could probably script many of the operations you want to perform using curl/Central REST. eg the following would give you the list of submissions for form $FORM (under project $PROJECT):

curl -X GET -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' $HOST/v1/projects/$PROJECT/forms/$FORM/submissions

(I'm using a Unix command-line shell here, hence $FOO shell variables)

1 Like

Well, the aggregate-cli is a simple Java program that runs shell commands, so it could be adapted to support Central's workflow but I'm guessing that the Central team would prefer to have a tool written in their technology stack instead.

1 Like

hmm, i'm not sure! i've advocated for some kind of tool like this for a while now. i had different ideas on how it might be done, but certainly being picky about the technology stack isn't an objection i would advance. if we see a chance for this tool to work for central i'd be all for it!

2 Likes

~Id love to take this on at some point, would need considerable guidance for sure~

Looks like this exists already kind of?
https://docs.opendatakit.org/central-command-line/

Hi all,
I find the concept very interesting. I currently have a custom CLI tool based on the Central API documentation here written in python3. I would more than love to contribute if anyone would like to give this a go.

2 Likes

@aankrah that tool looks great, thanks for sharing! Is it available anywhere?

@dmenne is working on an R package to drive the Central API with a focus on replicating the management functionality of the Central GUI. It's elegant base R, R6, object oriented, and has minimal dependencies. It's not public yet but I'm looking forward to it becoming so.

The other R package for Central, ruODK, focuses more on the data retrieval side, but any contributions covering more API endpoints are always welcome. It's tidyverse, functional, and S3.

@Florian_May you lost me at a number of turns there. The "tool" I have is written solely in Python as I mentioned in my original post.
I haven't yet had any interaction with ruODK or R.

I think it would be cool to tweak my current script and maybe put it up on Git. I'll be sure to post a link here when its up.

1 Like

@Florian_May you can check this out on github.

1 Like

Thanks for sharing this, Anthony! Looks like it's gonna come in handy for folks wanting to customise their workflow or integrate Central into some bespoke other architecture.

2 Likes