fmu-settings-cli is the CLI package for fmu-settings.
To launch the application simply run
fmu settingsTo start only the API, run
fmu settings apiIt is also possible to specify the port and if the API should be reloaded, as in during development.
fmu settings api --port 8001By default the API will set CORS rules restricting requests to a default host
and port (localhost:8000). In development with a GUI it's likely your
frontend port will be something different. You can specify this like so:
fmu settings api --gui-port 5173This will update the CORS rules in the API to accept requests from
localhost:5173.
The API authorizes all requests with a randomly generated token. When starting
the API for use in development this token can be printed by setting the
FMU_SETTINGS_PRINT_TOKEN environment variable or providing the --print-token
flag.
fmu settings api --gui-port 5173 --print-token
# or
export FMU_SETTINGS_PRINT_TOKEN=true
# or
FMU_SETTINGS_PRINT_TOKEN=true fmu-settings api --gui-port 5173It's also possible to print the full URL a user would be directed to with a similar URL flag and environment variable.
fmu settings api --gui-port 5173 --print-url
# or
export FMU_SETTINGS_PRINT_URL=true
# or
FMU_SETTINGS_PRINT_URL=true fmu-settings api --gui-port 5173Note that these additional flags are intended for development so they only work
with fmu settings api subcommand.
You can similarly start the GUI server:
fmu settings guiClone and install into a virtual environment.
git clone git@github.com:equinor/fmu-settings-cli.git
cd fmu-settings-cli
# Create or source virtual/Komodo env
pip install -U pip
pip install -e ".[dev]"
# Make a feature branch for your changes
git checkout -b some-feature-branchRun the tests with
pytest -n auto testsEnsure your changes will pass the various linters before making a pull request. It is expected that all code will be typed and validated with mypy.
ruff check
ruff format --check
mypy src testsSee the contributing document for more.