Skip to content

Jkutkut/osmia-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Osmia CLI:

A simple command line tool to run osmia. It features a ZSH completion script and multiple arguments for code and context.

Usage

--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 version

Examples

Hello World

osmia --ctx-str '{"usr": {"name": "Marvin"}}' --code-str "Hello {{usr.name}}"
Hello Marvin

Context from file:

osmia --ctx ./context.json --code-str "Hello {{usr.name}}"
Hello Marvin

Context from stdin:

echo '{"usr": {"name": "Marvin"}}' | osmia --ctx-in --code-str "Hello {{usr.name}}"
Hello Marvin

Process API response:

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(", ") }}.'

Syntax:

This CLI uses the library osmia project. Your can have a look there or in their documentation.

Note:

This README asumes that you've renamed the binary osmia-cli to osmia and it's available in your PATH variable.

About

Simple command line tool to use osmia

Topics

Resources

License

Stars

Watchers

Forks