Installing cfctl

cfctl is a powerful CLI (Command Line Interface) tool for controlling and managing SpaceONE services. It is designed to help you easily manage SpaceONE resources.

01. Installation via Homebrew (Recommended)

If you use Homebrew , you can install cfctl using Homebrew.


brew tap cloudforet-io/tap brew install cfctl

02. Manual Installation

Alternatively, you can manually install cfctl using the following commands for each operating system.

2.1. macOS

Intel Mac
wget "https://github.com/cloudforet-io/cfctl/releases/latest/download/cfctl_Darwin_x86_64.tar.gz"

tar xvf cfctl_Darwin_x86_64.tar.gz chmod +x cfctl mv cfctl /usr/local/bin/
Apple Silicon Mac
wget "https://github.com/cloudforet-io/cfctl/releases/latest/download/cfctl_Darwin_arm64.tar.gz"

tar xvf cfctl_Darwin_arm64.tar.gz chmod +x cfctl mv cfctl /usr/local/bin/

2.2. Linux

x86_64
wget "https://github.com/cloudforet-io/cfctl/releases/latest/download/cfctl_Linux_x86_64.tar.gz"

tar xvf cfctl_Linux_x86_64.tar.gz chmod +x cfctl mv cfctl /usr/local/bin/
ARM64
wget "https://github.com/cloudforet-io/cfctl/releases/latest/download/cfctl_Linux_arm64.tar.gz"

tar xvf cfctl_Linux_arm64.tar.gz chmod +x cfctl mv cfctl /usr/local/bin/

2.3. Docker

Using Docker, you can use cfctl without installing it directly in your local environment. However, since the process of creating and deleting containers is repeated each time, there may be some overhead in terms of execution speed and resource usage.

Download Container Image
docker pull cloudforet/cfctl:latest
Set Alias (Optional)
bash
echo 'alias cfctl="docker run --rm -it -v $HOME/.cfctl:/root/.cfctl cloudforet/cfctl:latest"' >> ~/.bashrc source ~/.bashrc
zsh
echo 'alias cfctl="docker run --rm -it -v $HOME/.cfctl:/root/.cfctl cloudforet/cfctl:latest"' >> ~/.zshrc source ~/.zshrc
fish
echo 'alias cfctl="docker run --rm -it -v $HOME/.cfctl:/root/.cfctl cloudforet/cfctl:latest"' >> ~/.config/fish/config.fish source ~/.config/fish/config.fish

2.4. Go

If you have Go installed, you can install cfctl using Go.

Step 1

Install Go 1.23+. Go Download

[Optional] Step 2

Set up Go environment variables.

  • bash or zsh
~/.bashrc or ~/.zshrc
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
  • fish
~/.config/fish/config.fish
set -gx GOPATH $HOME/go
set -gx GOBIN $HOME/go/bin
set -gx PATH $PATH /usr/local/go/bin (go env GOBIN)

Enter the source command for your shell or close and reopen your terminal.

Step 3

Install cfctl.


go install github.com/cloudforet-io/cfctl@latest

2.5. Windows

  1. Download the latest Windows version from the Releases page.
  2. Extract the ‘cfctl_Windows_x86_64.zip’ file.
  3. Add the extracted directory to your system’s PATH environment variable.
  4. Open PowerShell or Command Prompt to verify the installation.

03. Verify Installation

Run the following command to verify that cfctl is installed correctly.


cfctl
WARNING  No valid configuration found.
INFO  Please run 'cfctl setting init' to set up your configuration.
cfctl controls the SpaceONE services.
  Find more information at:
    - https://github.com/cloudforet-io/cfctl
    - https://docs.spaceone.megazone.io/developers/setup/cfctl (English)
    - https://docs.spaceone.megazone.io/ko/developers/setup/cfctl (Korean)

Usage:
  cfctl [command]

Available Commands:

Other Commands:
  alias         Manage command aliases
  api_resources Displays supported API resources
  apply         Apply a configuration to a resource using a file
  login         Login to SpaceONE
  setting       Manage cfctl setting file

Additional Commands:
  completion    Generate the autocompletion script for the specified shell
  help          Help about any command

Flags:
  -h, --help   help for cfctl

Use "cfctl [command] --help" for more information about a command.
  • Currently, a WARNING message is displayed because there is no configuration file.
  • In the next page, we’ll learn about the cfctl setting command and how to create a configuration file using the cfctl setting init command.