Command Line Interface

This package provides a command line interface for performing all major functions required for setting up and managing a food computer instance.

Cloud

The subcommand openag cloud provides tools for selecting a cloud server to use, managing your user account on that server, and managing a farm instance on the server which serves as a mirror for your local instance.

Usage: openag cloud init [OPTIONS] CLOUD_URL

  Choose a cloud server to use. Sets CLOUD_URL as the cloud server to use
  and sets up replication of global databases from that cloud server if a
  local database is already initialized (via `openag db init`).

Options:
  --help  Show this message and exit.
Usage: openag cloud show [OPTIONS]

  Shows the URL of the current cloud server or throws an error if no cloud
  server is selected

Options:
  --help  Show this message and exit.
Usage: openag cloud deinit [OPTIONS]

  Detach from the current cloud server

Options:
  --help  Show this message and exit.
Usage: openag cloud register [OPTIONS]

  Create a new user account. Creates a user account with the given
  credentials on the selected cloud server.

Options:
  --username TEXT  Username for the account
  --password TEXT  Password for the account
  --help           Show this message and exit.
Usage: openag cloud login [OPTIONS]

  Log into your user account

Options:
  --username TEXT  Username for the account
  --password TEXT  Password for the account
  --help           Show this message and exit.
Usage: openag cloud show [OPTIONS]

  Shows the URL of the current cloud server or throws an error if no cloud
  server is selected

Options:
  --help  Show this message and exit.
Usage: openag cloud logout [OPTIONS]

  Log out of your user account

Options:
  --help  Show this message and exit.
Usage: openag cloud create_farm [OPTIONS] FARM_NAME

  Create a farm. Creates a farm named FARM_NAME on the currently selected
  cloud server. You can use the `openag cloud select_farm` command to start
  mirroring data into it.

Options:
  --help  Show this message and exit.
Usage: openag cloud list_farms [OPTIONS]

  List all farms you can manage. If you have selected a farm already, the
  name of that farm will be prefixed with an asterisk in the returned list.

Options:
  --help  Show this message and exit.
Usage: openag cloud init_farm [OPTIONS] FARM_NAME

  Select a farm to use. This command sets up the replication between your
  local database and the selected cloud server if you have already
  initialized your local database with the `openag db init` command.

Options:
  --help  Show this message and exit.
Usage: openag cloud deinit_farm [OPTIONS]

  Detach from the current farm. Cancels the replication between your local
  server and the cloud instance if it is set up.

Options:
  --help  Show this message and exit.

DB

The subcommand openag db provides tools for managing your local CouchDB instance.

Usage: openag db init [OPTIONS]

  Initialize the database server. Sets some configuration parameters on the
  server, creates the necessary databases for this project, pushes design
  documents into those databases, and sets up replication with the cloud
  server if one has already been selected.

Options:
  --db_url TEXT
  --api_url TEXT
  --help          Show this message and exit.
Usage: openag db show [OPTIONS]

  Shows the URL of the current local server. Throws an error if no local
  server is selected

Options:
  --help  Show this message and exit.
Usage: openag db load_fixture [OPTIONS] FIXTURE_FILE

  Populate the database from a JSON file. Reads the JSON file FIXTURE_FILE
  and uses it to populate the database. Fuxture files should consist of a
  dictionary mapping database names to arrays of objects to store in those
  databases.

Options:
  --help  Show this message and exit.
Usage: openag db deinit [OPTIONS]

  Detach from the local server.

Options:
  --help  Show this message and exit.
Usage: openag db clear [OPTIONS]

  Clear all data on the local server. Useful for debugging purposed.

Options:
  --help  Show this message and exit.

Firmware

The subcommand openag firmware provides tools for generating and compiling code to run on the microcontroller of the system.

Usage: openag firmware init [OPTIONS]

  Initialize an OpenAg-based project

Options:
  -b, --board TEXT        The board to use for compilation. Defaults to
                          megaatmega2560 (Arduino Mega 2560)
  -d, --project-dir TEXT  The directory in which the project should reside
  --help                  Show this message and exit.
Usage: openag firmware run [OPTIONS]

  Generate code for this project and run it

Options:
  -d, --project-dir TEXT          The directory in which the project should
                                  reside
  --status_update_interval INTEGER
                                  Minimum interval between driver status
                                  updates (in seconds)
  -t, --target TEXT               PlatformIO target (e.g.  upload)
  -p, --plugin TEXT               Enable a specific plugin
  -f, --modules_file FILENAME     JSON file describing the modules to include
                                  in the generated code
  -c, --categories [sensors|actuators|calibration]
                                  A list of the categories of inputs and
                                  outputs that should be enabled
  --help                          Show this message and exit.
Usage: openag firmware run_module [OPTIONS] [ARGUMENTS]...

  Run a single instance of this module. [ARGUMENTS] specifies a list of
  implementation-specific arguments to the module (for example, configuring
  Arduino pin numbers for the module).

  Example:

  openag firmware run_module -t upload 4

  This command fetches module definitions from CouchDB. CouchDB must be
  running on port 5984 and the firmware_module_type database populated with
  appropriate type records for this command to work. Loading the default
  fixture from openag_brain will populate a default set of
  firmware_module_type records.

Options:
  -b, --board TEXT                The board to use for compilation. Defaults
                                  to megaatmega2560 (Arduino Mega 2560)
  -d, --project-dir TEXT          The directory in which the project should
                                  reside
  --status_update_interval INTEGER
                                  Minimum interval between driver status
                                  updates (in seconds)
  -t, --target TEXT               PlatformIO target (e.g.  upload)
  -p, --plugin TEXT               Enable a specific plugin
  -f, --modules_file FILENAME     JSON file describing the modules to include
                                  in the generated code
  -c, --categories [sensors|actuators|calibration]
                                  A list of the categories of inputs and
                                  outputs that should be enabled
  --help                          Show this message and exit.