Command line

Document operations have SDK and REST twins; the browser uses the same API.

Command

Does

REST

vibe-sketcher --version

Prints the version (and the codename, once registered).

GET /api/version

vibe-sketcher serve [DOC.vsk] [--open]

Starts the app and the API on port 8766, or the next free port, which it prints; with a file, Save writes back to it.

vibe-sketcher desktop [FILE] [--port PORT] [--no-sandbox]

Launches the native Electron window and its server; passes FILE to the desktop shell. Quitting the window ends the command.

the REST API underneath

vibe-sketcher mcp [DOC.vsk ...] [--server URL | --new-server]

Serves the tools to an agent over MCP on standard input and output; see working with agents.

the REST API underneath

vibe-sketcher convert INPUT -o OUTPUT

Converts between the file formats; --from smiles, inchi, name, peptide, dna, rna or helm takes the text itself; -o scheme.tex (or --to chemfig) writes chemfig source for LaTeX.

POST /api/convert, POST /api/export/{format}

vibe-sketcher clean DOC.vsk [-o OUT.vsk]

Standard bond lengths and angles for every molecule, the drawing’s arrangement kept; in place unless -o is given.

POST /api/documents/{id}/clean

vibe-sketcher tidy DOC.vsk [--width 24] [-o OUT.vsk]

Lays the whole reaction scheme out as papers draw it, its steps and reactions kept (Tidy scheme); a scheme it cannot lay out is left, with the reason and exit status 3.

POST /api/documents/{id}/tidy

vibe-sketcher embed DOC.vsk [--species ID] [--count N] [--replace]

3D structures (ETKDG, then MMFF94) with the drawn stereochemistry checked, kept in the document; in place unless -o is given.

POST /api/documents/{id}/embed

vibe-sketcher relax DOC.vsk [--species ID] [--constraint KIND:ATOMS[=VALUE]] [--force-field mmff94|uff] [--fmax F] [--max-steps N] [--embed]

Relaxes 3D structures with FIRE on MMFF94 or UFF, the drawn stereochemistry checked; a distance:1,2=1.54, angle:0,1,2, dihedral:0,1,2,3=60 or position:5 constraint holds exactly (the starting value when none is given); --embed makes missing 3D structures first; in place unless -o is given.

POST /api/documents/{id}/relax

vibe-sketcher submit DOC --species ID | --reaction ID | --scheme | --all --program orca|vibeqc --task T --method M ... [--script]

Writes the inputs and submits them to vibe-scheduler as one group, embedding what has no 3D structure; the jobs and runs are saved in DOC. --reaction submits a reaction’s reactants, reagents and products, each distinct species once however many steps it is in, --scheme every reaction’s; the group id is printed last. A vibe-qc job goes as a QVF job container that keeps the sketch with its result, as a run script with --script or, with the reason on standard error, when no container can be built or pinned. Exit status 3 if a species was refused.

POST /api/documents/{id}/submit

vibe-sketcher runs DOC [--json] [--groups]

The document’s runs in vibe-scheduler with their state, group and where each result is: the queue’s directory and, for a container, its file. --groups gives one line per group with how many runs are in each state and whether it has finished.

GET /api/documents/{id}/runs, GET /api/documents/{id}/groups

vibe-sketcher cancel RUN

Cancels a run that has not finished.

POST /api/queue/runs/{run}/cancel

vibe-sketcher cancel-group DOC GROUP

Cancels the runs of a group that have not finished; finished runs are left alone.

POST /api/documents/{id}/groups/{group}/cancel

vibe-sketcher recipe DOC [--id ID] [--json]

Reviews the document’s staged recipes: each stage per species as vibe-qc would run it, with refusals and what the operator gives at launch.

GET /api/documents/{id}/recipes

vibe-sketcher recipe-set DOC --baseline | --from FILE.json [--species ID | --reaction ID | --scheme | --all] [--id ID] [--name N]

Saves a staged recipe (the publication baseline, or a recipe as JSON), replacing one with the same id; in place unless -o is given.

POST /api/documents/{id}/recipes/baseline, PUT /api/documents/{id}/recipes/{recipe}

vibe-sketcher recipe-remove DOC ID

Removes a recipe.

POST /api/documents/{id}/recipes/{recipe}/remove

vibe-sketcher campaign-compile DOC RECIPE --out DIR [--id ID] [--host H] [--program P] [--python PY] [--runner CMD] [--cpus N] [--mem-mb M] [--accept-model-license]

Compiles a recipe into a vibe-scheduler campaign in a new directory, records it on the recipe and prints the vq campaign run command; exit status 3 with every reason when it cannot.

POST /api/documents/{id}/recipes/{recipe}/campaigns

vibe-sketcher campaign-energies DOC RECIPE CAMPAIGN --stage ID [--format FORMAT] [--output FILE]

Electronic reaction reports from verified, accepted campaign artifacts, with balanced coefficients and retained review provenance.

POST /api/documents/{id}/recipes/{recipe}/campaigns/{campaign}/energies

vibe-sketcher campaign-status DOC RECIPE CAMPAIGN [--json]

Each stage’s process state in vibe-scheduler, its attempts and retries, and its scientific acceptance. Needs vibe-queue.

GET /api/documents/{id}/recipes/{recipe}/campaigns/{campaign}

vibe-sketcher campaign-retry DOC RECIPE CAMPAIGN NODE

Authorises the next attempt of a failed node, recorded as its retry; the next vq campaign run sends it.

POST /api/documents/{id}/recipes/{recipe}/campaigns/{campaign}/retry

vibe-sketcher campaign-render DOC RECIPE CAMPAIGN --species ID --out DIR [--size WxH] [--publication] [--no-images]

Renders a species’ start and accepted stages in one orientation from the campaign’s verified artifacts: an aligned QVF per geometry with its trajectory, renders.json, and vibe-viewer’s images when it is installed.

POST /api/documents/{id}/recipes/{recipe}/campaigns/{campaign}/renders

vibe-sketcher view DOC --species ID [--embed]

Shows a species in vibe-viewer as a QVF: through vibe-viewer’s hand-off when it started vibe-sketcher, else with vibe-viewer open on a free loopback port. Waits for startup; reports failures with the launch log instead of claiming success.

POST /api/documents/{id}/view

vibe-sketcher render DOC.vsk -o FIG.svg [--style S] [--dpi N] [--stereo-labels] [--sequences]

Renders the scheme or the structures as SVG, EPS or EMF, or as PNG or PDF with the publication extra; --stereo-labels prints CIP descriptors, --sequences peptides and nucleic acids as their sequences.

GET /api/documents/{id}/export/{svg|png|pdf|eps|emf}

vibe-sketcher render DOC... --out DIR --format svg,pdf [--style S] [--dpi N]

Renders every document in every format into DIR as STEM.FORMAT; each failure is reported with its reason, and the exit status is 3 when a figure was refused or 1 when a document could not be read or a backend is missing. See figures for papers.

the same routes, per document

vibe-sketcher import-result DOC RUN SOURCE --format orca --output OUT

Import a verified output onto a recorded run; an optimisation’s geometry comes back to the species, and --format orca-hess checks a Hessian file. See results.

POST /api/documents/{id}/results

vibe-sketcher spectrum DOC RUN SPECTRUM

Export a result’s ir, raman or uvvis line list (CSV or text) or broadened spectrum (--format broadened, --lineshape, --fwhm, --axis, grid). See results.

POST /api/documents/{id}/results/spectrum

vibe-sketcher nmr DOC RUN [--reference RUN] [--nucleus E ...]

A run’s NMR shieldings per set of equivalent nuclei and, against a reference run at the same level of theory, its shifts; JSON or a CSV, Markdown or LaTeX line list. See results.

GET /api/documents/{id}/results/nmr

vibe-sketcher nmr-labels DOC RUN --reference RUN

Places the shifts as text beside the atoms of the species’ drawn structure; in place unless -o is given.

POST /api/documents/{id}/results/nmr-labels

vibe-sketcher reaction-energies DOC --group GROUP

Report explicit source results; optional coefficients and SVG/QVF/CSV/Markdown/LaTeX exports.

POST /api/documents/{id}/results/report

vibe-sketcher highlight DOC --species ID --atom N ... [--colour C] | --clear

Marks atoms of a species (numbered as in the report) in a palette colour for the canvas and figures, or removes marks; in place unless -o is given. See figures.

POST /api/documents/{id}/highlights

vibe-sketcher abbreviate DOC [--species ID] [--label L ...] [--expand] [--list]

Draws groups such as Ph, Boc or OTf as their label, or their atoms again, without changing the structure; in place unless -o is given. See figures.

POST /api/documents/{id}/abbreviations

vibe-sketcher nanostructure DOC KIND [options]

Generates a nanotube, graphene flake, nanoribbon or fullerene from its parameters and adds it as a species with its 3D atoms; creates DOC if needed, in place unless -o is given. See nanostructures.

POST /api/documents/{id}/nanostructures

vibe-sketcher depict DOC SPECIES [--style S] [--label] [--rear light|omit] [--break auto|on|off] [--width W]

Puts a picture of a nanostructure species on the canvas as one object; in place unless -o is given. See nanostructures.

POST /api/documents/{id}/species/{species}/picture

vibe-sketcher attach DOC GENERIC SPECIES [--anchor A]

Moves a labelled structure onto an anchor of a nanostructure’s picture, so figures print them as one; in place unless -o is given.

POST /api/documents/{id}/generics/{generic}/attach

vibe-sketcher half-reaction DOC --reactant P ... --product P ... [--electrons N] [--electron-side S] [--at-arrow] [--condition TEXT ...]

Draws an electrode half-reaction (a participant is [COEF*]SMILES[;STATE]) and prints its balance; creates DOC if needed, in place unless -o is given. See electrode reactions.

POST /api/documents/{id}/half-reactions

vibe-sketcher balance DOC [REACTION] [--json]

Each reaction’s atom and charge balance with its electrons; exits 1 when one does not balance.

GET /api/documents/{id}/balance

vibe-sketcher tlc DOC --lane LABEL:RF[,RF...] ...

Draws a TLC plate beside the drawing from shapes and text, a spot per Rf; in place unless -o is given. See figures.

POST /api/documents/{id}/tlc

vibe-sketcher apparatus DOC KIND [--at X,Y] [--scale S] [--label TEXT]

Draws a laboratory apparatus pictogram (flask, conical-flask, beaker, condenser, separatory-funnel, column, vial, hotplate, three-electrode-cell, two-compartment-cell, potentiostat, tube-furnace, gas-cylinder, uv-lamp) from shapes; in place unless -o is given. See figures.

POST /api/documents/{id}/apparatus

vibe-sketcher cap DOC GENERIC --cap H|CH3

Makes a species of a labelled structure by replacing each attachment label (CNT, Au, …) with the cap, which it records; in place unless -o is given. See figures.

POST /api/documents/{id}/generics/{generic}/cap

vibe-sketcher generics DOC [--json]

The drawing’s R-group cores, bracketed groups and labelled structures (with their labels and capped species) as CXSMILES, and each R-group’s substituents and conditions. See the document format.

GET /api/documents/{id}/generics

vibe-sketcher stereo DOC [--json]

Each species’ CIP descriptors (R/S, r/s, E/Z), its undefined stereocentres and double bonds, and its enhanced-stereo groups. See the app.

GET /api/documents/{id}/stereo

vibe-sketcher stereo-labels DOC [--clear]

Writes the descriptors into the drawing as labels, or removes them; in place unless -o is given.

POST /api/documents/{id}/stereo-labels

vibe-sketcher amounts DOC REACTION --amount SPECIES:key=value[,...] ... | --clear

Enters a reaction’s amounts for its stoichiometry table (mmol, mass_mg, volume_ml with density_g_ml or concentration_mol_l, equivalents, coefficient), replacing earlier ones; in place unless -o is given. See the app.

PUT /api/documents/{id}/reactions/{reaction}/amounts

vibe-sketcher stoichiometry DOC REACTION [--format FORMAT]

The worked table: molar masses, equivalents, mmol, mass, volume, limiting reactant, theoretical and isolated yields, as JSON or a CSV, Markdown or LaTeX table.

GET /api/documents/{id}/reactions/{reaction}/stoichiometry?format=

vibe-sketcher properties DOC [--format FORMAT]

Formula, masses, elemental analysis and calculated descriptors per species as a CSV, Markdown or LaTeX table; see the app.

GET /api/documents/{id}/properties?format=

vibe-sketcher property-text DOC --species ID [--field F ...]

Places the species’ formula, molar mass and analysis (or the chosen fields) as text under its structure; in place unless -o is given.

POST /api/documents/{id}/species/{species}/property-text

vibe-sketcher info DOC.vsk [--json]

Formula, masses, elemental analysis, descriptors, charge, multiplicity, identifiers and checked name per species, and the reactions. For a finished QVF job container, its result too: the job, its status, the energy and the conformer the result geometry became.

GET /api/documents/{id}/report, result of POST /api/documents

vibe-sketcher name SMILES

The checked name of a structure; exit status 3, and the engine’s unchecked suggestion on standard error, when there is none.

in the report

vibe-sketcher validate DOC.vsk ...

Checks documents; prints every problem.

POST /api/documents/validate

vibe-sketcher schema [--output FILE]

Prints the document JSON schema.

GET /api/schema/document

vibe-sketcher writers [--json]

Lists the input writers.

GET /api/writers

vibe-sketcher input DOC.vsk --job ID

Writes a job’s input.

POST /api/inputs

vibe-sketcher neb DOC.vsk --reaction ID [--show] [--pin R:A=P:B ...] [--program orca|vibeqc] [--kind neb-ts|neb-ci|neb] --method M --basis B [--images N] [--output-dir DIR]

Shows a reaction’s atom mapping and writes its nudged-elastic-band inputs (reaction paths); an ambiguous mapping or an inexpressible specification exits with status 3 and the reasons.

POST /api/documents/{id}/reactions/{rid}/mapping, .../neb

vibe-sketcher input DOC.vsk --species ID [--species ID ...] | --all --program NAME [--task T --method M --basis B ...] [--embed] [--output-dir DIR]

Writes species with one writer, the specification from the options or --spec JSON; --embed makes the 3D structures first.

POST /api/inputs, POST /api/documents/{id}/inputs

Discover options and select species

Run vibe-sketcher --help for the command list and, for example, vibe-sketcher input --help for a command’s complete options. Use vibe-sketcher info DOCUMENT.vsk --json to discover species IDs before selecting one with --species; IDs belong to the document, not to a chemical name. vibe-sketcher writers --json lists registered writers and their supported fields and tasks.

Quote SMILES and reaction SMILES in the shell, especially strings containing >, parentheses or brackets. For example:

vibe-sketcher convert 'CC(=O)O.CCO>>CC(=O)OCC.O' --from smiles -o reaction.vsk

clean and embed update the input document unless you supply -o. input --embed prepares missing geometries for input generation without saving them back to the document; use embed separately when you want to retain them. submit records jobs and runs in its input document. Keep an editable master and choose separate destinations for figures and exchange formats.

Convert files and text

convert infers the input format from a file’s suffix. For literal text, provide --from, and quote the string:

vibe-sketcher convert 'CCO' --from smiles -o ethanol.vsk
vibe-sketcher convert ethanol.vsk -o ethanol.sdf
vibe-sketcher convert ethanol.vsk --to smiles -o ethanol.smi

--to explicitly selects the output format; otherwise the output suffix selects it (.smi means SMILES). Keep the suffix consistent with the requested format so another program can recognize the file. convert prepares the supported representation; it does not generate missing 3D coordinates. For XYZ output, embed first and use input --program xyz as described in file formats.

Exit statuses and result protection

Exit status: 0 on success, 1 for an invalid document, unreadable input or a missing drawing library, 2 for a usage error (an unknown job, species or writer included), 3 when a writer or an exporter refuses. The REST side is mapped in the REST API.

The server serves its OpenAPI description at /openapi.json, so an agent can read the contract instead of guessing it.

QVF results are imported as structures; calculation payloads are not kept. A finished QVF job container opens with its drawing, the result geometry as a new conformer of the job’s species and the energy (vibe-sketcher info). Commands refuse to write over such files (exit status 3). Use --output with a different QVF or VSK destination. Native sketch QVF files can be saved in place when their data is reproducible from the stored sketch. Before submit, convert an imported result to a new sketch file: submission needs to save run records in its input document, so it refuses protected files before starting any jobs.

Browser server and file-backed editing

vibe-sketcher serve draft.vsk --port 8766 --open

If draft.vsk exists, the server loads it; if not, it opens an empty document and creates the file on the first Save. The parent directory must already exist. Use a native VSK or supported QVF document here. To open another chemistry format, use the browser’s Open action or convert it to VSK first.

Without --port, the server tries ports 8766 through 8775. With an explicit port it refuses an occupied port instead of choosing another. Use the printed address for clients. Ctrl+C stops the server; save wanted edits first because its open-document store is held in memory.

A browser upload and a file named on the server command line have different save behavior: uploads download copies, while a file-backed document can save to its original path. Protected QVF results still require a different output file. The app guide describes browser and desktop saving.

Desktop launch

With a source installation, vibe-sketcher desktop works from any directory. The first launch installs the reviewed Electron runtime; later launches check it and repair a missing, damaged or stale runtime. An installed wheel alone has no electron/ directory: run ./scripts/install.sh in a source checkout and use its .venv/bin/vibe-sketch.

The launcher selects port 8766 or one of the next nine free ports. An explicit --port must be free. It records its Python interpreter for later desktop launches, and passes the current directory, optional file and version to Electron in a private temporary file. The temporary file is removed when the window exits or the command is interrupted. Ctrl+C stops Electron, whose main process owns the server lifecycle.

On Linux, run as a regular user. --no-sandbox is a Linux-only escape hatch for restricted environments and prints a warning; running as root is refused even with that flag. Missing Linux libraries preserve the installer’s diagnostic and exit status 2. Other Electron failures retain their status, with signals mapped to 128 plus the signal number.

vibe-sketcher return-geometry DOC RETURNED.qvf --document-id KEY --output UPDATED.vsk appends a checked viewer geometry without replacing the drawing. Use the same key with view --document-id KEY; omit it only when the document is unchanged since sending. REST accepts the archive as base64 in data at POST /api/documents/{id}/geometry-return; MCP exposes return_geometry. The browser’s Import returned geometry button uses that same endpoint.

Named reactions

See the compound, fragment and named-reaction library for the searchable picker, editable examples, explicit unfinished scaffolds, source coverage and matching SDK, CLI, REST and MCP operations.