Blink Xcall Docs

Not sure if you still need help with this, but when I type xcall —help I get extra information:

blink> xcall -h Usage: xcall [ap:j:b:i:s:vh] url -a runs command asynchoniosly. -i <param_name> reads stdin and pass content to url as param_name. -p name=value url encode value and adds that parameter to query. -b <param_name> decodes value of result param_name in base64 and prints it. -j <param_name> prints value of result param_name in pretty json format. -s <param_name> prints value of result param_name (url decoded). -v verbose.

This seems to have been present since this commit on their repository:

On its own this is pretty helpful already, but it does seem like more explicit usage information could be beneficial.

I am not sure if you need help understanding these flags, but I will document what I understand of them here for people who might come across this question from a search engine, and hopefully people with more experience can chime in an help as well:

 -i param_name - The way I interpret this is that when you use this flag, these two things are almost the same: xcall -p some_param=“some value for my param” and echo “some value for my param” | xcall -i some_param 

 -p name=value - will add parameters to the url passed to xcall, automatically encoding them for urls. So this: xcall -p some_param=“some value” xcall://url becomes xcall xcall://url?some_param=some%20value 

 -b param_name - will decode a parameter with the name passed to this flag from base64. Assuming an x-callback-success response being returned to blink shell like this; blinkshell://x-success/<LONG_UID_HERE>?param_name= it will decode the value of param_name 

 -j param_name - same as -b param_name but for json. It will also pretty-print the json output, so if you need raw json you might need to serialize the value again

 -s param_name - will parse the url encoded value of param_name into a string and print it to stdout.

 -v - this is useful to see what params are being used when calling xcall

 -a - from what I could understand of the code, this kicks off the x-callback url request and returns to the prompt right away. Probably meant for long running tasks that might take some time to return a result. Not sure how to properly use this flag though. Perhaps you need to pass your own x-success x-callback-url parameter. Here more documentation could be really useful as well.

All of this information is provided as is, and as of today, Apr 19 2022, I haven’t really been able to get xcall to function with even the most basic of x-callbacks. For example, I can send a request to working-copy://x-callback-url/repos?key=mykey from and get a result with the json information about my repos. The same request using xcall will flash workingcopy to the foreground, then switch back to blink, but the terminal is now stuck, and I need to ctrl-c out of xcall with nothing displayed on the screen. I went ahead and opened a ticket with the developers to see if I can figure out why this isn’t working as expected. For the curious: