A simple command line tool to run osmia. It features a ZSH completion script and multiple arguments for code and context.
--code -- Add code as an osmia file
--code-in -- Add code as an osmia string from stdin
--code-str -- Add code as an osmia string
--ctx -- Add context as a JSON file
--ctx-in -- Add context as a JSON string from stdin
--ctx-str -- Add context as a JSON string
--help -h -- Display help information
--version -v -- Display current versionosmia --ctx-str '{"usr": {"name": "Marvin"}}' --code-str "Hello {{usr.name}}"Hello Marvin
osmia --ctx ./context.json --code-str "Hello {{usr.name}}"Hello Marvin
echo '{"usr": {"name": "Marvin"}}' | osmia --ctx-in --code-str "Hello {{usr.name}}"Hello Marvin
curl https://pokeapi.co/api/v2/pokemon/pikachu | \
osmia --ctx-in --code-str \
'The moves of {{ name }} are: {{ moves?map(fn (f) => f.move.name)?join(", ") }}.'This CLI uses the library osmia project. Your can have a look there or in their documentation.
This README asumes that you've renamed the binary osmia-cli to osmia and it's available in your PATH variable.