A command-line interface for creating simulations on AeroCloud and ArchiWind.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/nablaflow/cli/releases/download/v1.2.0/nf-installer.sh | shpowershell -ExecutionPolicy Bypass -c "irm https://github.com/nablaflow/cli/releases/download/v1.2.0/nf-installer.ps1 | iex"Can be run directly using
cachix use nablaflow-public
nix run github:nablaflow/cli/v1.2.0After installing the CLI, open the terminal and run the nf -V command to verify it's correctly installed.
In order to use the CLI, a personal access token is required. Head to your AeroCloud API settings page and generate one with read and write permissions. The token should never be shared; keep it safe because it grants access to your account data.
Configure the CLI with the generated token by running:
nf aerocloud set-auth-token $TOKENCommands below use v7 to target the AeroCloud API version.
To list the existing projects:
nf aerocloud v7 list-projectsTo create a new project:
nf aerocloud v7 create-project "project name"To create a model, start by defining a JSON manifest for it, see examples/aerocloud/v7/create_model.json as starting point.
Then run:
nf aerocloud v7 create-model $PATH_TO_JSONTo create a simulation you need:
- a target project
- an input model
Follow the instructions in the previous steps to create both, note down project ID and model ID.
Then define a JSON manifest for it, see examples/aerocloud/v7/create_simulation.json as starting point.
Then run:
nf aerocloud v7 create-simulation --model-id $MODEL_ID --project-id $PROJECT_ID $PATH_TO_JSONTip
All commands accept --json after nf to output JSON instead of human readable text, so that the CLI can be comfortably used in scripts.
Tip
Use --help on every subcommand to see their documentation.
Tip
All commands that consume a JSON from a path also accept JSON from stdin, be sure to pass - instead of the file.
This facilitates usage from scripts.
The CLI can be used in batch mode to create multiple simulations at once.
First, prepare a folder with the JSON manifests for your simulation and the models to upload. Use the following structure as an example:
dir
├── simulation-1 # `simulation-1` is going to be the name of the simulation.
│ ├── model-1.stl # `model` can be any valid UTF-8 filename.
│ ├── model-1.json # Provides additional params on the `.stl` above (unit, parts, ...). *File names must match!*
│ ├── model-2.obj
│ ├── model-2.json
│ ├── params.json # Simulation params.
└── simulation-2
├── donut-with-parts.json
├── donut-with-parts.obj
├── params.json
An example is available under examples/aerocloud/v7/batch.
Tip
You can skip uploading files and use a reusable model by just setting its ID in each simulation's params.json:
{
"model_id": "b7203095-f9fd-4270-ac6d-03c46b02932b",
...
}With the folder ready, run the following command to enter the Batch mode:
nf aerocloud v7 batch $directoryAn interactive UI will be started where you can review and submit your simulations.
Follow the instructions and available commands at the bottom of the user interface.
Tip
When submitting simulations, stuff can go wrong: network timeouts, invalid parameters and such.
Each successfully submitted simulation will be marked as such and won't be resent, while allowing you to make changes to JSON files and reload them.