-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
3,614 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# No configuration needed for SQLite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
components | ||
dist | ||
.turbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
# TEE CLI | ||
|
||
The TEE CLI provides a set of commands to manage your ElizaOS TEE deployments, from local development to cloud deployment. | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
- Docker installed and running | ||
- Node.js and npm/pnpm installed | ||
- A Docker Hub account for publishing images | ||
- A Phala Cloud (https://cloud.phala.network/login) API key for cloud deployments | ||
|
||
## Commands | ||
|
||
### Building Your Image | ||
|
||
Build your Docker image locally: | ||
|
||
```bash | ||
elizaos tee phala build \ | ||
-i your-image-name \ | ||
-u your-dockerhub-username \ | ||
-f path/to/Dockerfile \ | ||
-t tag-name | ||
``` | ||
|
||
### Running the TEE Simulator | ||
|
||
Start the local TEE simulator for testing: | ||
|
||
```bash | ||
elizaos tee phala simulator | ||
``` | ||
This will start the simulator on http://localhost:8090. | ||
|
||
### Local Development | ||
|
||
You can develop your agent locally in two ways: | ||
|
||
1. Build the docker-compose file separately: | ||
```bash | ||
elizaos tee phala build-compose \ | ||
-i your-image-name \ | ||
-u your-dockerhub-username \ | ||
-t tag-name \ | ||
-c path/to/character.json \ | ||
-e path/to/.env \ | ||
-v v2 # or v1 for legacy mode | ||
``` | ||
|
||
2. Run an existing compose file: | ||
```bash | ||
elizaos tee phala run-local \ | ||
-c path/to/docker-compose.yml \ | ||
-e path/to/.env | ||
``` | ||
|
||
This separation allows you to: | ||
- Build compose files without running them immediately | ||
- Version control your compose files | ||
- Share compose files with team members | ||
- Run the same compose file multiple times | ||
|
||
The CLI will store generated compose files in: | ||
``` | ||
.tee-cloud/ | ||
└── compose-files/ # Generated docker-compose files | ||
└── your-character-tee-compose.yaml | ||
``` | ||
|
||
### Publishing Your Image | ||
|
||
Push your built image to Docker Hub: | ||
|
||
```bash | ||
elizaos tee phala publish \ | ||
-i your-image-name \ | ||
-u your-dockerhub-username \ | ||
-t tag-name | ||
``` | ||
|
||
### List Available Tags | ||
|
||
View all tags for your image on Docker Hub: | ||
|
||
```bash | ||
elizaos tee phala list-tags \ | ||
-i your-image-name \ | ||
-u your-dockerhub-username | ||
``` | ||
|
||
### Cloud Deployment | ||
|
||
First, set your Phala Cloud API key: | ||
|
||
```bash | ||
elizaos tee phala set-apikey your-api-key | ||
``` | ||
|
||
Deploy to Phala Cloud: | ||
|
||
```bash | ||
elizaos tee phala deploy \ | ||
-t phala \ | ||
-m docker-compose \ | ||
-n your-deployment-name \ | ||
-c path/to/docker-compose.yml \ | ||
--env-file path/to/.env | ||
``` | ||
|
||
### Managing Cloud Deployments | ||
|
||
List your active agents (CVMs): | ||
|
||
```bash | ||
elizaos tee phala list-cvms | ||
``` | ||
|
||
List your TEE pods: | ||
```bash | ||
elizaos tee phala teepods | ||
``` | ||
|
||
List images in a specific TEE pod: | ||
```bash | ||
elizaos tee phala images --teepod-id your-teepod-id | ||
``` | ||
|
||
Upgrade an existing deployment: | ||
```bash | ||
elizaos tee phala upgrade \ | ||
-t phala \ | ||
-m docker-compose \ | ||
--app-id your-app-id \ | ||
-c path/to/docker-compose.yml \ | ||
--env-file path/to/.env | ||
``` | ||
|
||
## Directory Structure | ||
|
||
The CLI will create the following directory structure: | ||
``` | ||
.tee-cloud/ | ||
└── compose-files/ # Generated docker-compose files | ||
``` | ||
|
||
## Environment Variables | ||
|
||
Create a .env file with your required variables: | ||
|
||
```env | ||
ANTHROPIC_API_KEY=your_key | ||
TELEGRAM_BOT_TOKEN=your_token | ||
# Add other required variables | ||
``` | ||
|
||
## Tips | ||
|
||
- Use the simulator for local testing before cloud deployment | ||
- Always test your image locally with `run-local` before publishing | ||
- Keep your API keys secure and never commit them to version control | ||
- Use the `--help` flag with any command for detailed usage information | ||
|
||
## Troubleshooting | ||
|
||
Common issues and solutions: | ||
|
||
1. **Docker Build Fails** | ||
- Ensure Docker daemon is running | ||
- Check Dockerfile path is correct | ||
- Verify you have necessary permissions | ||
|
||
2. **Simulator Connection Issues** | ||
- Check if port 8090 is available | ||
- Ensure Docker has necessary permissions | ||
|
||
3. **Cloud Deployment Fails** | ||
- Verify API key is set correctly | ||
- Check if image exists on Docker Hub | ||
- Ensure environment variables are properly set | ||
|
||
For more help, use the `--help` flag with any command: | ||
|
||
```bash | ||
elizaos tee phala --help | ||
elizaos tee phala <command> --help | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"name": "@elizaos/cli", | ||
"version": "0.2.0-alpha.1", | ||
"description": "Add components to your apps.", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"license": "MIT", | ||
"author": { | ||
"name": "elizaOS", | ||
"url": "https://twitter.com/eliza_OS" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elizaOS/eliza.git", | ||
"directory": "packages/cli" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"keywords": [], | ||
"type": "module", | ||
"exports": "./dist/index.js", | ||
"bin": { | ||
"elizaos": "./dist/index.js" | ||
}, | ||
"scripts": { | ||
"cli": "tsup src/index.ts --watch --onSuccess \"node dist/index.js\"", | ||
"build": "tsup", | ||
"typecheck": "tsc --noEmit", | ||
"clean": "rimraf dist && rimraf components", | ||
"start:dev": "cross-env COMPONENTS_REGISTRY_URL=http://localhost:3003 node dist/index.js", | ||
"start": "node dist/index.js", | ||
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache", | ||
"release": "changeset version", | ||
"pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta", | ||
"pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next", | ||
"pub:release": "pnpm build && pnpm publish --access public", | ||
"test": "vitest run", | ||
"test:dev": "REGISTRY_URL=http://localhost:3333 vitest run" | ||
}, | ||
"dependencies": { | ||
"@antfu/ni": "^0.21.4", | ||
"@babel/core": "^7.22.1", | ||
"@babel/parser": "^7.22.6", | ||
"@babel/plugin-transform-typescript": "^7.22.5", | ||
"@noble/curves": "^1.8.1", | ||
"axios": "^1.7.9", | ||
"crypto": "^1.0.1", | ||
"chalk": "5.2.0", | ||
"commander": "^10.0.0", | ||
"cosmiconfig": "^8.1.3", | ||
"diff": "^5.1.0", | ||
"@elizaos/core": "*:workspace", | ||
"execa": "^7.0.0", | ||
"fast-glob": "^3.3.2", | ||
"fs-extra": "^11.1.0", | ||
"https-proxy-agent": "^6.2.0", | ||
"lodash": "^4.17.21", | ||
"node-fetch": "^3.3.0", | ||
"ora": "^6.1.2", | ||
"papaparse": "^5.5.1", | ||
"prompts": "^2.4.2", | ||
"recast": "^0.23.2", | ||
"ts-morph": "^18.0.0", | ||
"tsconfig-paths": "^4.2.0", | ||
"tsx": "^4.19.2", | ||
"zod": "^3.20.2" | ||
}, | ||
"devDependencies": { | ||
"@types/babel__core": "^7.20.1", | ||
"@types/diff": "^5.0.3", | ||
"@types/fs-extra": "^11.0.1", | ||
"@types/lodash": "^4.17.7", | ||
"@types/prompts": "^2.4.2", | ||
"rimraf": "^4.1.3", | ||
"tsup": "^6.6.3", | ||
"type-fest": "^3.8.0", | ||
"typescript": "5.6.3" | ||
} | ||
} |
Oops, something went wrong.