Skip to content

Commit 7e0fae8

Browse files
committed
init commit, what could go wrong?
0 parents  commit 7e0fae8

19 files changed

Lines changed: 3106 additions & 0 deletions

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Build outputs
2+
dist/
3+
node_modules/
4+
5+
# Environment files
6+
.env
7+
.env.local
8+
.env.production
9+
.env.staging
10+
.env.development
11+
.env.bak
12+
*.env
13+
14+
# OS files
15+
.DS_Store
16+
Thumbs.db
17+
18+
# IDE files
19+
.vscode/
20+
.idea/
21+
*.swp
22+
*.swo
23+
24+
# Logs
25+
*.log
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
# Runtime data
31+
pids/
32+
*.pid
33+
*.seed
34+
*.pid.lock
35+
36+
# Coverage directory used by tools like istanbul
37+
coverage/
38+
39+
# Cache directories
40+
.cache/
41+
.npm/
42+
.eslintcache
43+
44+
# Temporary folders
45+
tmp/
46+
temp/
47+
48+
# Database files
49+
*.db
50+
*.pglite
51+
*.pglite3
52+
53+
# ElizaOS specific
54+
.eliza/
55+
.elizadb/
56+
pglite/
57+
cache/

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.turbo
2+
node_modules
3+
.env
4+
*.env
5+
.env.local

README.md

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
# ElizaOS Plugin
2+
3+
This is an ElizaOS plugin built with the official plugin starter template.
4+
5+
## Getting Started
6+
7+
```bash
8+
# Create a new plugin (automatically adds "plugin-" prefix)
9+
elizaos create -t plugin solana
10+
# This creates: plugin-solana
11+
# Dependencies are automatically installed and built
12+
13+
# Navigate to the plugin directory
14+
cd plugin-solana
15+
16+
# Start development immediately
17+
elizaos dev
18+
```
19+
20+
## Development
21+
22+
```bash
23+
# Start development with hot-reloading (recommended)
24+
elizaos dev
25+
26+
# OR start without hot-reloading
27+
elizaos start
28+
# Note: When using 'start', you need to rebuild after changes:
29+
# bun run build
30+
31+
# Test the plugin
32+
elizaos test
33+
```
34+
35+
## Testing
36+
37+
ElizaOS provides a comprehensive testing structure for plugins:
38+
39+
### Test Structure
40+
41+
- **Component Tests** (`__tests__/` directory):
42+
43+
- **Unit Tests**: Test individual functions/classes in isolation
44+
- **Integration Tests**: Test how components work together
45+
- Run with: `elizaos test component`
46+
47+
- **End-to-End Tests** (`e2e/` directory):
48+
49+
- Test the plugin within a full ElizaOS runtime
50+
- Run with: `elizaos test e2e`
51+
52+
- **Running All Tests**:
53+
- `elizaos test` runs both component and e2e tests
54+
55+
### Writing Tests
56+
57+
Component tests use Vitest:
58+
59+
```typescript
60+
// Unit test example (__tests__/plugin.test.ts)
61+
describe('Plugin Configuration', () => {
62+
it('should have correct plugin metadata', () => {
63+
expect(starterPlugin.name).toBe('plugin-starter');
64+
});
65+
});
66+
67+
// Integration test example (__tests__/integration.test.ts)
68+
describe('Integration: HelloWorld Action with StarterService', () => {
69+
it('should handle HelloWorld action with StarterService', async () => {
70+
// Test interactions between components
71+
});
72+
});
73+
```
74+
75+
E2E tests use ElizaOS test interface:
76+
77+
```typescript
78+
// E2E test example (e2e/starter-plugin.test.ts)
79+
export class StarterPluginTestSuite implements TestSuite {
80+
name = 'plugin_starter_test_suite';
81+
tests = [
82+
{
83+
name: 'example_test',
84+
fn: async (runtime) => {
85+
// Test plugin in a real runtime
86+
},
87+
},
88+
];
89+
}
90+
91+
export default new StarterPluginTestSuite();
92+
```
93+
94+
The test utilities in `__tests__/test-utils.ts` provide mock objects and setup functions to simplify writing tests.
95+
96+
## Publishing & Continuous Development
97+
98+
### Initial Setup
99+
100+
Before publishing your plugin, ensure you meet these requirements:
101+
102+
1. **npm Authentication**
103+
104+
```bash
105+
npm login
106+
```
107+
108+
2. **GitHub Repository**
109+
110+
- Create a public GitHub repository for this plugin
111+
- Add the 'elizaos-plugins' topic to the repository
112+
- Use 'main' as the default branch
113+
114+
3. **Required Assets**
115+
- Add images to the `images/` directory:
116+
- `logo.jpg` (400x400px square, <500KB)
117+
- `banner.jpg` (1280x640px, <1MB)
118+
119+
### Initial Publishing
120+
121+
```bash
122+
# Test your plugin meets all requirements
123+
elizaos publish --test
124+
125+
# Publish to npm + GitHub + registry (recommended)
126+
elizaos publish
127+
```
128+
129+
This command will:
130+
131+
- Publish your plugin to npm for easy installation
132+
- Create/update your GitHub repository
133+
- Submit your plugin to the ElizaOS registry for discoverability
134+
135+
### Continuous Development & Updates
136+
137+
**Important**: After your initial publish with `elizaos publish`, all future updates should be done using standard npm and git workflows, not the ElizaOS CLI.
138+
139+
#### Standard Update Workflow
140+
141+
1. **Make Changes**
142+
143+
```bash
144+
# Edit your plugin code
145+
elizaos dev # Test locally with hot-reload
146+
```
147+
148+
2. **Test Your Changes**
149+
150+
```bash
151+
# Run all tests
152+
elizaos test
153+
154+
# Run specific test types if needed
155+
elizaos test component # Component tests only
156+
elizaos test e2e # E2E tests only
157+
```
158+
159+
3. **Update Version**
160+
161+
```bash
162+
# Patch version (bug fixes): 1.0.0 → 1.0.1
163+
npm version patch
164+
165+
# Minor version (new features): 1.0.1 → 1.1.0
166+
npm version minor
167+
168+
# Major version (breaking changes): 1.1.0 → 2.0.0
169+
npm version major
170+
```
171+
172+
4. **Publish to npm**
173+
174+
```bash
175+
npm publish
176+
```
177+
178+
5. **Push to GitHub**
179+
```bash
180+
git push origin main
181+
git push --tags # Push version tags
182+
```
183+
184+
#### Why Use Standard Workflows?
185+
186+
- **npm publish**: Directly updates your package on npm registry
187+
- **git push**: Updates your GitHub repository with latest code
188+
- **Automatic registry updates**: The ElizaOS registry automatically syncs with npm, so no manual registry updates needed
189+
- **Standard tooling**: Uses familiar npm/git commands that work with all development tools
190+
191+
### Alternative Publishing Options (Initial Only)
192+
193+
```bash
194+
# Publish to npm only (skip GitHub and registry)
195+
elizaos publish --npm
196+
197+
# Publish but skip registry submission
198+
elizaos publish --skip-registry
199+
200+
# Generate registry files locally without publishing
201+
elizaos publish --dry-run
202+
```
203+
204+
## Configuration
205+
206+
The `agentConfig` section in `package.json` defines the parameters your plugin requires:
207+
208+
```json
209+
"agentConfig": {
210+
"pluginType": "elizaos:plugin:1.0.0",
211+
"pluginParameters": {
212+
"API_KEY": {
213+
"type": "string",
214+
"description": "API key for the service"
215+
}
216+
}
217+
}
218+
```
219+
220+
Customize this section to match your plugin's requirements.
221+
222+
## Documentation
223+
224+
Provide clear documentation about:
225+
226+
- What your plugin does
227+
- How to use it
228+
- Required API keys or credentials
229+
- Example usage
230+
- Version history and changelog

package.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"name": "@elizaos/plugin-shell",
3+
"description": "Shell plugin for ElizaOS",
4+
"version": "1.0.0",
5+
"type": "module",
6+
"private": true,
7+
"main": "dist/index.js",
8+
"module": "dist/index.js",
9+
"types": "dist/index.d.ts",
10+
"packageType": "plugin",
11+
"platform": "node",
12+
"license": "UNLICENSED",
13+
"author": "ElizaOS",
14+
"keywords": [
15+
"plugin",
16+
"elizaos"
17+
],
18+
"repository": {
19+
"type": "git",
20+
"url": "https://github.com/elizaos-plugins/plugin-auto"
21+
},
22+
"homepage": "https://elizaos.ai",
23+
"bugs": {
24+
"url": "https://github.com/elizaos-plugins/plugin-auto/issues"
25+
},
26+
"exports": {
27+
"./package.json": "./package.json",
28+
".": {
29+
"import": {
30+
"types": "./dist/index.d.ts",
31+
"default": "./dist/index.js"
32+
}
33+
}
34+
},
35+
"files": [
36+
"dist",
37+
"README.md",
38+
".npmignore",
39+
"package.json",
40+
"tsup.config.ts"
41+
],
42+
"dependencies": {
43+
"@elizaos/core": "^1.0.9",
44+
"@elizaos/plugin-bootstrap": "1.0.8",
45+
"zod": "3.24.2"
46+
},
47+
"peerDependencies": {},
48+
"devDependencies": {
49+
"@elizaos/cli": "^1.0.0",
50+
"dotenv": "16.4.5",
51+
"prettier": "3.5.3",
52+
"tsup": "8.4.0",
53+
"tsx": "^4.7.0",
54+
"typescript": "5.8.2",
55+
"vitest": "3.1.4"
56+
},
57+
"scripts": {
58+
"start": "elizaos start",
59+
"dev": "elizaos dev",
60+
"build": "tsup",
61+
"lint": "prettier --write ./src",
62+
"test:component": "vitest run",
63+
"test:e2e": "elizaos test",
64+
"test:e2e:local": "tsx src/tests/e2e/run-local.ts",
65+
"test": "npm run test:component && npm run test:e2e",
66+
"typecheck": "tsc --noEmit",
67+
"publish": "elizaos publish",
68+
"format": "prettier --write ./src",
69+
"format:check": "prettier --check ./src"
70+
},
71+
"publishConfig": {
72+
"access": "public"
73+
},
74+
"resolutions": {
75+
"zod": "3.24.2"
76+
},
77+
"agentConfig": {
78+
"pluginType": "elizaos:plugin:1.0.0",
79+
"pluginParameters": {
80+
"API_KEY": {
81+
"type": "string",
82+
"description": "API key for the service"
83+
}
84+
}
85+
},
86+
"gitHead": "d5bd5c43bfebeb7ac02f9e029f924cb6cd5c2ec7"
87+
}

0 commit comments

Comments
 (0)