Basic usage
Thewriter cloud command group includes the following commands:
deployundeploylogs
Common options
These options are common across multiple commands:--api-key: The Writer API key used for authentication. If not provided, you will be prompted to enter it.--verbose, -v: Enable verbose output.
Commands
writer cloud deploy
writer cloud deploy
Deploys an app from the specified path to the Writer cloud.Usage:Arguments:Description:
PATH: The path to the folder containing the app to deploy.
--api-key: Writer API key for authentication. If not provided, you will be prompted to enter it.--env, -e: Environment variables to set in the deployed app. Use the formatVAR=value. Multiple environment variables can be specified by repeating the--envoption.--verbose, -v: Enable verbose output.
- Deploys the app located in the
PATHfolder. - Creates a deployment package, ignoring
.gitdirectories,Dockerfiles and all files specified in.gitignorefile. - Uploads the package to the deployment server.
- The deployed app will have access to specified environment variables.
- By default, the
WRITER_API_KEYenvironment variable will be added to enable AI features.
writer cloud undeploy
writer cloud undeploy
Stops the deployed app and makes it unavailable.Usage:Options:Description:
--api-key: Writer API key for authentication. If not provided, you will be prompted to enter it.--verbose, -v: Enable verbose output.
- Stops and removes the deployed app from the Writer cloud.
writer cloud logs
writer cloud logs
Fetches logs from the deployed app.Usage:Options:Description:
--api-key: Writer API key for authentication. If not provided, you will be prompted to enter it.--verbose, -v: Enable verbose output.
- Continuously fetches and displays logs from the deployed app.
- Logs are ordered by date and time.
Environment variables
When deploying an app, you can specify environment variables that will be available to the app during runtime. Use the--env option to pass these variables.
DB_HOST and DB_PORT will be available to the app as environment variables.
API key
TheWRITER_API_KEY is crucial for deploying and managing apps. It is used for authenticating requests to the Writer cloud. If not provided as an option, the CLI will prompt you to enter it. The WRITER_API_KEY will also be added to the deployed app’s environment to enable AI features of the Writer framework.
Deployment process
1
Package Creation
The CLI packages the app, excluding certain files (e.g., Dockerfile,
service_entrypoint.py).2
Upload Package
The package is uploaded to the Writer deployment server.
3
Build and Deploy
The server builds and deploys the app, making it accessible via a URL.
4
Environment Variables
Specified environment variables are set, and
WRITER_API_KEY is added by default.Example workflow
1
Deploying an App
2
Fetching Logs
3
Undeploying an App