본문으로 건너뛰기

Plugin CLI Commands

The Synapse SDK provides CLI commands for plugin development and execution.

synapse plugin run​

Run a plugin action with various execution modes.

Usage​

synapse plugin run <action> [OPTIONS]

Arguments​

ArgumentDescription
actionAction to run (e.g., test, train, deploy, infer)

Options​

OptionShortDescription
--plugin-pPlugin code. Auto-detects from config.yaml if not provided
--pathPlugin directory (default: current)
--paramsJSON parameters to pass to the action
--mode-mExecutor mode: local, task, job, or remote
--ray-addressRay cluster address (for task/job modes)
--gpusNumber of GPUs to request
--cpusNumber of CPUs to request
--lang-lLanguage for i18n log messages (ISO 639-1, e.g., 'en', 'ko')
--debug/--no-debugDebug mode (default: enabled)
--debug-sdkBundle local SDK with upload (for SDK development)

Executor Modes​

ModeDescription
localIn-process execution (best for debugging)
taskRay Actor execution (no log streaming)
jobRay Jobs API with log streaming (recommended for remote)
remoteRun via Synapse backend API (requires auth)

Examples​

# Basic execution
synapse plugin run test
synapse plugin run test --mode local

# With GPU allocation
synapse plugin run test --mode task --gpus 1

# With parameters
synapse plugin run train --mode job --params '{"epochs": 10}'

# With language selection (i18n)
synapse plugin run train --lang=ko --params '{"epochs": 10}'
synapse plugin run train -l en # Short form

# Language with different execution modes
synapse plugin run train --mode local --lang=ko
synapse plugin run train --mode task --lang=ko
synapse plugin run train --mode job --lang=ko

# Remote execution
synapse plugin run deploy --mode remote

synapse plugin publish​

Publish a plugin release to Synapse.

Usage​

synapse plugin publish [OPTIONS]

Options​

OptionShortDescription
--path-pPlugin directory (default: current)
--config-cConfig file path
--hostSynapse API host
--token-tAccess token
--dry-runPreview without uploading
--debugDebug mode (bypasses backend validation)
--yes-ySkip confirmation

Examples​

synapse plugin publish
synapse plugin publish -p ./my-plugin --dry-run

synapse plugin create​

Create a new plugin from template.

Usage​

synapse plugin create [OPTIONS]

Options​

OptionShortDescription
--path-pOutput directory (default: current)
--name-nPlugin name
--codePlugin code (slug)
--category-cPlugin category
--yes-ySkip confirmation
--templateBackend action template <category>/<action>[@<version>] (default version: the active one)
--answersTemplate intake answers: a JSON object or @file.json
--template-bundleRender this bundle zip instead of downloading it (offline; needs @<version>)
--hostSynapse API host for --template (default: from synapse login)
--token-tAccess token for --template (default: from synapse login)

Without a TTY nothing is prompted: --name and --code are required, and an existing directory is only replaced with --yes.

From a backend action template​

With --template the plugin gets the one action of a backend action template (/v2/plugin-action-templates/). The SDK downloads the template bundle (checked against its sha256), checks --answers against the template's intake (question kinds, options and when conditions) and renders the bundle with the same code as the SDK category templates:

  • the SDK base templates (config.yaml, README.md, pyproject.toml, plugin/__init__.py, ...),
  • the bundle's config.yaml.j2 merged over the base config.yaml (top-level keys replace the base ones),
  • the bundle's requirements.txt.j2 instead of the base one,
  • the bundle's plugin/*.j2 files.

Template variables are those of the category templates (name, code, version, category, data_type, ...) plus each answer under its question id and all answers as answers. An answer id that collides with one of those variables is rejected. The action records the template in config.yaml:

actions:
train:
entrypoint: plugin.train.TrainAction
method: job
template:
id: neural_net/train
version: 3
answers: {model_source: upload}

With --template-bundle the answers are not checked (the intake lives on the backend).

Examples​

synapse plugin create
synapse plugin create --name "My Plugin" --category neural_net
synapse plugin create --name "My Plugin" --code my-plugin --template neural_net/train \
--answers '{"model_source": "upload"}'
synapse plugin create --name "My Plugin" --code my-plugin --template neural_net/train@3 --answers @answers.json

synapse plugin add-action​

Add the action of a backend action template to an existing plugin.

Usage​

synapse plugin add-action --template <category>/<action>[@<version>] [OPTIONS]

Options​

OptionShortDescription
--templateBackend action template <category>/<action>[@<version>]
--answersTemplate intake answers: a JSON object or @file.json
--path-pPlugin directory (default: current)
--forceReplace the action and overwrite existing action files
--template-bundleRender this bundle zip instead of downloading it (offline; needs @<version>)
--hostSynapse API host (default: from synapse login)
--token-tAccess token (default: from synapse login)

The template must be for the plugin's category. The command renders the bundle's plugin/*.j2 files into plugin/, adds the action from the bundle's config.yaml.j2 (with its template record) to config.yaml — appended to the actions block so the rest of the file, comments included, stays as written — and appends the bundle's requirements that requirements.txt lacks. Other top-level keys of the bundle config are not applied. Nothing is written when the action already exists in config.yaml or one of its files exists, unless --force is given.

Examples​

synapse plugin add-action --template neural_net/inference --answers @answers.json
synapse plugin add-action --template neural_net/train@4 --answers '{"model_source": "upload"}' --force

synapse plugin check​

Check plugin actions against the harness and guardrail of the backend action template they follow (actions.<name>.template in config.yaml). Actions without template are not checked.

The template version's intake, harness and guardrail are read from the backend registry (/v2/plugin-action-templates/) with the synapse login credentials. If the backend is not configured, not reachable, or does not have that version, the SDK defaults for the (category, action) are used — the action module and requirements.txt must exist and the entrypoint must inherit the SDK base class; the guardrail is empty. The output says when this happens.

Usage​

synapse plugin check [OPTIONS]

Options​

OptionShortDescription
--path-pPlugin directory (default: current)
--action-aCheck only this action
--smokeAlso run each action with the harness smoke params (runs plugin code locally, like plugin run --mode local)
--jsonPrint one JSON document instead of text
--hostSynapse API host (default: from synapse login)
--token-tAccess token (default: from synapse login)

Checks​

CheckSeverityCodes
harness.required_files existwarningharness.required_file_missing
entrypoint class inherits harness.entrypoint_base (AST, through the plugin's modules)warningharness.entrypoint_base_mismatch, harness.entrypoint_base_unresolved, harness.entrypoint_not_found, harness.entrypoint_not_class, harness.entrypoint_missing
no import of guardrail.forbidden_imports (AST)errorguardrail.forbidden_import; guardrail.dynamic_import (warning)
package indexes / direct URL / VCS requirements in requirements.txt and package_manager_options are allowederrorguardrail.disallowed_index, guardrail.disallowed_source, guardrail.disallowed_trusted_host
container.resources and the action's serve_options.ray_actor_options within guardrail.resourceserrorguardrail.resource_exceeded
recorded answers match the intakewarningtemplate.answers_invalid
--smoke: the action runs within smoke.timeout_seconds; params/result match params_schema/result_schemawarningharness.smoke_failed, harness.smoke_timeout, harness.smoke_params_invalid, harness.params_schema_mismatch, harness.result_schema_mismatch

A package index is allowed when it is the internal index (PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, UV_INDEX_URL, UV_EXTRA_INDEX_URL of the environment) or a package_index of a guardrail.allow entry that the recorded answers enable (an intake option's guardrail key). Direct URL and VCS requirements need their host in an enabled entry's hosts.

The import check only sees what is statically visible: __import__() / importlib.import_module() with a non-literal argument is reported as a warning, and exec/eval or imports inside installed packages are not detected.

The command exits with 1 when there is an error (guardrail violation). Warnings (harness not met) do not change the exit code. The backend runs the same static check at publish time: errors reject the release, warnings are stored with it.

JSON output​

{
"schema_version": 1,
"ok": false,
"plugin_dir": "/workspace/my-plugin",
"notes": [],
"actions": [
{"action": "train", "template": {"id": "neural_net/train", "version": 3},
"source": "backend", "skipped": null, "smoke": null}
],
"findings": [
{"code": "guardrail.forbidden_import", "severity": "error",
"message": "Import of subprocess is forbidden by the template guardrail (subprocess)",
"file": "plugin/train.py", "line": 3, "column": 1, "action": "train"}
]
}

source is backend or sdk-default; smoke is null (not requested), not_configured, passed or failed. file is relative to the plugin directory; line/column are 1-based.

Examples​

synapse plugin check
synapse plugin check --smoke
synapse plugin check --json --action train

synapse plugin update-config​

Auto-discover actions and sync to config.yaml.

Usage​

synapse plugin update-config [OPTIONS]

Options​

OptionShortDescription
--path-pPlugin directory (default: current)
--config-cConfig file path

Examples​

synapse plugin update-config
synapse plugin update-config -p ./my-plugin

synapse plugin job get​

Get job details.

Usage​

synapse plugin job get <job_id> [OPTIONS]

Options​

OptionShortDescription
--hostSynapse API host
--token-tAccess token

Examples​

synapse plugin job get 123

synapse plugin job logs​

Get job logs.

Usage​

synapse plugin job logs <job_id> [OPTIONS]

Options​

OptionShortDescription
--follow-fFollow log output (stream)
--hostSynapse API host
--token-tAccess token

Examples​

synapse plugin job logs 123
synapse plugin job logs 123 -f