A command-line tool for managing TEE deployments on Phala Network, from local development to cloud deployment.
- Docker installed and running
- Bun installed
- Docker Hub account for publishing images
- Phala Cloud API key
# Install dependencies
bun install
# Build
bun run build
Test your application in a local TEE environment:
teecloud simulator
The simulator will be available at http://localhost:8090.
teecloud build \
-i, --image <name> \ # Required: Docker image name
-u, --username <name> \ # Required: Docker Hub username
-f, --dockerfile <path> \ # Required: Path to Dockerfile
-t, --tag <tag> # Required: Tag for the Docker image
Generate a compose file:
teecloud build-compose \
-i, --image <name> \ # Required: Docker image name
-u, --username <name> \ # Required: Docker Hub username
-t, --tag <tag> \ # Required: Tag for the Docker image
-e, --env-file <path> \ # Required: Path to environment file
-v, --version <version> # Optional: Version of compose template (default: 'basic')
Run locally:
teecloud run-local \
-c, --compose <path> \ # Required: Path to docker-compose file
-e, --env-file <path> # Required: Path to environment file
The CLI stores generated compose files in:
.tee-cloud/
└── compose-files/ # Generated docker-compose files
└── tee-compose.yaml
teecloud set-apikey your-phala-cloud-api-key
teecloud publish \
-i, --image <name> \ # Required: Docker image name
-u, --username <name> \ # Required: Docker Hub username
-t, --tag <tag> # Required: Tag of the Docker image
teecloud deploy \
-t, --type <type> \ # Optional: TEE vendor type (default: "phala")
-m, --mode <mode> \ # Optional: Deployment mode (default: "docker-compose")
-n, --name <name> \ # Required: Name of docker image
-c, --compose <path> \ # Required: Docker compose file path
-e, --env <KEY=VALUE...> \ # Optional: Environment variables
--env-file <path> \ # Optional: Environment file path
--debug # Optional: Enable debug mode
List available tags:
teecloud list-tags \
-i, --image <name> \ # Required: Docker image name
-u, --username <name> # Required: Docker Hub username
List TEE pods:
teecloud teepods \
[--status <active|inactive>] \ # Optional: filter by status
[--region <region-name>] # Optional: filter by region
View deployed images:
teecloud images \
--teepod-id <id> # Required: ID of the teepod
Upgrade deployment:
teecloud upgrade \
-t, --type <type> \ # Optional: TEE vendor type (default: "phala")
-m, --mode <mode> \ # Optional: Deployment mode (default: "docker-compose")
--app-id <id> \ # Required: Application ID
-c, --compose <path> \ # Required: Docker compose file path
-e, --env <KEY=VALUE...> \ # Optional: Environment variables
--env-file <path> # Optional: Environment file path
List your TEE pods:
teecloud teepods
List running CVMs:
teecloud list-cvms
View deployed images:
teecloud images
Upgrade an existing deployment:
teecloud upgrade \
--tag v1.0.1 \
--username your-dockerhub-username
The CLI provides several templates for different use cases:
-
basic
: Simple template for general applicationsteecloud run-local --template basic
-
eliza-v2
: Modern template with Bun runtimeteecloud run-local --template eliza-v2
-
eliza-v1
: Legacy template with character file supportteecloud run-local --template eliza-v1
Common issues and solutions:
-
Docker Build Fails
- Verify Docker daemon is running
- Check Dockerfile path
- Ensure proper permissions
-
Simulator Issues
- Check if port 8090 is available
- Verify Docker permissions
-
Cloud Deployment Fails
- Validate API key
- Confirm image exists on Docker Hub
- Check environment variables
For detailed help:
teecloud --help
teecloud <command> --help
To contribute or run in development mode:
bun run src/index.ts
The project uses:
- Bun for runtime and package management
- TypeScript for type safety
- Commander.js for CLI interface
- Zod for runtime validation
tbd