Create formula programatically

How can a formula be created programatically?

The sample I’ve found seems broken:

$ echo '{"formula":"rit demo create formula", "lang":"shell", "workspacePath":"/users/dennis/home/ritchie-formulas", "formulaPath":"/demo/create/formula"}' | rit create formula --stdin

stdin commands are deprecated and will no longer be supported in future versions. Please use flags for programatic formula execution
Error: this input must not be empty

Changing “formula” to “formulaCmd” worked somewhat better, but it seems to me that STDIN approach is retired and CLI parameters should be used instead. Can’t find them though…

Hey, @andrevtg!

Here’s the link about input flags. If you need anything more, just let us know!

Still can’t find any working example for a programatic use of rit create formula.

The stdin sample seems broken and those same argument names are refused if I try to use them as input flags.

Ok, finally it worked:

cat << EOF |
    "formulaCmd": "rit oioi teste",
    "lang": "shell-bat",
    "workspace": {"name": "my-formulas", "dir": "/home/fulano/projetos/xxx" },
    "formulapath": "/home/fulano/projetos/xxx/oioi/teste/"
rit create formula --stdin

The example in Core commands | Ritchie does not work anymore, and if there is an input flag way I could not find it. :frowning:

Seems like we definitely need to improve the docs about such matter! @andrevtg, would it be possible for your to create a bug report about the docs on their respective repository, please?

It is very important that we should look at this, indeed. If it isn’t possible to open the report, please let me know and I will write it.