Skip to main content

A simple CLI to run ASP Chef recipes

Project description

ASP Chef Headless

A simple CLI to run ASP Chef in headless mode.

Install

The suggested way is via pip:

$ pip install asp-chef-cli
$ playwright install

Docker is another option (for headless mode):

$ docker run malvi/asp-chef-headless

Usage

Run with one of the following commands:

$ docker run malvi/asp-chef-headless --help
$ python -m asp_chef_cli --help

Add the recipe (an ASP Chef sharable URL) with the option --url (quote the URL as it contains characters like # that breaks bash and other terminals). The headless mode can be activated with the flag --headless (always active in the docker image). Possibly change the default browser used by playwright with the option --browser. Finally, give a command to execute:

  • run simply runs the recipe as it is;
  • run-with runs the recipe with the input replaced by the one specified either with the option --input or via the prompt.

The flag --help can be specified after a command to get a list of arguments for that command.

Examples

Let us consider this simple recipe with no input and guessing the atom world. The recipe can be run headless by giving the following command:

$ python -m asp_chef_cli --headless --browser=chromium --url="https://asp-chef.alviano.net/#eJxtkNuOgjAQhl+plNUsl4srUKIQEXu6s+Ch2CIJIpan33bdRC/2ajKnf/75DibtRBt69QLNiUGSbkfJyawRsFAUqqFKMEBNpxl5TNz1YvzXC7w6ee5xHfUV3PWoTRWDauRbq+X3ck82MpfpJf/ePXhZGS6Bn+mltyo3MGvYLS8Z5AsAGVzOuN5AppGtr+Vqkd6rGBtGi07AD6dRchIZBk+nkgQXbr0gOUrhh2BPgqEyaH4w6VTHwfjuldFwFMlF5m1hauL8ZVfhV69cn9We1Ff3w7r5Gu1dW38op4famy/8tOcJGH5vtfjGNDaouRo3x4iaOF2/aT1ZURhNFGZ30Wag0pFlW0z/8vNDw0nRMRgBxwup4Mh0NPGSAep9OgaW5flOIR4YdD8XRxuHOsbDizkOjtgLfgC4qpvc%21" run
EMPTY MODEL
§
world.

It is possible to specify a different input as follows:

$ python -m asp_chef_headless --headless --browser=chromium --url="https://asp-chef.alviano.net/#eJxtkNuOgjAQhl+plNUsl4srUKIQEXu6s+Ch2CIJIpan33bdRC/2ajKnf/75DibtRBt69QLNiUGSbkfJyawRsFAUqqFKMEBNpxl5TNz1YvzXC7w6ee5xHfUV3PWoTRWDauRbq+X3ck82MpfpJf/ePXhZGS6Bn+mltyo3MGvYLS8Z5AsAGVzOuN5AppGtr+Vqkd6rGBtGi07AD6dRchIZBk+nkgQXbr0gOUrhh2BPgqEyaH4w6VTHwfjuldFwFMlF5m1hauL8ZVfhV69cn9We1Ff3w7r5Gu1dW38op4famy/8tOcJGH5vtfjGNDaouRo3x4iaOF2/aT1ZURhNFGZ30Wag0pFlW0z/8vNDw0nRMRgBxwup4Mh0NPGSAep9OgaW5flOIR4YdD8XRxuHOsbDizkOjtgLfgC4qpvc%21" run-with --input "hello."
hello.
§
hello.
world.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asp_chef_cli-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

asp_chef_cli-0.1.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file asp_chef_cli-0.1.2.tar.gz.

File metadata

  • Download URL: asp_chef_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/6.1.0-9-amd64

File hashes

Hashes for asp_chef_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b54433f75ccf00c3201a0d7160f5cf6c707634ce64b9dd28e50792f0f79c4c24
MD5 94fc713a5bf850bcdd788c37e5508c73
BLAKE2b-256 ceeb43f6fb21a358048d44f3045c386cc7bc2f4b01b13ca0fd68f39370bec930

See more details on using hashes here.

File details

Details for the file asp_chef_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: asp_chef_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/6.1.0-9-amd64

File hashes

Hashes for asp_chef_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f22596867f17bef7acb245822549cc829110138040722cfb3fb72622adc76ee
MD5 81ad0d816ee1c7d553a3f1f55807af29
BLAKE2b-256 9e0c20ad75a2877d3693eab3b95086a82537234287cb51b7cad7343246092dc2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page