OpenSees CLI Docs
PyPI Install
CLI Docs

Run OpenSees in the Cloud
from any devices

A command line for OpenSeesCloud — call ops from Python, JavaScript, C++, shells, CI, or any tool that can invoke a CLI. Authenticate, submit simulations, stream output, and manage cloud files on macOS, Linux, and Windows.

Package opensees_cli · v0.2.1 Command ops Python ≥ 3.9

Submit & wait

Upload a .py model, reserve runtime against your quota, and follow live stdout.

Cloud files

Keep inputs in your personal file system; submit by cloud path without re-uploading.

Pin OpenSeesPy

Choose an active registry version with ops version set; sticky pin travels with every submit.

quick look
$ pip install opensees_cli
$ ops auth login -e you@example.com
$ ops run submit ./model.py -t 120 --wait
→ analysis abc123… running
→ stdout streaming…
Get set up

Install

Install from PyPI. The distribution and import name are both opensees_cli.

Install the package

Requires Python 3.9 or newer.

install
pip install opensees_cli

Make sure ops is on your PATH

If a new terminal cannot find ops, add the pip scripts directory:

path
python -m opensees_cli set-path

Open a new terminal afterward. You can always run via python -m opensees_cli.

Verify

verify
ops version
ops help
Tip: Package page — pypi.org/project/opensees_cli. Hyphens and underscores are equivalent on PyPI (opensees-cli resolves to the same project).
First run

Quick start

Create an account, confirm email, log in, then submit a model.

quick start
# 1) Create account
ops auth signup --email you@example.com

# 2) Confirm with the code from your inbox
ops auth confirm --email you@example.com --code 123456

# 3) Log in
ops auth login --email you@example.com

# 4) Submit a simulation
ops run submit ./model.py --timeout 300 --wait
Account

Auth

Manage signup, login, and passwords under ops auth.

auth
ops auth signup         -e you@example.com
ops auth confirm        -e you@example.com -c 123456
ops auth resend-code    -e you@example.com
ops auth login          -e you@example.com
ops auth logout
ops auth status
ops auth forgot-password -e you@example.com
ops auth reset-password  -e you@example.com -c 123456
ops auth change-password
Password reset: run forgot-password, then reset-password with the emailed code. Use change-password when already logged in.
Simulations

Run

Submit analyses, follow progress, inspect stdout and artifacts.

Submit

ops run submit FILENAME auth

Local .py path (uploaded if present) or a cloud path such as model.py / lab/model.py.

  • -t, --timeoutMax wall time per task in seconds (default 120). Capped by per-task quota; monthly runtime must cover timeout × count.
  • -n, --countNumber of parallel tasks (default 1).
  • -w, --waitStream until completion. Without --wait, prints analysis ID on stdout immediately.
  • -p, --paramRepeatable key=value. In the script: from openseespy.cli_params import cli_params.
  • --params-fileJSON object of parameters.

Monitor & results

run lifecycle
ops run follow   <analysis_id>
ops run status   <analysis_id> [range]
ops run output   <analysis_id> [range]
ops run stats    <analysis_id> [range]
ops run data     <analysis_id> [range] -d . -o ./out
ops run cancel   <analysis_id>
ops run list     -n 20
ops run clear    <analysis_id> -y

Optional range is a task index, start-end, or all for multi-task analyses. ops run list supports --week, --month, --year, --after, --before, and --json.

Storage

Cloud files

Your personal file system for inputs you reuse across runs.

files
ops files list                      # all files
ops files list truss                # folder filter
ops files upload ./model.py -f lab
ops files download lab/model.py -o ./local.py
ops files delete lab/model.py
Submit from cloud: after upload, run ops run submit lab/model.py without re-uploading the local file.
Runtime

OpenSeesPy version

Pin a sticky local preference, or use the API default (latest active registry version).

version
ops version                 # effective version (pinned or default)
ops version list            # registry
ops version set 3.7.0.0     # pin OpenSeesPy version
Account

Status & quota

See who you are, OpenSeesPy in use, and remaining quota.

status
ops status
Walkthrough

Example: Truss.py

A classic 2D truss from a local file at examples/Truss.py — upload, submit, check when it finishes, read stdout, inspect artifacts, and download results.

The model

Local folder: examples/Truss.py

examples/Truss.py
print("==========================")
print("Starting Truss example")

import openseespy.opensees as ops
from openseespy.cli_params import cli_params

# ------------------------------
# Start of model generation
# -----------------------------

task_id = ops.getTaskID()
num_tasks = ops.getNTasks()
print(f"Task ID: {task_id}, Number of tasks: {num_tasks}, cli_params: {cli_params}")

# remove existing model
ops.wipe()

# set modelbuilder
ops.model('basic', '-ndm', 2, '-ndf', 2)

# create nodes
ops.node(1, 0.0, 0.0)
ops.node(2, 144.0,  0.0)
ops.node(3, 168.0,  0.0)
ops.node(4,  72.0, 96.0)

# set boundary condition
ops.fix(1, 1, 1)
ops.fix(2, 1, 1)
ops.fix(3, 1, 1)

# define materials
ops.uniaxialMaterial("Elastic", 1, 3000.0 * (task_id+1))

# define elements
ops.element("Truss",1,1,4,10.0,1)
ops.element("Truss",2,2,4,5.0,1)
ops.element("Truss",3,3,4,5.0,1)

# create TimeSeries
ops.timeSeries("Linear", 1)

# create a plain load pattern
ops.pattern("Plain", 1, 1)

# Create the nodal load - command: load nodeID xForce yForce
ops.load(4, 100.0, -50.0)

# ------------------------------
# Start of analysis generation
# ------------------------------

# create SOE
ops.system("Mumps")

# create DOF number
ops.numberer("Plain")

# create constraint handler
ops.constraints("Plain")

# create integrator
ops.integrator("LoadControl", 1.0)

# create algorithm
ops.algorithm("Linear")

# create analysis object
ops.analysis("Static")

# perform the analysis
ops.analyze(1, '-noFlush')


ux = ops.nodeDisp(4,1)
uy = ops.nodeDisp(4,2)
ux_expected = 0.53009277713228375450 / (task_id+1)
uy_expected = 0.17789363846931768864 / (task_id+1)
print(f"Task {task_id}: ux = {ux}, uy = {uy}, expected = {ux_expected}, {-uy_expected}")
print("==========================")

# save to file
fd = open('truss.txt', 'w')
fd.write(f'Task {task_id}: ux = {ux}, uy = {uy}, expected = {ux_expected}, {-uy_expected}')
fd.close()

Upload the model

Upload the local file examples/Truss.py to your cloud file system.

upload
ops files upload examples/Truss.py -f truss  # upload local to cloud folder truss
ops files list truss              # confirm Truss.py is listed

Tip: ops run submit ./examples/Truss.py uploads the local file automatically if you skip step 1.

Submit the run

Submit the cloud file uploaded in step 1. Without --wait, the analysis ID is printed on stdout.

submit
ops run submit truss/Truss.py -t 60  # submit cloud file
# or stream until completion:
ops run submit truss/Truss.py -t 60 --wait

Check status

Poll until the analysis is completed or failed (skip if you used --wait).

status
ops run status <analysis_id>
# or follow until every task finishes:
ops run follow <analysis_id>

Show output

Print the simulation stdout (what the script printed in the Cloud).

output
ops run output <analysis_id>

Expected stdout for a successful run:

stdout
Running Truss.py...
==========================
Starting Truss example
Task ID: 0, Number of tasks: 1, cli_params: {}
Task 0: ux = 0.5300927771322838, uy = -0.1778936384693177, expected = 0.5300927771322838, -0.1778936384693177
==========================
Process 0 Terminating

List data files

See result JSON, OSB model snapshots, truss.txt (written by the script), and other artifacts from the run.

data
ops run data <analysis_id>  # return data for the run
ops run stats <analysis_id>     # return code, runtime, RAM

Download artifacts

Download truss.txt (written by the script) from the run artifacts to your local machine.

download
ops run data <analysis_id> -d artifacts/truss.txt -o ~/Downloads/  # download truss.txt that was generated in the script to local ~/Downloads folder
Full script in one go (after login): upload → submit with wait → list data → download.
all steps
ops files upload examples/Truss.py -f truss  # upload local to cloud folder truss
ops run submit truss/Truss.py -t 60 --wait  # submit cloud file
# save analysis_id from submit output if not using --wait:
ops run status <analysis_id>
ops run output <analysis_id>
ops run data <analysis_id>  # return data for the run
ops run data <analysis_id> -d artifacts/truss.txt -o ~/Downloads/  # download truss.txt that was generated in the script to local ~/Downloads folder
Cheat sheet

Command reference

Top-level entry points. Use ops <cmd> --help for the full option list.

ops help

Show CLI help.

ops set-path

Add the ops scripts directory to your PATH. Prefer python -m opensees_cli set-path if ops is not found yet. -y applies without prompting.

ops version …

Show / pin / list / clear OpenSeesPy versions (set, get, list, clear).

ops status auth

Account details and usage quota.

ops auth …

signup · confirm · resend-code · login · logout · status · forgot-password · reset-password · change-password

ops run … auth

submit · follow · status · output · stats · data · cancel · clear · list

ops files … auth

list · upload · download · delete

Launcher

PATH and the ops command

Pip installs the launcher into a scripts directory that may not be on PATH.

  • On first interactive run, the CLI can offer to fix PATH automatically.
  • Force the step anytime: python -m opensees_cli set-path (answer Y).
  • Equivalent entry point: python -m opensees_cli.
  • To see the offer again after skipping, delete ~/.opensees/path_fixed (Windows: %USERPROFILE%\.opensees\path_fixed).