Skip to main content

A simple CLI to run ASP Chef recipes

Project description

ASP Chef CLI

A simple CLI to run ASP Chef, in headed or headless mode.

Install

The suggested way is via pip:

$ pip install asp-chef-cli
$ playwright install

Docker is another option (headed mode needs extra parameters):

$ sudo docker run -i malvi/asp-chef-cli
$ sudo docker run -i --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" malvi/asp-chef-cli

Usage

Run with one of the following commands:

$ python -m asp_chef_cli --help
$ sudo docker run malvi/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.
  • server starts a server for @dumbo/* operations.

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_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-with --input "hello."
hello.
§
hello.
world.

Local Server for @dumbo/* Operations

The server for @dumbo/* operations can be executed with the command server. By default, it uses port 8000 (a different port can be specified using --port or -p; in this case, the port must be changed also in the options of ASP Chef).

For development, add the --reload flag so that the server is updated when the Python code of the CLI is changed.

The Docker version must specify port mapping, for example:

$ sudo docker run -p 8000:8000 malvi/asp-chef-cli server --host 0.0.0.0

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.4.17.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asp_chef_cli-0.4.17-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asp_chef_cli-0.4.17.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.5 Linux/6.12.13-amd64

File hashes

Hashes for asp_chef_cli-0.4.17.tar.gz
Algorithm Hash digest
SHA256 77661b81d9be7f3030d0ce863d44e4aaf1cc8502261dbb3b8cd16aaf6fe7ab36
MD5 4fb45e455d88d0e6b26cb1f3caa0e543
BLAKE2b-256 eadf1e00fbe9b9557d0051bb827a14d89bb13139d803cdffcfaa12233b167442

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asp_chef_cli-0.4.17-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.5 Linux/6.12.13-amd64

File hashes

Hashes for asp_chef_cli-0.4.17-py3-none-any.whl
Algorithm Hash digest
SHA256 e3fa8b59eb9eea64a3ceed39cf37187bcd0afb63f93b775a71c8bf15e79b9a06
MD5 b5a540cbb7172bba9123da9261ce8fcd
BLAKE2b-256 5e58f0677f4c66bc65ab81ef78b677b521ed9b1d2d9594053b6343f763e2a612

See more details on using hashes here.

Supported by

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