Get startedInstallWrite a pluginPlugin reference

Plugin reference

Every field of nojace.json (or plugin.json). For how to use them, with examples, see Write a plugin.

Start the file with the schema line, and your editor completes and checks fields as you type:

{
  "$schema": "https://nojace.com/nojace.schema.json",
  "format": 1,
  "name": "My team"
}

The file

FieldTypeWhat it does
formatintegerThe plugin format this file is written for. Currently 1.
namerequiredstringShown on the plugin's tab.
descriptionstringOne line on what it adds, shown when browsing plugins.
iconstringAn emoji shown when browsing plugins.
requireslist of stringCLIs it needs, e.g. ["gh"]: shown when browsing plugins. "docker|podman" means either.
platformslist of "macos" | "linux"The systems it runs on. Left out, all of them; elsewhere it isn't offered, and isn't run if added.
settingslist of SettingChoices you make once for the whole plugin (an account, a role, a region), shown under ⚙ on its chip and kept in ~/.nojace/plugins.json. Commands use them as {{setting.<id>}}.
pageslist of object { id, label, file, icon, description }Web pages it ships (a game, a dashboard), opened inside the Toolbox in a sandbox: scripts run, but the page can't reach the app, files or commands.
actionslist of Action (a button)Buttons, in groups and rows.
serviceslist of ServiceThings that keep running: start, stop, log.
listslist of ListTables from a command, with toggles and row buttons.
envslist of stringEnvironments for the apps table and inputs with options "envs".
methodsmap of name → MethodHow apps are deployed: actions and a status command, shared by apps.
appslist of AppApps × envs table.
linkslist of Link

Action (a button)

FieldTypeWhat it does
idrequiredstringStable: saved buttons and needs refer to it.
labelrequiredstring
runrequiredstringThe command, run in a terminal in the plugin's folder.
titlestringWhat the run is called in the log and history, e.g. "exec {{item}} {{service}}".
groupstringCard heading.
rowstringLabelled row in the card.
inputslist of Input (something to choose)
eachlist of Option or From a commandOne button per item.
checkCheck (a badge)
needsNeedsChecks that must pass first: "<action id>" or "<action id>:{{item}}".
toneTonedanger: red, and running it means typing its name. For production.
keepLogbooleanfalse: output isn't kept after it ends. For logins and shells.
cwd"plugin" | "app"
confirmstring
confirmWhenWheninput id → value(s) it must have
confirmTypeboolean

Input (something to choose)

FieldTypeWhat it does
idrequiredstringFills {{id}}.
labelstring
optionslist of Option or "envs" or From a command
defaultstring or list of string or object { run }
multibooleanA list of values, filled as separate words.
multilinebooleanA text box for longer text (a note, a message); ⌘Enter runs.
emptyLabelstringWhat an empty multi means, e.g. "all services".

Option

Either string, or an object:

FieldTypeWhat it does
valuerequiredstringFills {{item}} / the input.
labelstringShown instead of value.
hintstring
linkstring
toneTonedanger: red, and running it means typing its name. For production.
varsmap of name → stringMore {{placeholders}} when this item is used.

From a command

FieldTypeWhat it does
runrequiredstringPrints the JSON list.

Check (a badge)

FieldTypeWhat it does
runrequiredstringPrints {"ok", "text"}, or a map of them.
keystringPicks from the map; may use {{item}}.
everynumberSeconds between checks (default 120).

Needs

Checks that must pass first: "<action id>" or "<action id>:{{item}}".

Type: list of string

Tone

danger: red, and running it means typing its name. For production.

Type: "danger"

When

input id → value(s) it must have

Type: map of name → string or list of string

Service

FieldTypeWhat it does
idrequiredstring
labelstring
runrequiredstringKeeps running until stopped (Ctrl+C, then killed after 4 s).
inputslist of Input (something to choose)
autostartboolean
portslist of integer
confirmstring
confirmWhenWheninput id → value(s) it must have
needsNeedsChecks that must pass first: "<action id>" or "<action id>:{{item}}".

List

FieldTypeWhat it does
idrequiredstring
labelrequiredstring
runrequiredstringPrints {"columns": [...], "rows": [{value, label, hint, on, vars, tone}]}.
onstringTurn a row on for a column: {{item}}, {{column}}.
offstring
actionslist of List row action
groupstringShow the rows inside this action group's card.
openboolean
everynumberReload every this many seconds while the Toolbox is showing (e.g. 60 for today's meetings).
display"table" | "cards"cards: small cards with a filter, status / tag chips and grouping. Rows may add status, group, tags; the output may add groups [{value, label, hint, link}] and view {groupBy, folded}.

List row action

FieldTypeWhat it does
idrequiredstring
labelrequiredstring
runrequiredstring{{item}} is the row; its vars fill the rest.
titlestring
toneTonedanger: red, and running it means typing its name. For production.
keepLogboolean
needsNeedsChecks that must pass first: "<action id>" or "<action id>:{{item}}".
inputslist of Input (something to choose)Asked for when the row's button is pressed, e.g. a text box started from the row's current text.

Setting

FieldTypeWhat it does
idrequiredstringFills {{setting.<id>}} in any command.
labelrequiredstring
hintstringOne line under it, e.g. what it changes.
type"choice" | "text" | "toggle"choice (with options), text, or toggle (fills "true" / "false"). Default: choice when it has options, else text.
optionslist of Option or From a command
defaultstring

Method

FieldTypeWhat it does
actionslist of Action (a button)
statusobject { run, every }

App

FieldTypeWhat it does
idrequiredstring
namestring
methodstring
folderstring
varsmap of name → string
actionslist of Action (a button)
FieldTypeWhat it does
labelrequiredstring
urlrequiredstring