Skip to content

Your First Task File

Task files are plain-text files with a .oce extension. They describe what to run and with what parameters. This page walks through creating and running your first one.

Create the file

Create a new file called my-first-task.oce anywhere on your computer — your Desktop is fine to start. Open it in any text editor and paste the following:

[["toy-calculator::calculate"]]
operation = "add"
operands = [1, 2, 3]
output_dir = "./outputs/add"

Save it.

What this means

The file defines one task:

  • [["toy-calculator::calculate"]] — run the calculate command provided by the toy-calculator plugin. toy-calculator is the alias — the short name that maps to the installed plugin. See Aliases for how this works.
  • operation = "add" — add the operands together
  • operands = [1, 2, 3] — the numbers to add: 1 + 2 + 3
  • output_dir = "./outputs/add" — where to write the result file, relative to the task file

Run it

  1. In Open Choice, open the Recent Files panel
  2. Click Add file and select my-first-task.oce
  3. The file appears in the list — click it to open it in the editor
  4. Click the Run button (▶) in the editor toolbar, or press Ctrl+Enter

The run panel opens and you will see:

  • A started event
  • Progress events as the calculation steps through each operand
  • An artifact_created event when result.json is written
  • A finished event with success: true

Check the output

Open the folder containing your task file. A new outputs/add/ directory has been created containing:

  • result.json — the machine-readable result: {"result": 6, "steps": [...]}
  • run.log — a human-readable execution log

Using snippets

Instead of typing task file content from scratch, you can use the snippet library. Open the Snippets panel, find the Toy Calculator snippets, and click one to insert it into the editor. Snippets are contributed by plugins at install time.

You can also open the Help Explorer panel, find the Toy Calculator → Calculate endpoint, and click Insert template to append the template directly into the active editor, or Copy template to copy it to the clipboard.

Next steps