Creating an extension
The best way to get started with writing your own Phylum CLI extension, is to
generate an extension skeleton using the
phylum extension new subcommand.
my-extension as an example in this guide:
phylum extension new my-extension
Once finished, we should find a new directory called
my-extension in our
current working directory, containing the files
Extensions always contain at least two files, the manifest describing the
PhylumExt.toml), and the entrypoint where the extension's execution
will begin. Any additional source files can be included in the extension
directory and imported from the entrypoint.
The manifest file contains metadata about the extension beyond its executable
source code. All available options can be found in the manifest format.
Since the generated extension skeleton is a fully functional extension, we can
go ahead and install it right away:
phylum extension install ./my-extension
Once successfully installed, our extension can be executed by using its name as
a subcommand for the phylum CLI:
$ phylum my-extension Hello, World!
Hello, World! message confirms that our extension is working correctly.
Updated 10 months ago