Reference
MAF CLI is a tool for developing MAF servers and interfacing with MAF Platform.
You can install MAF CLI using Cargo:
# Install Rust and Cargo: https://rust-lang.org/tools/install/
# Then run:
$ cargo install --git https://github.com/giilbert/maf.git maf_cli
You may want to alias maf_cli to maf for convenience:
# In your shell configuration file (e.g., .bashrc, .zshrc):
$ alias maf="maf_cli"
The rest of this reference will refer to the CLI as maf (if you choose not to alias it, just replace maf with maf_cli in the commands).
MAF CLI uses three layers of configuration:
The help for these commands can be viewed by running maf help or maf <command> --help.
Lists all applications deployed to the MAF Platform. To use this command, the Platform server should be configured and you should be authenticated (see maf auth commands).
Usage
$ maf app list
Interactively creates a new application on the MAF Platform.
Usage
$ maf app create
Fetches the MAF Platform credentials for a specific application.
Usage
# [1] Fetch credentials for the current project's app
$ maf app credentials
# [2] Fetch credentials for a specific app by name
$ maf app credentials [name]
If no name is provided, the command will attempt to read the maf-project.toml file in the current directory to determine the app name.
Displays detailed information about a specific application on the MAF Platform.
Usage
# [1] View the current project's app
$ maf app view
# [2] View a specific app by name
$ maf app view [name]
If no name is provided, the command will attempt to read the maf-project.toml file in the current directory to determine the app name.
Deploys an application to the MAF Platform.
Usage
# [1] Deploy the current project
$ maf app deploy
# [2] Deploy a specific WASM module to a named app
$ maf app deploy [name] [wasm_module_path]
With no arguments, deploys the current project (the directory where the command is run) to the MAF Platform. The project must contain a valid maf-project.toml file. If the project has not been deployed before, a new application will be created on the Platform. If it has been deployed before, the existing application will be updated.
If you provide a name and a path to a WASM module, deploys that module to the specified application on the MAF Platform.
Interactively authenticates the MAF CLI with the MAF Platform using an authentication token. NOTE: Platform is in private testing and this command should only be used for authorized users.
The token will be stored in the global configuration file for future use.
Usage
$ maf auth login
Clears the stored authentication token, effectively logging out of the MAF Platform.
Usage
$ maf auth logout
Displays the current authentication status, including whether you are logged in and which server you are using.
Usage
$ maf auth status
Displays the current MAF CLI configuration, including server URL and token status.
Usage
$ maf config show
Sets a configuration option in the MAF CLI configuration file. You can set the server URL or authentication token.
Usage
# [1] Set the server URL
$ maf config set server_url [url]
# [2] Set the authentication token
$ maf config set token [token]
Resets a configuration option to its default value by removing it from the configuration file.
Usage
# [1] Reset the server URL
$ maf config reset server_url
# [2] Reset the authentication token
$ maf config reset token
Builds the code and runs the MAF development server for a project.
Usage
# [1] Run the development server in the current project directory
$ maf run
# [2] Run the development server given a specific WASM module file
$ maf run [wasm_module_path]
Flags
Initializes a new MAF project in the current directory by creating a maf-project.toml file and setting up the necessary project structure.
NOTE: This command does not create a directory to contain the project; it initializes the project in the current working directory.
NOTE: This command does not install any toolchain dependencies (like Rust or Cargo). You must have the necessary toolchain installed separately.
Usage
$ maf init
Flags
Like maf init, but creates a new directory for the project.
Usage
# [1] Create a new MAF project in an interactive prompt
$ maf create
# [2] Create a new MAF project with a specified name
$ maf create [project_name?]
Flags