Command-line tool for manipulating and exploring Poietic Models, with support for Stock and Flow simulation.
See also: Full documentation with all the commands.
Available platforms: MacOS 14 (and later), Linux
To install the poietic command-line tool, run the following command in the
project's top-level directory:
./installThe tool will be installed in the Swift Package Manager's' ~/.swiftpm/bin
directory. Make sure you have the directory in your PATH, if you do not, then
add the following to the end of your ~/.zshrc or ~/.bashrc file:
export PATH=~/.swiftpm/bin:$PATHRecommended (optional): Graphviz for visualising the design graph and Gnuplot for charts. The tool can generate output for both.
On MacOS with Homebrew:
brew install graphviz gnuplotThe examples are located in the Examples repository. Follow instructions how to run them in the documentation contained within the repository.
Detailed documentation can be found here: Command Line Tool documentation.
Command summary:
new: Create an empty design.info: Get information about the designlist: List design content objects.show: Describe an object.edit: Edit an object or a selection of objects.set: Set an attribute valueundo: Undo last changeredo: Redo undone changeadd: Create a new nodeconnect: Create a new connection (edge) between two nodesremove: Remove an object – a node or a connectionauto-parameters: Automatically connect parameter nodes: connect required, disconnect unusedlayout: Lay out objectsalign: Align objects on canvas
import: Import a frame into the design.run: Run the simulation and generate outputwrite-dot: Write a Graphviz DOT file.metamodel: Describe the metamodel (supports: text, markdown and HTML output)create-libraryCreate a library of multiple models.
Experimental commands:
experimental-export-svg: Export design as a SVG diagram. Requires pictograms from poietic-assets
Use --help with a desired command to learn more.
Developer's note: At the moment of writing this, I know how to include resources with a command-line tool in a Swift package. That is why the SVG feature is "experimental".
Think of this tool as ed but for data represented as a graph. At least for now.
The tool is designed in a way that it is by itself interactive for a single-user.
For interactivity in a shell, set the POIETIC_DESIGN environment variable to
point to a file where the design is stored.
Example session, creates a simple bank account model:
poietic new
poietic info
poietic edit add Stock name=account formula=100
poietic edit add Auxiliary name=rate formula=0.02
poietic edit add FlowRate name=interest formula="account * rate"
poietic edit connect Flow interest account
poietic edit connect Parameter rate interest
poietic edit connect Parameter account interest
poietic info
poietic list formulasRun the simulation:
poietic runMake some mistakes:
poietic edit add Stock name=unwanted formula=0
poietic list formulas
poietic edit undo
poietic list formulasIf you have Graphviz installed, then you can run the
following and then open the diagram.png image:
poietic write-dot --output diagram.dot -l name
dot -Tpng -odiagram.png diagram.dotDiscover more design possibilities by exploring the metamodel in a HTML file:
poietic metamodel -f html > metamodel.html
The above command will create a metamodel.html file with full description of
currently available metamodel for the given design.
- Preserved history – Editing is non-destructive, can be reversed using undo and redo commands.
- Exports to different formats:
- Stock, Flow, Auxiliary, Graphical function and more kinds of nodes. See Metamodel.
- Arithmetic expressions with built-in functions. See Formulas.
Underlying packages:
- Poietic Core: repository, documentation
- Poietic Flows: repository, documentation