Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

CLI Reference

Complete reference for the MADSci command-line interface.

Global Options

madsci [OPTIONS] COMMAND [ARGS]...
OptionEnvironment VariableDescription
--lab-url URLLAB_SERVER_URLLab manager URL (default: http://localhost:8000/)
-v, --verboseIncrease verbosity (repeatable: -vv, -vvv)
-q, --quietSuppress non-essential output
--no-colorNO_COLORDisable colored output
--jsonOutput in JSON format (where applicable)
--yamlOutput in YAML format (where applicable)
--versionShow version and exit

Setup Commands

madsci init

Initialize a new MADSci lab interactively. Creates directory structure, configuration files, and optionally sets up Docker Compose.

madsci init my_lab
madsci init .                    # Initialize in current directory

madsci new

Create new MADSci components from templates. This is a command group with subcommands for each component type.

madsci new list                             # List all 33 templates
madsci new list --category module           # Filter by category
madsci new module                           # Interactive module creation
madsci new module --name my_pipette --template module/device
madsci new interface --type fake            # Add fake interface to module
madsci new experiment --modality script     # Create experiment
madsci new workflow                         # Create workflow
madsci new lab --template standard          # Create full lab
madsci new node --name my_device            # Create standalone node

Alias: n

Subcommands

SubcommandDescription
listList available templates (filterable by --category, --tag)
moduleCreate a node module (--template: basic, device, instrument, liquid_handler, camera, robot_arm)
interfaceAdd interface to existing module (--type: fake, sim, mock)
nodeCreate standalone REST node server
experimentCreate experiment (--modality: script, notebook, tui, node)
workflowCreate workflow (--template: basic, multi_step)
labCreate lab configuration (--template: minimal, standard, distributed)

All subcommands support --name, --no-interactive, and template-specific options.

madsci add

Add components to an existing MADSci module project. Each subcommand adds a specific component using templates.

madsci add docs --name my_module             # Add documentation scaffolding
madsci add drivers --name my_module          # Add driver stubs
madsci add notebooks --name my_module        # Add Jupyter notebook templates
madsci add gitignore                         # Add a .gitignore file
madsci add compose --name my_module          # Add Docker Compose configuration
madsci add dev-tools                         # Add development tool configs
madsci add agent-config                      # Add AI agent configuration files
madsci add all --name my_module              # Add all optional components
madsci add docs -d ./my_module --on-conflict overwrite

Group-Level Options

OptionDescription
--name, -nName of the module project
--descriptionDescription of the module project
--dir, -dTarget directory (default: .)
--on-conflictConflict resolution strategy: skip, overwrite, or backup (default: skip)
--no-interactiveDisable interactive prompts

Subcommands

SubcommandDescription
docsAdd documentation scaffolding to the project
driversAdd driver stubs to the project
notebooksAdd Jupyter notebook templates to the project
gitignoreAdd a .gitignore file to the project
composeAdd Docker Compose configuration to the project
dev-toolsAdd development tool configurations to the project
agent-configAdd AI agent configuration files to the project
allAdd all optional components to the project

Operations Commands

madsci start

Start MADSci lab services.

madsci start                    # Start all services (Docker, foreground)
madsci start -d                 # Start in background
madsci start --build            # Rebuild images first
madsci start --mode local       # Start without Docker (pure Python)
madsci start --services workcell_manager --services lab_manager
madsci start --config path/to/compose.yaml
madsci start -d --no-wait       # Skip health polling after starting
madsci start -d --wait-timeout 120  # Custom health poll timeout
OptionDescription
-d, --detachRun services in the background
--buildBuild images before starting
--servicesStart only specific services (repeatable)
--config PATHPath to Docker Compose file
--mode [docker|local]Run mode (default: docker)
--wait/--no-waitWait for services to become healthy (default: wait when -d)
--wait-timeout INTTimeout for health polling in seconds (default: 60)
--settings-dir PATHSettings directory for walk-up config file discovery (sets MADSCI_SETTINGS_DIR for child processes)

Subcommands

SubcommandDescription
start manager <name>Start a single manager (lab, event, experiment, resource, data, workcell, location)
start node <path>Start a node module from a Python file
madsci start manager event       # Start event manager (foreground)
madsci start manager event -d    # Start in background
madsci start node ./my_node.py   # Start node (foreground)
madsci start node ./my_node.py -d --name lh  # Background with custom name
madsci start --settings-dir /opt/lab manager event  # With settings directory
madsci start node ./node.py --settings-dir ./nodes/arm  # Node with settings dir

madsci stop

Stop MADSci lab services via Docker Compose. Also supports stopping individual background managers and nodes.

madsci stop                     # Stop all services
madsci stop --remove            # Stop and remove images
madsci stop --volumes           # Stop and remove volumes (data loss!)
madsci stop manager event       # Stop a background manager
madsci stop node my_node        # Stop a background node
OptionDescription
--removeRemove locally-built images after stopping
--volumesRemove named volumes (requires confirmation)
--config PATHPath to Docker Compose file

Subcommands

SubcommandDescription
stop manager <name>Stop a background manager process
stop node <name>Stop a background node process

madsci status

Show status of MADSci services.

madsci status                   # Show all services
madsci status lab_manager       # Show specific service
madsci status --watch           # Continuously update (every 5s)
madsci status --watch --interval 2
madsci status --json            # Output as JSON

Alias: s

OptionDescription
--watch, -wContinuously update status
--interval FLOATWatch interval in seconds (default: 5)
--jsonOutput as JSON
--timeout FLOATRequest timeout in seconds (default: 5)

madsci doctor

Run diagnostic checks on the MADSci environment.

madsci doctor                   # Run all checks
madsci doctor --check python    # Check Python environment
madsci doctor --check docker    # Check Docker availability
madsci doctor --check ports     # Check port availability

Alias: doc


Development Commands

madsci run

Run workflows or experiments.

Deprecation notice: madsci run workflow is deprecated in favor of madsci workflow submit. madsci run experiment is deprecated in favor of madsci experiment run.

madsci run workflow path/to/workflow.yaml
madsci run experiment path/to/experiment.py

madsci validate

Validate MADSci configuration and definition files.

madsci validate path/to/config.yaml
madsci validate path/to/workcell.yaml

Alias: val

madsci config

Manage MADSci configuration files. Exports use prefixed keys by default (e.g., event_server_url) for compatibility with the shared settings.yaml format.

madsci config export event                # Export Event Manager settings (prefixed keys)
madsci config export --all                # Export all manager settings
madsci config export event --format json  # Export as JSON
madsci config export event --settings-dir /opt/lab  # Export from specific lab dir
madsci config create manager event        # Create Event Manager settings file
madsci config create manager event -o my-event.yaml  # Custom output path

Alias: cfg


Data Commands

madsci logs

View and filter event logs.

madsci logs                     # View recent logs
madsci logs --tail 50           # Last 50 entries
madsci logs --follow            # Follow in real time
madsci logs --level ERROR       # Filter by level
madsci logs --level WARNING
madsci logs --grep "workflow"   # Filter by pattern
madsci logs --since 1h          # Logs from last hour
madsci logs --since 30m

Alias: l

OptionDescription
--tail NNumber of recent entries to show
--follow, -fFollow logs in real time
--level LEVELFilter by log level (DEBUG, INFO, WARNING, ERROR)
--grep PATTERNFilter by text pattern
--since DURATIONShow logs since duration (e.g., 1h, 30m, 2d)

madsci backup

Create database backups.

madsci backup create --db-url postgresql://localhost/resources
madsci backup create --db-url mongodb://localhost:27017/events
madsci backup list
madsci backup restore <backup_path>

Manager Interaction Commands

madsci workflow

Manage and monitor workflows.

madsci workflow list                    # List active workflows
madsci workflow show <id>               # Show workflow details
madsci workflow submit ./wf.yaml        # Submit a workflow
madsci workflow pause <id>              # Pause a running workflow
madsci workflow resume <id>             # Resume a paused workflow
madsci workflow cancel <id>             # Cancel a workflow
madsci workflow retry <id>              # Retry a failed workflow
madsci workflow resubmit <id>           # Resubmit a workflow

Alias: wf

Subcommands

SubcommandDescription
listList workflows (filterable by --active, --archived, --queued, --all, --limit)
showShow workflow details (--steps to include steps, --follow to watch progress)
submitSubmit a workflow (--parameters, --no-wait, --name)
pausePause a running workflow
resumeResume a paused workflow
cancelCancel a workflow
retryRetry a failed workflow
resubmitResubmit a workflow

madsci resource

Manage laboratory resources and inventory.

madsci resource list                     # List resources
madsci resource get <id>                 # Show resource details
madsci resource create --template <t>    # Create from template
madsci resource delete <id>              # Soft-delete a resource
madsci resource restore <id>            # Restore deleted resource
madsci resource tree <id>               # Show resource hierarchy
madsci resource lock <id>                # Acquire a lock
madsci resource unlock <id>              # Release a lock
madsci resource quantity set <id> <val>  # Set quantity
madsci resource quantity adjust <id> <d> # Adjust quantity
madsci resource template list            # List templates
madsci resource history <id>             # Show change history

Alias: res

Subcommands

SubcommandDescription
listList resources (filterable by --type, --limit)
getShow resource details
createCreate a resource (--template, --name, --params)
deleteSoft-delete a resource
restoreRestore a deleted resource
treeShow resource hierarchy (ancestors and descendants)
lockAcquire a lock on a resource
unlockRelease a lock on a resource
quantity setSet resource quantity to a specific value
quantity adjustAdjust resource quantity by a delta
template listList available resource templates
template getGet a specific resource template
historyShow change history for a resource

madsci location

Manage laboratory locations, resource attachments, and node-specific references.

madsci location list                         # List locations
madsci location get <name>                   # Show location details
madsci location create --name <name>         # Create a location
madsci location create-from-template <t>     # Create from template
madsci location delete <name>                # Delete a location
madsci location resources <name>             # Show attached resources
madsci location attach <name> <resource_id>  # Attach resource
madsci location detach <name>                # Detach resource
madsci location set-repr <loc> <node>        # Set representation
madsci location remove-repr <loc> <node>     # Remove representation
madsci location transfer-graph               # Show transfer graph
madsci location plan-transfer <src> <tgt>    # Plan a transfer
madsci location export                       # Export locations
madsci location import <file>                # Import locations
madsci location template list                # List location templates
madsci location rep-template list            # List repr templates

Alias: loc

Subcommands

SubcommandDescription
listList all locations
getShow location details
createCreate a location (--name, --description, --allow-transfers)
create-from-templateCreate from template (--template, --name, --bindings, --repr-overrides)
deleteDelete a location
resourcesShow resources attached to a location
attachAttach a resource to a location
detachDetach a resource from a location
set-reprSet a node-specific representation for a location
remove-reprRemove a node-specific representation
transfer-graphShow the location transfer adjacency graph
plan-transferPlan a transfer between two locations
exportExport all locations to a file
importImport locations from a file
template listList available location templates
rep-template listList available representation templates

madsci node

Manage and interact with laboratory instrument nodes.

madsci node list                         # List all nodes
madsci node info <name>                  # Show node details
madsci node status <name>               # Show node status
madsci node state <name>                 # Show node state
madsci node log <name>                   # Show node events
madsci node admin <name> <command>       # Send admin command
madsci node action <name> <action>       # Execute an action
madsci node action-result <name> <id>    # Get action result
madsci node action-history <name>        # Show action history
madsci node config <name>                # Show node config
madsci node set-config <name> --data {}  # Update node config
madsci node add <name> <url>             # Add node to workcell
madsci node shell <name>                 # Interactive REPL

Alias: nd

Subcommands

SubcommandDescription
listList all registered nodes
infoShow detailed node information
statusShow node status
stateShow node state
logShow node event log (--tail to limit entries)
adminSend admin command (safety_stop, reset, pause, resume, cancel, shutdown, lock, unlock)
actionExecute a node action
action-resultGet the result of a previous action
action-historyShow action history for a node
configShow node configuration
set-configUpdate node configuration (--data)
addAdd a node to the workcell
shellLaunch an interactive REPL for a node

madsci experiment

Manage experiments and experimental campaigns.

madsci experiment list                   # List recent experiments
madsci experiment get <id>               # Show experiment details
madsci experiment start --name "run 1"   # Start a new experiment
madsci experiment run ./my_exp.py        # Execute experiment script
madsci experiment pause <id>             # Pause an experiment
madsci experiment continue <id>          # Continue a paused experiment
madsci experiment cancel <id>            # Cancel an experiment
madsci experiment end <id>               # End an experiment

Alias: exp

Subcommands

SubcommandDescription
listList experiments (filterable by --count, --status)
getShow experiment details
startStart a new experiment (--design, --name, --desc, --run-name)
runExecute an experiment script
pausePause a running experiment
continueContinue a paused experiment
cancelCancel an experiment
endEnd an experiment (--status)

madsci campaign

Manage experimental campaigns.

madsci campaign create --name "My Campaign"
madsci campaign get <campaign_id>

Alias: camp

Subcommands

SubcommandDescription
createCreate a new campaign (--name, --desc)
getShow campaign details

madsci data

Manage datapoints and data capture.

madsci data list                         # List recent datapoints
madsci data get <id>                     # Get datapoint value
madsci data metadata <id>               # Show datapoint metadata
madsci data submit --file ./results.csv  # Submit a file datapoint
madsci data submit --value '{"a": 1}'    # Submit a JSON value
madsci data query --selector '{"label": "test"}'

Alias: dt

Subcommands

SubcommandDescription
listList recent datapoints (--count)
getGet datapoint value (--save-to to save to file)
metadataShow datapoint metadata
submitSubmit a datapoint (--file or --value, mutually exclusive; --label)
queryQuery datapoints (--selector, --limit)

madsci events

Query and manage event logs.

madsci events query                     # Query recent events
madsci events get <id>                  # Show event details
madsci events archive --ids <id1,id2>   # Archive specific events
madsci events purge --older-than-days 30
madsci events backup --create           # Create event backup

Alias: ev

Subcommands

SubcommandDescription
queryQuery events (--selector, --count, --level)
getShow event details
archiveArchive events (--before-date, --ids)
purgePurge old events (--older-than-days, --yes to skip confirmation)
backupManage event backups (--create, --status)

Utility Commands

madsci version

Show MADSci version information.

madsci version
madsci --version

madsci completion

Generate shell completion scripts.

madsci completion bash          # Bash completions
madsci completion zsh           # Zsh completions
madsci completion fish          # Fish completions

madsci commands

List all available CLI commands with descriptions.

madsci commands

Alias: cmd

madsci tui

Launch the interactive terminal user interface.

madsci tui

Alias: ui

Main screens (9) — accessible via keyboard shortcuts:

KeyScreenDescription
dDashboardService overview and quick actions
sStatusDetailed service health with auto-refresh
lLogsFilterable log viewer with follow mode
nNodesNode status, admin commands, and action executor
wWorkflowsWorkflow monitoring with step progress and filtering
eExperimentsExperiment browsing with status filtering
iResourcesResource inventory with type filtering and detail panels
bData BrowserDatapoint browsing with label and type filtering
oLocationsLocation browsing with transfer graph visualization

Detail/Modal screens (5) — opened from context within main screens:

Additional shortcuts: q quit, ? help, r refresh, Ctrl+P command palette

madsci registry

Manage the MADSci service registry.

madsci registry list
madsci registry show <service_name>

madsci migrate

Run database migrations.

madsci migrate --db-url postgresql://localhost/resources
madsci migrate status
madsci migrate rollback                    # Roll back a migration

Subcommands

SubcommandDescription
statusShow migration status
rollbackRoll back a migration to restore original files

Command Aliases

For faster CLI usage:

AliasCommand
nnew
sstatus
llogs
docdoctor
valvalidate
uitui
cmdcommands
cfgconfig
wfworkflow
resresource
loclocation
ndnode
expexperiment
campcampaign
dtdata
evevents