The Octopus CLI (octopus
) is a command line tool that interacts with the Octopus Deploy REST API and includes packaging commands to create packages either as Zip or NuGet packages for deployment with Octopus.
Installation
The Octopus CLI downloads page provides installation options for various platforms.
After installation, you can run the following to verify the version of the Octopus CLI that was installed (if you’re using Windows, remember to open a new command prompt):
octopus --version
For more installation details, options, and update instructions, see The Octopus CLI Global Tool.
For a full list of the package
command options see Octopus CLI - Package or run the following command:
octopus package --help
Usage
The Octopus CLI supports two package formats: NuGet packages and ZIP packages
Configuration Options
Both NuGet and ZIP packaging commands support the following configuration options:
- —id: The ID of the package
- —version: The version of the package, must be a valid SemVer
- —base-path: Root folder containing the contents to zip
- —out-folder: Folder into which the zip file will be written
- —include: Add a file pattern to include, relative to the base path e.g. /bin/*.dll; defaults to ”**”
- —verbose: Verbose output
- —overwrite: Allow an existing package file of the same ID/version to be overwritten
Additional NuGet-specific options:
- —author: Add author/s to the package metadata
- —title: The title of the package
- —description: A description of the package, defaults to “A deployment package created from files on disk.”
- —releaseNotes: Release notes for this version of the package
- —releaseNotesFile: A file containing release notes for this version of the package
Create NuGet packages
Basic usage:
octopus package nuget create
Create ZIP packages
Basic usage:
octopus package zip create
Packaging a .NET Core application
To package a .NET core application, first publish the application, and then call octopus package
on the output folder for example:
dotnet publish ./OctoWeb.csproj --output ./dist
octopus package zip create --id="OctoWeb" --version="1.0.0" --base-path="./dist"
Please refer to Microsoft’s publish and packing documentation for more information.
Packaging a .NET Core library
If you are using .NET Core for class libraries, we recommend using dotnet pack from Microsoft.
dotnet pack ./SomeLibrary.csproj --output ./dist
octopus package zip create --id="SomeLibrary" --version="1.0.0" --base-path="./dist"
Packaging a .NET Framework web application
There are usually some extra steps required to get the resulting application built and deployable. Full framework web applications are a good example of this, where simply building the application will not give you the desired output. We still recommend Octopack for these cases. However, you may be able to achieve this using msbuild parameters such as:
msbuild ./OctoWeb.csproj /p:DeployDefaultTarget=WebPublish /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:SkipInvalidConfigurations=true /p:publishUrl=dist
octopus package zip create --id="OctoWeb" --version="1.0.0-alpha0001" --base-path="./dist"
Packaging your application from a folder
If you have a build process that places all build outputs into a final destination folder (such as gulp, grunt, or webpack), you can package it using the Octopus CLI as well. For example, if you’ve defined an npm script which runs your build and places all associated content into the dist
folder:
npm run build
octopus package zip create --id="OctoWeb" --version="1.0.0" --base-path="./dist"
Known issues with other compression libraries
These are known issues to be aware of with other compression libraries:
- Atlassian Bamboo users who are using Adam Myatt’s Zip File Task and are extracting to a Linux machine may find that the contents don’t get extracted into the correct folder structure but instead flattened with the path as the file name. This is the result of a known issue whereby the task does not confirm to the correct PKWARE ZIP §4.4.17.1 specifications and is using a back slash instead of forward slash as the file separator. We would recommend avoiding this task where possible.
- Prior to the .NET framework 4.6.1, the System.IO.Compression library incorrectly preserved the windows-style back slash separator for file paths. This has since been fixed from .NET Framework 4.6.1 and the fix carried over into .NET Core.
- The PKZIP specification requires that Zip files only need to store dates in the internal file headers with two bytes in the MS-DOS format (whereas tar file headers are stored in UNIX epoch format). This means that unless the compression library makes use of extra fields in the file headers, that a file compressed at some point in time on a machine in one timezone, may result in misleading dates when uncompressed in a different timezone.
Learn more
- Packaging application
- Create packages with Octopack.
- TeamCity plugin.
- Azure DevOps plugin.
- Package repositories.
- Package deployments.
Help us continuously improve
Please let us know if you have any feedback about this page.
Page updated on Tuesday, July 15, 2025