MacOS installation:
brew update && brew install fnor
Alternatively for Linux/Unix/MacOS:
curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh- See the Fn Quickstart for sample commands.
- Detailed installation instructions.
- Configure your CLI Context.
- For a list of commands see Fn CLI Command Guide and Reference.
- For general information see Fn docs and tutorials.
Fn CLI now supports additional OCI Functions settings for:
- Provisioned concurrency via
--provisioned-concurrency - Detached / long-running functions via:
--detached-timeout--on-success--on-failure--clear-on-success--clear-on-failure
These OCI Functions settings can be used through multiple Fn CLI workflows:
fn initto scaffold and persist them infunc.yamlfn create function/fn update functionto apply them directly from the CLIfn deployto apply values persisted infunc.yaml
Initialize a function with provisioned concurrency:
fn init --runtime go --provisioned-concurrency constant:40 helloCreate a function with provisioned concurrency directly:
fn create function <app-name> <function-name> <image> \
--provisioned-concurrency constant:40Update a function with provisioned concurrency directly:
fn update function <app-name> <function-name> \
--provisioned-concurrency constant:40Initialize a function for detached mode with OCI destinations:
fn init --runtime go \
--detached-timeout 20m \
--on-success stream:<stream-ocid> \
--on-failure notifications:<topic-ocid> \
helloCreate a function with detached-mode settings directly:
fn create function <app-name> <function-name> <image> \
--detached-timeout 20m \
--on-success stream:<stream-ocid> \
--on-failure notifications:<topic-ocid>Update a function with detached-mode settings directly:
fn update function <app-name> <function-name> \
--detached-timeout 20m \
--on-success stream:<stream-ocid> \
--on-failure notifications:<topic-ocid>Example func.yaml output:
deploy:
oci:
provisionedConcurrency:
strategy: CONSTANT
count: 40
detachedMode:
timeout: 20m
onSuccess:
type: stream
ocid: <stream-ocid>
onFailure:
type: notifications
ocid: <topic-ocid>When these OCI-specific flags are used with a non-Oracle provider or local Fn server workflows, Fn CLI accepts them and emits user-friendly warnings where the settings are not applicable.
Invoke a function in detached mode:
fn invoke detached <app-name> <function-name> --display-call-idEquivalent OCI-style invoke flag:
fn invoke <app-name> <function-name> --fn-invoke-type detached --display-call-idInvoke with an intent header:
fn invoke detached <app-name> <function-name> --fn-intent cloudevent --display-call-idInvoke as a dry run:
fn invoke detached <app-name> <function-name> --is-dry-run --output jsonFor OCI Functions, detached invocation typically returns immediately and, when requested, prints a call ID that can be used for correlation with downstream success/failure destinations.
- Refer to the Fn CLI Wiki for development details.
To watch a directory and automatically redeploy to a local Fn server when files change:
fn watch --app <app>This watches the current directory recursively and triggers:
fn deploy --app <app> --localfn watch ignores these directories by default:
.git,.fn,node_modules,target,dist,vendor,Dockerfile-fn-tmp*
You can add more ignore rules by creating a .fnignore file in the watched directory (one pattern per line; # comments supported), and/or by passing --ignore flags.
See CONTRIBUTING for instructions to build the CLI from source.