Using the Fn Project CLI with OCI Functions
Find out how to use the Fn Project CLI with OCI Functions.
OCI Functions is powered by the Fn Project open source engine. As a result, you can use the Fn Project CLI to perform create, read, update, and delete operations on OCI Functions. Supported commands and options depend on the Fn Project CLI version that you're using.
Code-only function commands and options require a version of the Fn Project CLI that supports code-only functions. To confirm whether your installed version supports code-only functions, run fn --help or fn <command> --help, and see Creating Functions from Archives (Code-only Functions) for supported code-only function command examples.
To enable you to use the Fn Project CLI with OCI Functions, you perform a number of preparatory tasks. For image-based function workflows, see Functions QuickStart Guides and Client Environment Configuration Notes for OCI Functions.
Most Fn Project CLI commands have a similar syntax:
fn [global options] <command> [command options] [subcommands] [arguments]
For example, to:
- list all the available applications, use the
command:
fn list apps - create an application, use a command like:
fn create app acmeapp --subnet-id ocid1.subnet.oc1.phx.aaaaaaaacnh... - invoke a function, use a command
like:
fn invoke helloworld-app helloworld-func - change the profile that the Fn Project CLI uses for
its context, use a command
like:
fn update context oracle.profile john-oci-profile
To see a complete list of Fn Project CLI commands, you can:
- Log in to your development environment as a functions developer and enter
fn --helporfn -hin a terminal window. - In a web browser, go to the Fn Project CLI documentation.
To see detailed information about individual Fn Project CLI commands, you can:
- Log in to your development environment as a functions developer and enter
fn <command> [subcommand] --helporfn <command> [subcommand] -hin a terminal window. For example:fn create --helpfn update app -h - In a web browser, go to the Fn Project CLI documentation and select the command from the list.
From time to time, new versions of the Fn Project CLI are released. See Upgrading the Fn Project CLI.