Command Line

September 14, 2026 · View on GitHub

The cobra command runs a saved configuration, inspects an input file, checks the environment, or opens the GUI.

cobra                              # open the graphical interface
cobra run config.json              # run a saved configuration headlessly
cobra parse design.cir             # report what COBRA reads from an input file
cobra doctor                       # check simulators and optional packages
cobra --version
cobra <command> --help

Commands

CommandPurpose
run CONFIGExecute a saved JSON configuration without the GUI
parse TARGETReport a configuration or netlist without running it
doctorReport the Python packages and simulators COBRA found
guiOpen the graphical interface (also the default with no command)

Output Options

These options are accepted before or after the command, so both cobra -v run config.json and cobra run -v config.json work.

OptionEffect
-v, --verboseShow debug output; -vv also includes third-party libraries
-q, --quietReport warnings and errors only, and hide the progress bar
--log-file PATHAlso write a timestamped debug log to PATH
--no-colorDisable coloured output (the NO_COLOR variable does the same)

--log-file always records at debug level, whatever the console shows, so a long run can be diagnosed afterwards:

cobra run config.json --quiet --log-file results/run.log

What Goes Where

Requested output — the parse report, the run header and summary, the doctor table — is written to stdout. Progress and diagnostics are written to stderr. Piping a report therefore stays safe:

cobra parse config.json --json > report.json

Running a Configuration

cobra run path/to/cobra_config.json

The run starts with a header describing what is about to happen, shows a progress bar while it iterates, and ends with a summary:

COBRA 1.5.0
  netlist     amplifier.cir
  analysis    AC
  optimizer   OptunaOptimizer
  simulator   XyceSimulator
  parameters  4
  goals       2
  iterations  up to 500

COBRA optimization:  14%|█████                | 68/500 [02:41<17:03,  2.37s/it]

Summary
  status      design goals achieved at iteration 68
  wall time   2m 41s
  results     results/2026-09-06_11-04-22_amplifier

Checking the Environment

cobra doctor reports the interpreter, the required packages and simulators, and the optional components whose absence only disables a feature. It exits with 1 when something required is missing, which makes it usable as a pre-flight check in CI.

cobra doctor

Xyce is required for circuit simulation; when it comes from Spack, load it in the same shell first:

. ../spack/share/spack/setup-env.sh && spack load xyce
cobra doctor

Exit Codes

CodeMeaning
0Success
1The run failed, or doctor found a missing requirement
2Invalid input, or a parse report containing errors
130Interrupted (Ctrl+C)

This makes parse usable as a gate:

cobra parse config.json && cobra run config.json