Unlink Command
The fastapi cloud unlink command removes the local FastAPI Cloud configuration from your project directory.
This is useful when you want to disconnect your local project from its cloud deployment, or when you need to start fresh with a new configuration.
fastapi cloud unlinkWhen successful, you’ll see:
FastAPI Cloud configuration has been unlinked successfully! 🚀What This Command Does
Section titled “What This Command Does”When you run fastapi cloud unlink, the CLI will delete the .fastapicloud directory from your current working directory.
This directory contains:
cloud.json- Your app ID and team ID mappingsREADME.md- Information about the configuration.gitignore- Git ignore rules for the config directory- Any other files in the configuration directory
All of these will be removed.
What Happens After Unlinking
Section titled “What Happens After Unlinking”After running fastapi cloud unlink:
- Your local project remains unchanged (source code, dependencies, etc.)
- The connection to your FastAPI Cloud deployment is removed
- You can run
fastapi deployto create a new deployment and establish a new link - Your existing deployment on FastAPI Cloud remains active and unchanged
- Environment variables and other cloud configurations are preserved on the cloud
Important Notes
Section titled “Important Notes”This command is a local operation only. It does not delete or modify your deployment on FastAPI Cloud.
Once unlinked, you cannot restore the .fastapicloud directory. You’ll need to redeploy to recreate it.
The command must be executed from the directory where your FastAPI Cloud configuration exists.
When to Use Unlink
Section titled “When to Use Unlink”You might want to unlink your project in these scenarios:
- Switching deployments - When you want to link your local project to a different FastAPI Cloud app
- Starting fresh - When you need to reconfigure your project’s cloud connection
- Cleaning up - When removing FastAPI Cloud from your project entirely
- Troubleshooting - When resolving configuration issues by starting with a clean slate
- Deleted app - When your app was deleted from the dashboard and you want to deploy as a new app
Relinking After Unlink
Section titled “Relinking After Unlink”To reconnect your project to FastAPI Cloud after unlinking, simply deploy your application again:
fastapi deployThis will create a new .fastapicloud directory and link your project to a deployment. You’ll be able to choose whether to create a new app or link to an existing one.
Unlink vs Logout
Section titled “Unlink vs Logout”It’s important to understand the difference:
fastapi cloud unlink- Removes the project-specific configuration only. You remain logged in and can deploy other projects.fastapi cloud logout- Removes your authentication credentials system-wide. You’ll need to log in again to deploy any project.
Troubleshooting
Section titled “Troubleshooting”Error: No FastAPI Cloud configuration found
Section titled “Error: No FastAPI Cloud configuration found”This means there’s no .fastapicloud directory in your current location. Make sure you’re running the command from the correct project directory.
Related Commands
Section titled “Related Commands”fastapi deploy- Deploy your app and create the.fastapicloudconfigurationfastapi cloud whoami- Check your current authentication statusfastapi cloud logout- Log out from FastAPI Cloud (removes global authentication)