CF Space Switcher
A VS Code extension for seamless and quick Cloud Foundry API, Target and Space switching.
⚠️ Prerequisites
CF CLI is mandatory - This extension requires the Cloud Foundry CLI to be installed and accessible.
Install CF CLI
🚀 Getting Started
- Install the extension
- Ensure CF CLI is installed on your system
- Open the CF Space Switcher view in the Activity Bar
- Configure your API endpoints and login (default API Endpoints for SAP BTP Cloud Foundry are ready to be preloaded)
✨ Features
Quick Login - Save your preferred default API, Target, and Space for instant login
You can see from the extension view your current target and space and switch to others of the same API Endpoint easily.

if you have a preferred API, Target, and Space that you frequently use, you can save them as your defaults. This allows you to log in quickly without having to specify them each time. And to log in with your default settings, simply use the 🚀 button in the extension view.

Status Bar Integration - View your current target and space at a glance
The status bar shows your current Cloud Foundry target and space for easy reference.

You can turn this feature on or off in the extension settings. By default, it is enabled.

Favorite API Endpoints - Mark frequently used endpoints as favorites for easy access
Easily mark and access your frequently used API endpoints by adding them to your favorites list.

You can manage your favorite endpoints in the extension settings. Either add your own or by default, the extension comes with preloaded popular SAP BTP Cloud Foundry API endpoints.

Import/Export Settings - Backup and share your configuration across machines
Applications - The apps of the targeted space, with start/stop/restart/restage, scale,
"open URL", environment, SSH, and recent or live logs in an output channel.
Expand an app to see its instances — state, uptime, memory against the quota, and the
crash reason — and restart a single stuck one without taking the app down.
Attach Debugger - On a running instance: opens a cf ssh tunnel to the debug port
inside that instance's container and attaches a Node.js or Java debug session to it.
The app has to be started with a debugger listening (NODE_OPTIONS=--inspect, or
JBP_CONFIG_DEBUG for Java). Sources are mapped from the open folder (you are asked which
one in a multi-root workspace) to /home/vcap/app; in a monorepo whose module lives in a
subfolder, breakpoints bind only if that subfolder is the one that is open.
If SSH is disabled, it says which of the three switches (deployment, space, app) is off and
offers to enable it — with the restart the change needs.
Services - The service instances of the targeted space and their service keys. Create,
show, copy or delete a key — or bind it straight into your project as a CAP hybrid binding
(.cdsrc-private.json, a reference only) or as default-env.json (VCAP_SERVICES).
Production guard - The status bar turns orange with a warning icon on a production
target, and switching there — or stopping, restarting, restaging, scaling an app,
restarting a single instance, opening a shell or a debugger into one, enabling SSH, or
deleting a service key in it — asks first. prod, production and prd count by
default, matched against the organization or the space, ignoring case; Mark Target as
Production adds anything else in one click.
Copy OAuth Token - A fresh access token for Postman, curl or a local approuter,
with its remaining validity.
Secure Credentials - Credentials are safely stored using VS Code Secure Storage
VS Code Settings - CMD+Shift+P -> CF Space Switcher: ...
🎈 Random Notes
I started it in December 2023 and left it unfinished! I picked it up again for selfish reasons (I actually wanted to use it 😄) and I was bored during my Christmas vacation because -> I had COVID 🦠
It fulfills my needs, I hope you find it useful, too! 🚀
Aykut Kafali
| |