Getting Started with XGraph
Getting started solving today’s complex environments is easy.
Getting started with XGraph is easy.
xGraph consists of the xGraph core architecture handles compiling, starting and communicating with systems in an xGraph ecosystem and the xGraph command line interface makes it easy to interact with xGraph. Soon we will have a visual editor to make it even easier.
Getting started, step-by-step
- Download the node package manager
- In your command line tool install xGraph globally
Npm install –g xgraph
If you are on a unix operating systems, such as macOS or Ubuntu use the sudo prefix
Sudo npm install –g xgraph
The xGraph command line interface accelerates the building and running of xGraph Systems. Using the xGraph CLI, you can generate new modules and systems, compile systems from a system structure object, and run systems from a system cache.
xGraph uses the following API commands, available in the xGraph CLI using xgraph help
xgraph help
Compile and Run xGraph systems with a few simple commands.
Unless otherwise specified, commands will look in the current working directory for a config.json file or cache directory, depending on the command.
If the system includes local module sources, these must be listed after
the command and options, [--source directory ...].
xGraph
Usage: xgraph [command] [options] [--source directory ...]
Command:
help h : Displays this help screen.
compile c : Generates a cache from a system
structure file (config.json).
deploy d : Run a system from the cache.
reset r : Run a system from system structure file, resetting the system's cache.
execute x : Run a system from the cache or compile and run the system if the cache does not exist.
generate <module|system> g <m|s> : Generate a new module or system from a template with the given name.
Options:
--cwd : Sets the current working directory for the command.
--config : Specifies a system's structure file.
--cache : Specifies a system's cache directory.
--allow-add-module : Enable a module to add new modules
in memory to the Module cache.
--loglevelsilent --silent : Block all logs from appearing in the console window. Logs will still be printed to the log file.
--loglevelverbose --verbose : Allows verbose logs to be printed to the console window.
--logleveldebug : Allows the verbose logs and the debug
logs to be printed to the console window.
Examples:
Compile the system in the current directory.
xgraph compile
Deploy a module from a system structure file.
xgraph deploy --config ./ExampleSystems/HelloWorld/config.json
Reset a system in a different working directory with an external source.
xgraph reset --cwd ./MultipleSystemsTemplate/Systems/Plexus/ --xGraph ../xGraph
Generate a new module called MyFirstModule.
xgraph generate module MyFirstModule