cli icon indicating copy to clipboard operation
cli copied to clipboard

Issues capturing output of algolia cli / running on headless systems

Open dr-kd opened this issue 7 months ago • 5 comments

A couple of issues spotted when running algolia CLI headless:

1 - important - using algolia cli for reporting from scripts

Seems like algolia CLI is a good component for no code integrations if this was fixed

psql -t postgres://user@pass:host.name/mydb -c 'select row_to_json(a) from my_data a' \
    |      algolia objects import my_poc --file - \
| tee /tmp/result.txt ; cat /tmp/result.txt && echo ===END==

results in this output on console and the empty file /tmp/result.txt:

===END==

I would expect to see something like the below in the file and console but it's empty.

✓ Successfully imported 9999 objects to my_poc 9.99999s

This one is less important but still significant

Shows that the CLI is written with some assumptions about what type of system it's running on. In this case a headless VM in the cloud:

   $ algolia open cli-repo
   exec: "xdg-open": executable file not found in $PATH

In this case where xdg-open is unavailable I'd expect the tool to echo the URL.

dr-kd avatar Jul 17 '24 00:07 dr-kd