Repository navigation
Getting Started
This page is for running FormChem from its source folder. The desktop app, where to download it and how to build it yourself are in the Manual and on Desktop.
Python 3.12 or later, Node 20.19+ or 22.12+, and for desktop builds Rust with the Tauri toolchain. ./formchem doctor checks them, the backend venv and its packages, and whether ports 5220 and 8220 are free.
./formchem install # backend venv and frontend packages
./formchem # engine on 127.0.0.1:8220, app on http://localhost:5220
Windows: formchem.bat install, then formchem.bat. One-click installers: formchem_oc_install and formchem_oc_install.bat.
Aspirin, with the mouse and a few keys:
- On Home, press New drawing. Home closes and the canvas opens with the tool rail on the left.
- Press
R(the benzene tool) and click the middle of the page: a benzene ring. - Press
B(the single bond tool) and click a ring atom: a bond grows out of it. Click the new end atom to grow the chain; add two short branches the same way (one for the acetyl group, one for the acid). - Point at an atom without clicking and press
O: it becomes oxygen. Point at a bond and press2: it becomes double. Do this for the ester oxygen, the two carbonyls and the acid oxygens. - Open the Analysis panel (title bar or View > Analysis Panel): formula C9H8O4, molecular weight 180.16, exact mass 180.0423 and the elemental analysis. The formula also sits in the status bar.
- Structure > Clean Up Structure tidies bond lengths and angles in one undo step.
Ctrl+S(Cmd+Son macOS) saves; a new drawing asks for a name.
Faster: copy CC(=O)Oc1ccccc1C(=O)O and press Ctrl+V on the canvas, or use Insert > Structure from SMILES. Molfile, SDF, RXN, SMILES, InChI, CML, CDXML and CDX files open from File > Open or by dropping them on Home, PDB and mmCIF files open there as 3D objects, and Ctrl+3 shows a structure in 3D after 3D > Build 3D from 2D (3D), and File > Export saves PNG, SVG, PDF and EPS pictures that open again as the drawing (Formats and Export). The page is dark by default; View > Dark Page turns it off (Grid and Page). Drawing lists every tool and hover key, and how to draw with the keyboard alone.
- File > New Database..., type a title and press Create. The database workspace opens with the empty database (an
.fcdbfile in theDatabasesfolder of the data folder). - Database > Import Records..., choose an SD, SMILES, CSV or TSV file, look over the column mapping, press Check for the counts, then Import. When it ends, the report lists any bad records with their reasons.
- Draw a benzene ring in a drawing (File > Databases,
Ctrl+Shift+D, switches back and forth), select it, then click Structure beside the search bar and choose Substructure. The hits become a hit list in the left column; Database > Export Records... writes them to an SD file.
Databases covers fields, duplicates, the plot and saved queries, and Lab Notebook the notebook entries that live in the same file.
Alt+Ctrl+A (Option+Cmd+A on macOS) puts the keyboard focus on the drawing. On an empty drawing press Enter for a carbon, then Enter and an arrow key for each new bond, and type O on an atom to make it oxygen; every step is spoken by your screen reader. Alt+Ctrl+S (Option+Cmd+S) describes the whole structure. Accessibility has the keys and the element colours.
Claude Code, Codex, Cursor, Antigravity or any MCP client can draw in the window you have open:
- Start FormChem (
./formchem, or the desktop app). - In the FormChem folder run
./formchem agents install. It writes the configs for Claude Code (.mcp.json), Codex, Cursor and Antigravity with the agent token, and installs the FormChem skill so the agent knows the tools. For another client, Window > Agents and MCP shows the setup lines with the token filled in, or use./formchem mcpas a stdio server, which needs no token. - Restart the agent and ask it, for example: "Draw aspirin in FormChem and check it."
- The first time it changes something, the window asks you: Deny, Allow once or Always allow.
The agent calls draw_from_smiles: the structure appears in a new drawing, the title bar shows "[agent] just edited" with Stop, and what it drew is outlined for a moment. It then checks its work with render (a picture drawn by the window) and get_structure (SMILES, InChIKey, molfile). Ctrl+Z undoes the whole call in one step; Window > Agent Activity lists every call with undo for the latest one. Agents lists the tools and Agent Activity the panel.
An agent you connected to 0.7.0 over HTTP needs the token from 0.8.0 on: run ./formchem agents install again (./formchem agents token prints the token).
| Command | What it does |
|---|---|
./formchem or ./formchem boot
|
engine and app together |
./formchem backend, ./formchem frontend
|
one half only |
./formchem build, ./formchem serve
|
build the frontend, serve it from the engine (preview on 5221) |
./formchem install-desktop, ./formchem desktop dev, ./formchem desktop build
|
the Tauri desktop app |
./formchem freeze |
freeze the engine for the desktop app (a folder in src-tauri/engine on macOS, a one-file sidecar elsewhere) |
./formchem convert, batch, descriptors, render
|
convert structure files and folders, write properties to CSV, draw every record (Command Line) |
./formchem db create, info, import, search, export
|
structure databases without the window (Command Line) |
./formchem edit-live ID |
open a live structure from the shared library in the running FormChem (Command Line) |
./formchem i18n check, scan, export, import
|
the interface languages: gaps, new strings, CSV out and in |
./formchem counts |
lines of code per language |
./formchem doctor, ./formchem desktop check, ./formchem clean
|
checks, the desktop toolchain, cleanup (Troubleshooting) |
./formchem mcp |
the MCP server over stdio |
./formchem agents install, ./formchem agents sync, ./formchem agents token
|
agent configs with the agent token, and skills; print the token |
./formchem cli list, describe, run, batch
|
the window's command catalogue from a terminal; run needs the window open |
./formchem claude |
Claude Code in this terminal with FormChem's MCP tools attached |
Each command has a formchem.bat twin on Windows.
The engine listens on 127.0.0.1:8220 (FORMCHEM_PORT), the Vite app on localhost:5220. The desktop shell starts the engine on a free port and prefers 8221. The data folder is ~/formchem (FORMCHEM_DATA_DIR), shared by the desktop app and the source folder; it holds Drawings, Autosave and Versions (drawings saved without a chosen place, recovery copies, and the last 20 saved versions of each), Logs (formchem-engine.log), settings.json, library.json (Home's lists), commands-catalogue.json, agent-token (0.8.0), the Agent log folder (0.8.0), the Databases folder (0.11.0; new databases, and the short-lived .uploads and .exports copies of a browser window), the Library folder (0.12.0; the shared structure library other Form apps read, Live Structures) and, while the engine runs, engine.json.
FormChem
- Home
- Manual
- Getting Started
- Drawing
- Grid and Page
- Annotations
- Reactions
- Templates
- Printing and pages
- Keyboard Shortcuts
- Stereo and Queries
- Analysis
- Names
- Spectra and NMR
- 3D
- Databases
- Lab Notebook
- Biopolymers
- Live Structures
- Accessibility
- Formats and Export
- Clipboard
- Command Line
- Agents
- Agent Activity
- Terminal
- Extensions
- Project Format
- Architecture
- Desktop
- Troubleshooting
- Development
- Releasing
Documents