Skip to content

CLI Reference

aseview [OPTIONS] [FILES...]

FILES are one or more structure files in any ASE-readable format. With --topology, they are ordered MD coordinate trajectories; install aseview[md] for this reader. By default the viewer is served on a local HTTP server and opened in the browser; -o writes the HTML file instead. aseview2 is an alias of aseview. Use --list or --kill without input files for server management.

Choosing the viewer

-v, --viewer Viewer Chosen automatically when
molecular MolecularViewer one file
overlay OverlayViewer several files
normal NormalViewer --hess is given
frag FragSelector never (first frame only)
surface SurfaceViewer never
surface-sequence SurfaceViewer sequence from a JSONL manifest or extxyz metadata never

-v overlay on a single trajectory overlays its frames.

Options

Input

Option Description Default
-i, --index Frame index or slice: 0, -1, :, 0:10, ::2, 10:20:2, -10: all frames
-f, --format ASE format name, when auto-detection fails auto
--topology Matching topology file for DCD/XTC/TRR coordinate inputs; requires aseview[md] none
--topology-format MD topology format override; requires --topology auto
-w, --wrap Wrap each selected frame into its own cell off

For paired MD input, -f selects the coordinate format. -i is applied to each coordinate file before concatenation, including negative and reverse indices. Several files still select overlay by default; request -v molecular for serial playback or annotations:

aseview part1.dcd part2.dcd --topology system.pdb -i ::10 -v molecular -o md.html

Topology input applies to molecular, overlay and fragment views; it cannot be combined with normal-mode or surface inputs. See MD input details for atom-order requirements, units and supported formats.

--wrap uses each frame's own cell, including changing or skewed cells in a trajectory. It wraps along every nonzero cell vector regardless of the PBC flags, leaving those flags unchanged. Missing cells leave coordinates unchanged; partial cells wrap only along their existing vectors. Loaded energy, forces and other atom metadata are preserved, and input files are never modified. Without the option, coordinates remain as read. Surface viewers do not support --wrap because translating atoms alone would misalign them with the volumetric field.

Appearance

Option Description Default
--style minimal, default, 2d, cartoon, neon, glossy, metallic, cinematic, rowan, bubble, grey (Styles) cartoon
--high-performance Analytical atom/bond rendering and up to eight future frames prepared off the UI thread; molecular viewer off (False)
-t, --theme spring, simple, glass, dark, darkgreen (Themes) spring
--cmap, --colormap Overlay colormap, or the fragment palette in the molecular viewer: viridis, plasma, coolwarm, jet, rainbow, grayscale —
--grid-view Four tetrahedral views in a 2×2 grid (Grid View); molecular viewer off
--opacity Whole-structure opacity, 0–1; molecular viewer —

For large structures and trajectories, combine --high-performance --style minimal. High-performance rendering applies to Minimal, Cartoon, Default and Glossy; other styles and shadows use the standard renderer. The sidebar toggle also changes this setting at runtime. Input remains eager: every selected frame is loaded and embedded in the HTML. Preparing eight future frames is not unlimited streaming; use -i 0:1000:5 to reduce input memory and output size.

Fragments (molecular viewer)

Option Description
--fragments Per-atom labels with optional repeats (a,a,a,b,b or a*3,b*2), or ;-separated index groups with ranges (0-2;3,4,5)
--fragment-colors label=#hex pairs, e.g. a=#ff0000,b=#00ff00
--fragment-opacities label=value pairs in 0–1, e.g. a=1,b=0.3

Without --fragments, non-uniform ASE tags and then atoms.info['fragments'] are used. See Fragment Coloring.

Annotations (molecular viewer)

--annotations PATH reads a UTF-8 JSON list of box/caption records. The list replaces atoms.info["aseview_annotations"]; a file containing [] disables metadata annotations. Without the option, molecular viewing uses frame-local metadata. Malformed JSON, invalid records, and unsupported viewer choices fail before the output HTML is replaced.

[
  {
    "id": "water-group",
    "selector": {"kind": "index", "values": [0, 1, 2]},
    "frames": {"start": 0, "stop": 2},
    "text": "First two loaded frames",
    "color": "#f59e0b"
  }
]

Ranges are half-open and count the loaded frames after -i selection and concatenation, not source-file frame numbers. Several input files still select the overlay viewer by default. Choose -v molecular explicitly to concatenate them for annotated playback. --annotations doesn't change that default and isn't supported by overlay, normal-mode, fragment-selector, or surface viewers.

The trajectory guide creates the inputs for this executable example:

python -m aseview annotated-water.extxyz -v molecular --annotations water-cues.json -i ::2 -o annotated-water-sliced.html

This loads two of the guide's four frames, so its [0, 2) cue covers both loaded frames. For several files, use the same option with -v molecular, for example aseview first.extxyz second.extxyz -v molecular --annotations cues.json -o combined.html.

Normal modes and fragment selector

Option Description Default
--hess, --hessian ORCA .hess or VASP OUTCAR (detected) —
-bt, --bond-threshold Fragment selector bond scale on the covalent-radii sum 1.2

Surfaces

Option Description Default
--surface-kind orbital, density or delta_density orbital
--isovalue auto, a number, a comma list, start:stop:count or linspace(start,stop,count) (endpoints included) auto
--surface-style solid, mesh, contour or dot solid
-O, --on-the-fly Keep a local surface server running; typing an isovalue in the viewer recomputes the shells off
--surface-path-key extxyz Atoms.info key holding per-frame surface paths (surface-sequence) —
--surface-label-key extxyz Atoms.info key holding frame labels surface_label
--surface-kind-key extxyz Atoms.info key holding per-frame surface kinds surface_kind

Density isovalues are signed; orbital and delta-density isovalues are magnitudes and always give both phases. A negative value needs =: --isovalue=-0.02.

Output and server

Option Description Default
-o, --output Write the HTML to this file instead of serving it —
-p, --port Server port; startup fails if the port is occupied 8080
--timeout Stop the server after this many seconds 21600 (6 hours)
--no-browser Do not open a browser off
--background Start the server in the background and return to the shell off
-l, --list List running ASEView servers with viewer, absolute file paths and clickable URLs off
-k, --kill PORT Stop the ASEView server registered on PORT —
--kill all Stop all running ASEView servers —
-h, --help Show help

Servers stop automatically after six hours by default. Set another lifetime with --timeout; press Ctrl+C to stop a foreground server sooner. --kill controls only servers started by ASEView with server management enabled.

Image export is not a CLI option: use the PNG/GIF buttons in the viewer, or save_png() / save_gif() in Python.

Examples

# Structures and trajectories
aseview structure.cif --style glossy
aseview md.traj -i ::5 --grid-view
aseview md.traj --wrap -i ::5
aseview POSCAR -w
aseview trajectory.xyz -o trajectory.html
aseview large.extxyz --high-performance --style minimal -i 0:1000:5 -o large.html

# Overlay
aseview conf1.xyz conf2.xyz conf3.xyz --cmap plasma
aseview optimization.xyz -v overlay --cmap viridis

# Fragments
aseview dimer.xyz --fragments 'a*3,b*4' --cmap viridis --fragment-colors 'b=#ff0000'
aseview dimer.xyz --fragments '0-2;3-6' --fragment-opacities '1=0.3'

# Normal modes
aseview molecule.xyz --hess orca.hess
aseview POSCAR --hess OUTCAR

# Fragment selector
aseview molecule.xyz -v frag -bt 1.4 -o selector.html

# Surfaces
aseview HOMO.cube -v surface --surface-style contour --isovalue 0.03:0.09:4
aseview density.cube -v surface --surface-kind density --isovalue 0.001:0.004:4
aseview HOMO.cube -v surface -O
aseview frames.jsonl -v surface-sequence --surface-kind orbital --isovalue 0.03
aseview traj.extxyz -v surface-sequence --surface-path-key surface_path \
    --surface-kind density

# Remote server (then: ssh -L 8080:localhost:8080 user@server)
aseview molecule.xyz -p 8080 --no-browser

# Server management
aseview -l
aseview -k 8081
aseview --kill all
aseview molecule.xyz --background --timeout 3600