Namespaces and the CloudZero Sidebar

The CostFormation Toolkit includes a dedicated CloudZero Sidebar and a namespace system for organizing your CostFormation definitions into logical groups. Namespaces allow teams to manage their own sets of definitions independently, and the sidebar provides a visual interface for browsing and interacting with them.

What are namespaces?

Namespaces are organizational containers for your CostFormation definitions. Each namespace holds a separate collection of definition files and has its own version history.

Every organization has a built-in default namespace called User:Defined. This namespace contains the definitions that were previously managed as a single global set in earlier versions of the Toolkit. You can also create additional namespaces to organize definitions by team, project, or any other grouping that fits your workflow.

Namespace names always begin with the User: prefix. For example:

  • User:Defined (default, always present)
  • User:TeamAlpha
  • User:Billing
  • User:Infrastructure
ℹ️

Operations such as downloading, publishing, reviewing, and restoring definitions now apply to a specific namespace rather than to all definitions globally.

The CloudZero Sidebar

After you authenticate with the CloudZero platform, a CloudZero icon appears in the VS Code Activity Bar (the vertical icon bar on the far left). Click this icon to open the CloudZero Sidebar, which contains two views:

  • Organization — Displays the name of the CloudZero organization you are currently connected to. Click the organization name to switch to a different organization.
  • Namespaces — Lists all namespaces in your organization. You can expand each namespace to see its definition files, and right-click for additional actions.
CloudZero sidebar showing Organization and Namespaces views

View and browse namespaces

The Namespaces view in the sidebar lists all namespaces in your organization. To explore a namespace:

  1. Click the expand arrow next to a namespace name to see its CostFormation definition files.
  2. Click a definition file to view its metadata, such as version and last-modified date.
A namespace expanded showing its definition file

You can also browse all namespaces using the command palette. Open the command palette (⇧⌘P/Ctrl-Shift-P) and select CloudZero Namespaces: Browse All to see a searchable list of all namespaces.

To refresh the namespace list, click the refresh icon in the Namespaces view header, or run CloudZero Namespaces: Refresh Namespaces from the command palette.

Create a new namespace

To create a new namespace:

  1. In the Namespaces view, click the + (plus) button in the view header, or open the command palette and select CloudZero Namespaces: New Namespace.
  2. Enter a name for your namespace. The User: prefix is required and will be prepended automatically if you do not include it.
Namespace name input prompt

After the namespace is created, it appears in the Namespaces view and is ready for use.

Download namespace definitions

To download definitions from a specific namespace:

From the sidebar:

  1. In the Namespaces view, right-click the namespace you want to download from.
  2. Select Download CostFormation from the context menu.
  3. Choose a location and filename in the Save dialog that appears.
Right-click context menu on a namespace

From the command palette:

  1. Open the command palette (⇧⌘P/Ctrl-Shift-P) and select CloudZero: Download CostFormation.
  2. If your organization has multiple namespaces, a quick-pick list appears. Select the namespace you want to download from.
  3. Choose a location and filename in the Save dialog.
Namespace selection quick-pick when downloading
ℹ️

The file extension must be .cz.yaml. If you do not specify an extension, .cz.yaml is automatically appended to the filename.

Delete a namespace

To delete a namespace, right-click the namespace in the Namespaces view and select Remove Namespace. You can also run CloudZero Namespaces: Remove Namespace from the command palette.

⚠️

The default User:Defined namespace cannot be deleted.

Switch organizations

If you have access to multiple CloudZero organizations, you can switch between them without re-authenticating.

From the sidebar: Click the organization name in the Organization view at the top of the CloudZero Sidebar. A quick-pick list of your available organizations appears. Select the organization you want to switch to.

From the command palette: Open the command palette (⇧⌘P/Ctrl-Shift-P) and select CloudZero: Switch Organization.

Switch Organization command

After switching organizations, the Namespaces view refreshes to show the namespaces for the newly selected organization.