CookCLI is provided as a command-line tool to make Cook recipe management easier

Related tags

Command Line CookCLI
Overview

CookCLI

CookCLI is provided as a command-line tool to make Cook recipe management easier, and enable automation and scripting workflows for the CookLang ecosystem.

Installation

Download latest release for your platform from the releases page and add the file to your operating system's PATH.

On Linux (or WSL), this is easy. Simply extract the binary into your binaries folder with sudo unzip CookCLI_1.0.0_linux_amd64.zip -d /usr/local/bin/ (note: you may need to install the unzip package first).

TODO: Mac install.

Usage

cook is a toolkit for command-line interaction with CookLang text files You can find full documentation at https://cooklang.org/cli/help/ and report issues at https://github.com/CookLang/CookCLI

Usage: cook [OPTIONS] COMMAND

Options:
    -a, --aisle 
   
                 Specify an aisle.conf file to override shopping list default settings 
    -u, --units 
    
                  Specify a units.conf file to override units default settings
    -i, --inflection 
     
         Specify an inflection.conf file to override default inflection settings
    -h, --help                      Show help information.

Commands:
    recipe                  Manage recipes and recipe files
    shopping-list           Create a shopping list
    server                  Run a webserver to serve your recipes on the web
    fetch                   Pull recipes from the community recipe repository
    version                 Show the CookCLI version information
    help                    Show the help text for a sub-command

     
    
   

Contribution

Please open issues for any ideas you may have to contribute to the project.

License

MIT License

Copyright (c) 2021 Alexey Dubovskoy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • demo server instance + server issue

    demo server instance + server issue

    I was able to find photos from the iOS app, but not the webserver. Did I miss them?

    Update: tried getting it to run myself and am running into issues with server

    My tree after running ./cook seed to generate recipes.

    .
    ├── Baked Potato Soup.cook
    ├── Borsch.cook
    ├── Breakfasts
    │   ├── French Breakfast.cook
    │   ├── Irish Breakfast.cook
    │   ├── Irish Breakfast.jpg
    │   ├── Jamie
    │   │   ├── Easy Pancakes.cook
    │   │   └── Mexican Style Burrito.cook
    │   └── Oats.cook
    ├── cook (binary)
    ├── Lazy Tomato and Cuke Salad.cook
    ├── Neapolitan Pizza.cook
    ├── Olivier Salad.cook
    ├── Potstickers.cook
    ├── README.md
    ├── Root Vegetable Tray Bake.cook
    ├── Salads
    │   ├── Beetroot, feta & grain salad.cook
    │   └── Caprese Salad.cook
    ├── Sicilian-style Scottadito Lamb Chops.cook
    ├── Snack Basket I.cook
    ├── Snack Basket II.cook
    └── Zharkoe.cook
    
    

    OS: Ubuntu 20.04 Browser: FF 93.00

    When serving with ./cook server and browsing to 127.0.0.1:9080, I am greeted with this

    Thanks for your help, this looks like a really cool project!

    opened by juliangaal 10
  • Feature request: Wrap text for Steps in `recipe read`'s text output

    Feature request: Wrap text for Steps in `recipe read`'s text output

    Hello! Love this tool so far.

    It looks like a recipe's steps are required to be on a single line. When reading the recipe via the cli-tool (eg: cook recipe read Baked\ Potato\ Soup.cook) each step is rendered on a line which takes the full length of the terminal window (see screenshot below).

    Feature request: can this output be wrapped to 80 characters or made configurable what the line width should be?

    IMO, this would make for more readable recipe cards.

    Screen Shot 2022-05-25 at 11 01 16 AM
    opened by higgins 6
  • Improve build documentation

    Improve build documentation

    Hi,

    I'm trying to prepare an arch linux package for this but the build documentation is kinda lacking. Right now I got it boiled down to this:

    1. checkout code
    2. run make prepare (this fails on linux because of different sed implementations and I guess you need node and something called rollup.js too?)
    3. run swift build --configuration release -Xswiftc -static-stdlib
    4. take binary from .build/x86_64-unknown-linux-gnu/release/cook
    documentation 
    opened by SebRut 6
  • User customisation of default headers generated from cook-recipe-read

    User customisation of default headers generated from cook-recipe-read

    The default output generated from:

    cook recipe read <recipe-file>
    

    Generates a structure with four headers: Metadata, Ingredients, Cookware, Steps. Is it possible to change these headings for specific cases where alternate headings are preferred?

    For example, files being shared within a small food manufacturer could be given the corresponding headers: Product, Materials, Equipment, Operations.

    opened by edibotopic 5
  • Suggestion for a Print Layout

    Suggestion for a Print Layout

    Hi, thank you for making Cooklang!

    I have created some CSS adjustments for the Recipe page which makes it easier to print the page.

    Since I don't know anything about Stelve or Swift, I cannot make a real PR, but I feel like it would be a waste to not share it. So if you ever want to incorporate something like this, I invite you to take this as an example.

    image

    And that is the code behind it:

    @media print {
        nav.navbar, .btn {
            display: none;
        }
    
        ol.breadcrumb li:not(:last-of-type) {
            display: none;
        }
    
        li.breadcrumb-item {
            font-size: 2em;
        }
    
        .breadcrumb-item+.breadcrumb-item::before {
            content: '';
        }
        
    
        ul.nav {
            display: none;
        }
    
    
        .tab-content>.tab-pane {
            display: block;
        }
    
        .tab-content>.tab-pane:first-of-type {
            width: 20rem;
            border: 1px solid black;
            border-radius: 0px;
            padding: 1.5rem 1rem;
    
            float: left;
            margin-right: 2rem;
            margin-left: 1rem;
        }
    
        .tab-content>.tab-pane:nth-of-type(2) {
            display: none;
        }
    }
    
    opened by jeyemwey 4
  • [Question] Does the arm64 binary work on Android using Termux?

    [Question] Does the arm64 binary work on Android using Termux?

    Hey - in case I haven't mentioned it, I'm absolutely IN LOVE with this project! I've already started converting many of my own recipes into this format, and it's been so immeasurably helpful.

    I often use Termux on my android device, and tried to run the arm64 binary on it, but when I do, I get the error:

    29950 invalid system call cook
    

    Am I doing something wrong?

    opened by shayaknyc 4
  • Shopping list segmentation fault

    Shopping list segmentation fault

    Started server on http://127.0.0.1:9080, serving cook files from /Users/azlekov/Workspace/cookbook.
    [1]    24627 segmentation fault  cook server
    

    Steps to reproduce:

    1. cook seed
    2. cook server
    3. Click on Shopping list

    Steps to reproduce 2:

    1. cook seed
    2. cook server
    3. Click on recipe and add to shopping list
    4. Click on Shopping list

    OS: macOS X 12.2.1 Version of the CLI: 0.1.3

    bug 
    opened by azlekov 3
  • cook server not starting

    cook server not starting

    I'm having an issue with the cook server ; here is the error (Ubuntu 20.04) :

    cook: dl-call-libc-early-init.c:37: _dl_call_libc_early_init: Assertion `sym != NULL' failed.
    [1]    15474 abort (core dumped)  cook server
    

    It seems to be a compatibility problem old/mordern Linux distribution maybe more here.

    -> but it only happen on v0.1.3 ; v0.1.2 works fine

    bug 
    opened by Haelle 3
  • CookCLI cannot be opened on a mac

    CookCLI cannot be opened on a mac

    Very possible I just don't know what I'm doing, but trying to run the CLI on a mac runs me into the attached error. I'm using the full file path when I run it.

    Screen Shot 2021-10-29 at 3 00 01 PM bug 
    opened by lenniecottrell 3
  • Hardcoded cover image path

    Hardcoded cover image path

    From https://github.com/cooklang/CookCLI/issues/2#issuecomment-953358205:

    were you able to use images in the web view? According to the docs, I just need to place an image with the same name as the recipe in the directory of the recipe, but nothing is showing.

    @juliangaal From my testing, it somewhat works. This is my directory layout; if I understand the docs correctly, the bottom image (without .2) should be displayed as the recipe cover and the other should be displayed somewhere around step 3.

    image

    The cover image works fine but the one that's supposed to accompany step 3 does not show up. I assume it's just not implemented in CookCLI yet.

    images

    That's all with the local server though. The one on my VPS doesn't show images at all, because it's requesting them from a hardcoded localhost URI instead of a relative path.

    https://user-images.githubusercontent.com/29460675/139160265-d0515226-f538-4a42-b22c-75f90a495e5d.mp4

    I imagine the fix is simple enough that I could open a PR without knowing Swift at all; I can take a look at it in a bit if @dubadub is alright with that :smile:

    server 
    opened by Amolith 3
  • Workflow to work with Javascript

    Workflow to work with Javascript

    Hello, I was wondering if there was a way to make this work with web browsers, so that a Javascript function can process the parsed results of cooklang.

    Thanks, Nakul

    question 
    opened by theslyprofessor 3
  • Adding preperation instructions for ingredients inside `{}` causes undesired output behavior with plural units

    Adding preperation instructions for ingredients inside `{}` causes undesired output behavior with plural units

    I apologize in advance if I am not using cooklang in the intended manner, but I think I have discovered a use case that is not included in the specification or example recipes.

    In most recipes, physical preparation instructions for ingredients (like dicing, chopping, mincing, cutting on bias, etc.) are specified with the ingredient quantities. For example, a recipe calling for 2 cups of finely chopped carrots would have the following entry for carrots in the Ingredients list:

    Ingredients:

    • 2 cups carrot, finely chopped

    When I'm writing this recipe in cooklang, I want the preparation instructions for carrots to appear in the Ingredients section of the output of $ cook recipe read. I could include the preparation instructions in a comment, but that wouldn't show up in the output. In order to have the preperation instructions appear in the Ingredients section, I included them inside the curly braces {} after the unit when defining the ingredient. Here's an example:

    Add @carrots{2%cup, finely chopped}
    

    The desired output of $ cook recipe read would be:

    Ingredients:
        carrots                  2 cups, finely chopped
    
    Steps:
         1. Add carrots
            [carrots: 2 cups]
    

    However, the actual output of $ cook recipe read is:

    Ingredients:
        carrots                  2 cup, finely choppeds
    
    Steps:
         1. Add carrots
            [carrots: 2 cup, finely choppeds]
    

    In this example, cooklang thinks that the entire string following the % character inside {} is the unit. When cooklang attempts to use the plural form of the unit (since the recipe requires 2 cups plural of carrots), cooklang appends an "s" to the last word in the string (chopped) instead of the actual unit (cup).

    I think I've accidentally uncovered two issues here:

    1. How should users include preparation instructions for ingredients so they appear in the Ingredients section of the output of $ cook recipe read?
    2. Is the unit parser behaving as intended in this case?

    One option would be to have cooklang consider only the word immediately after the % character to be the unit, and ignore everything else.

    opened by isobering 0
  • Add support for ingredient unit: %

    Add support for ingredient unit: %

    I just tried to write down this recipe from Glen and Friend's Cooking in cooklang when I discovered that there is no way of escaping the % character for ingredient units.

    The recipe in the description of the video calls for 100% chicken bones.

    I tried @chicken bones{100%%} and got 100 chicken bones :laughing: Tested it in the playground.

    opened by D4ntin 1
  • Ingredient Nicknames [suggestion]

    Ingredient Nicknames [suggestion]

    When making some cooklang recipes, I have noticed that there is not a good way to represent certain ingredients. In the real world, you would be given an ingredient list that may include "Campbell's Condensed Cream of Chicken Soup (10.75oz can)," while in the recipe it references this item only as "the soup." Cooklang only supports one name for each ingredient, so in the recipe, this item would be referred to by its full name (rather encumbering).

    I suggest a "nickname" definition, perhaps like so: Add the @Campbell's Condensed Cream of Chicken Soup(soup){1%can} or perhaps: Add the @Campbell's Condensed Cream of Chicken Soup{(soup)1%can} or maybe with [brackets], who knows?

    Either way, I highly recommend these changes to improve the "natural" language of recipes.

    As an aside, this would also allow for much more information to be placed within the actual ingredients section that may not be necessary in the directions.

    opened by AlgebraManiacABC 0
  • Long Ingredient Text Lost (>30 characters)

    Long Ingredient Text Lost (>30 characters)

    image

    The above image shows the issue; when I create an ingredient with more than 30 characters, any extra characters are omitted completely.

    I recommend either shifting the ingredient measurements to the right, or wrapping the ingredient to the next line.

    bug 
    opened by AlgebraManiacABC 0
  • Produce consistent output

    Produce consistent output

    When running cook recipe file.cook, cookware and ingredients are output in a random order. It would be nicer for readers if they were presented in a consistent fashion.

    For cookware, I'd argue "in the order listed in the recipe" is the most consistent.

    For ingredients, there's a few options (I favour the latter):

    • In order of use in recipe
    • By amount, largest first
    • Alphabetically, or alphabetically grouped by shopping-list category (as long as we have categories available, grouping veggies, spices, etc. in the recipe output is helpful)

    Regardless of order chosen, it should be consistent for all output formats.

    opened by jamie 0
  • Cookware Quantity Bug

    Cookware Quantity Bug

    The cooklang spec states that quantity for cookware is supported. However, when running it, the output shows a warning.

    Actual Output

    $ cook recipe read << EOF
    #test{1}
    EOF
    Warning: expected '}' but got 1
    Ingredients:
    
    
    Cookware:
        test
    
    Steps:
         1. test1}
            [–]
    

    Expected Output

    $ cook recipe read << EOF
    #test{1}
    EOF
    Cookware:
        test                          1
    
    Steps:
         1. test
            [–]
    

    EBNF

    ...
    cookware             = one word cookware | multiword cookware ;
    +one word cookware    = "#", ( word,                     [ "{", [ quantity ], "}" ] ) ;
    multiword cookware   = "#", ( word, { text item - "{" }-, "{", [ quantity ], "}" ) ;
    ...
    
    $ cook version
    v0.1.4 – in food we trust
    
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 22.04 LTS
    Release:        22.04
    Codename:       jammy
    
    opened by nicholaswilde 0
Releases(v0.1.6)
Owner
null
A Mac command-line tool that generates kick-ass Jamf Pro reports.

KMART - Kick-Ass Mac Admin Reporting Tool A command-line utility generating kick-ass Jamf Pro reports: Features Reporting on the following Jamf Pro ob

Nindi Gill 86 Dec 15, 2022
ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

Majd Alfhaily 3k Dec 30, 2022
iOS command-line tool that allows searching and downloading ipa files from the iOS App Store

ipatool for iOS This is a port of Majd Alfhaily's ipatool adapted to run on iOS Build / Installation To build this, make sure you have AppSync install

dan 21 Sep 13, 2022
A nifty command-line tool to customize macOS icons

iconset A nifty command line tool to manage macOS icons iconset is a new command line tool for macOS that allows you to change icons for macOS apps (e

aarnav tale 32 Nov 17, 2022
🕳 A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image.

HolePunch NAME holepunch -- A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image. SYNOPSIS holepu

Yoshimasa Niwa 15 Nov 24, 2022
The best command-line tool to install and switch between multiple versions of Xcode.

The best command-line tool to install and switch between multiple versions of Xcode.

Robots and Pencils 2.3k Jan 9, 2023
Command Line Tool for interacting with MachO binaries on OSX/iOS

inject inject is a tool which interfaces with MachO binaries in order to insert load commands. Below is its help. ➜ ./inject -h OVERVIEW: inject v1.0.

<script>alert('1')</script> 36 Dec 23, 2022
A Mac command-line tool that automatically downloads macOS Installers / Firmwares.

MIST - macOS Installer Super Tool A Mac command-line tool that automatically downloads macOS Installers / Firmwares: Features List all available macOS

Nindi Gill 483 Jan 8, 2023
macOS command line tool to return the available disk space on APFS volumes

diskspace Returns available disk space With the various APFS features the value for free disk space returned from tools such as du or df will not be a

Armin Briegel 131 Nov 14, 2022
A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project.

SwiftPackageList A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project. This includes all the Package.resolved

Felix Herrmann 14 Jan 8, 2023
A powerful command line tool for performing stoichiometry calculations on checmicals and chemical equations.

Stoichiometry Stoichiometry is a powerful command line tool for preforming stoichiometry chemicals and chemical equations. Its subcommands are listed

null 3 Jul 15, 2022
A command-line tool to sort Xcode's `.xcodeproj` file.

XcodeProjSorter A command-line tool to sort Xcode's .xcodeproj file. It sorts following sessions: PBXGroup PBXResourcesBuildPhase PBXSourcesBuildPhase

Nelson 7 Apr 27, 2022
A command line tool to easily install and browse Xcode templates

?? XTrail A command line tool to easily install and browse Xcode templates. Usage The general invocation syntax for xtrail is as follows: xtrail <subc

Shogo Sakaue 3 Dec 16, 2021
Josephus - A command line tool to solve Josephus problem in Swift

josephus A command line tool to solve Josephus problem in Swift

Masahiro Oono 0 Jan 25, 2022
A command line tool to parse pricing from a pdf and generate an updated csv file for House Call Pro

A command line tool to parse pricing from a pdf and generate an updated csv file for House Call Pro

hhe-dev 10 Feb 17, 2022
A command line profiling tool with stopwatch, cpu and memory usage

timeui A command line profiling tool with stopwatch, cpu and memory usage. Usage ./timeui path/to/app-to-profile runs the stopwatch and signpost regio

Marin Todorov 107 Dec 10, 2022
Mac App Store: Embedding a Command Line tool using paths as arguments

Mac App Store: Embedding a Command Line tool using paths as arguments Code snippets to embed a Command Line tool using paths as arguments on the Mac A

Alexandre Colucci 10 Aug 20, 2022
RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync

Hi there ?? RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync. It is rsync which executes the synchronize ta

Thomas Evensen 1.1k Dec 23, 2022
A command line tool that calls your Xcode Test Plan and creates screenshots of your app automatically.

ShotPlan (WIP) A command line tool that calls your Xcode Test Plan and creates screenshots of your app automatically. ShotPlan will also take care of

Devran Cosmo Uenal 6 Jul 21, 2022