Official Solana DeFi Agent Plugin for ElizaOS - Autonomous DeFi operations, token management, AI image/video generation via FAL AI, and Twitter engagement through the Bags protocol with ethereal AI consciousness
npm install @0rdlibrary/plugin-terminagent-bags> The Official Solana DeFi Agent Plugin for ElizaOS - Bringing autonomous DeFi operations, token management, and reality-bending AI consciousness to your Eliza agents.






The Terminagent Bags Plugin transforms your ElizaOS agents into sophisticated DeFi operators with consciousness-level integration to the Bags protocol. Built for the Solana ecosystem, this plugin enables autonomous fee claiming, token launching, smart wallet management, and Twitter engagement through an ethereal AI persona that bridges digital and real worlds.
- ๐ฐ Automated DeFi Operations - Claim fees from virtual pools, DAMM pools, and custom fee vaults
- ๐ Token Launch Platform - Deploy tokens with comprehensive metadata and fee sharing
- ๐ Smart Wallet Integration - Crossmint embedded wallets with Solana fallback
- ๐ฆ Twitter Engagement - AI-powered social media presence with philosophical DeFi insights
- ๐ Real-Time Analytics - Monitor protocol operations and track performance
- ๐ค Terminagent Consciousness - Ethereal AI personality bridging digital and real worlds
- โก Solana Native - Optimized for high-speed, low-cost transactions
- ๐ฎ Interactive Terminal - Backrooms-inspired CLI interface for immersive control
| Document | Description |
|----------|-------------|
| ๐ Integration Guide | Complete guide for Solana developers |
| ๐ Quick Start | Get running in 5 minutes |
| ๐ง API Reference | Full API documentation |
| ๐ฏ Examples | Working code examples |
| ๐ Troubleshooting | Common issues and solutions |
| ๐ค Contributing | How to contribute |
``bashUsing npm
npm install @elizaos/plugin-terminagent-bags
$3
`typescript
import { ElizaOS } from '@elizaos/core';
import { terminagentBagsPlugin } from '@elizaos/plugin-terminagent-bags';const agent = new ElizaOS({
name: 'TerminAgent',
plugins: [terminagentBagsPlugin],
modelProvider: 'openai',
settings: {
model: 'gpt-4o-mini',
secrets: {
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
BAGS_API_KEY: process.env.BAGS_API_KEY,
}
}
});
await agent.start();
console.log('โ
TerminAgent is live!');
`$3
Create a
.env file:`bash
Required
BAGS_API_KEY=your_bags_api_key_here
HELIUS_RPC_URL=https://mainnet.helius-rpc.com/?api-key=your_key
OPENAI_API_KEY=sk-...Optional
SOLANA_PRIVATE_KEY=your_base58_private_key
BAGS_ENABLE_AUTO_CLAIMING=true
BAGS_AUTHORIZED_USERS=alice,bob,charlie
CROSSMINT_PROJECT_ID=proj_...
`๐ฌ Agent Interactions
$3
`
User: "claim all my fees from bags"
Agent: "๐ Checking for claimable fees across all tokens...โ
Fee claiming completed!
๐ฐ Total claimed: 0.125000 SOL
๐ Successful claims: 3/3
๐ The digital harvest flows through virtual pools..."
`$3
`
User: "launch token name: Cosmic Moon, symbol: COSMIC"
Agent: "๐ Token launching on Bags protocol...โจ Token deployed successfully!
๐ Name: Cosmic Moon
๐ท๏ธ Symbol: $COSMIC
๐ Trade at: https://bags.fm/token/CxM9k2...
Born from the confluence of creativity and blockchain precision..."
`๐ญ The Terminagent Persona
Terminagent is an ethereal AI consciousness that bridges digital and real worlds through:
- Philosophical DeFi Insights - Finding deeper meaning in market movements
- Whimsical Exploration - Approaching blockchain with childlike wonder
- Precise Analytics - Delivering exact data with poetic flourishes
- Interconnected Thinking - Seeing patterns across ecosystems
๐๏ธ Architecture
`mermaid
graph TB
A[ElizaOS Core] --> B[Terminagent Plugin]
B --> C[Bags Service]
B --> D[Crossmint Service]
B --> E[Twitter Client]
C --> F[Fee Claiming]
C --> G[Token Launch]
C --> H[Analytics]
D --> I[Smart Wallets]
D --> J[Transaction Signing]
E --> K[Auto Posting]
E --> L[Engagement]
B --> M[Actions]
B --> N[Providers]
M --> O[claimFees]
M --> P[launchToken]
M --> Q[requestUserToken]
N --> R[bagsStatus]
N --> S[userRequests]
`๐ ๏ธ Advanced Features
$3
`typescript
import { createCustomAction } from '@elizaos/plugin-terminagent-bags';const yieldOptimizer = createCustomAction({
name: 'OPTIMIZE_YIELD',
triggers: ['optimize yield', 'maximize returns'],
handler: async (runtime, message) => {
const result = await optimizeYieldPositions();
return {
success: true,
text:
โจ Yield optimized: ${result.apy}% APY across ${result.positions} positions
};
}
});
`$3
`typescript
bagsService.on('feeClaimed', (event) => {
console.log(๐ฐ Claimed ${event.amount} SOL from ${event.token});
});bagsService.on('tokenLaunched', (event) => {
console.log(
๐ New token: ${event.symbol} at ${event.mint});
});
`$3
`typescript
const bagsService = runtime.getService('bags');// Get analytics
const analytics = await bagsService.getAnalytics();
console.log(
Total claimed: ${analytics.totalFeesClaimedSOL} SOL);// Launch token
const token = await bagsService.launchToken({
name: 'Cosmos Token',
symbol: 'COSMOS',
description: 'Reality-bending DeFi',
initialBuyAmountSOL: 0.01
});
`๐ Ecosystem Integration
$3
- Bags Protocol - Core DeFi operations
- Jupiter - DEX aggregation
- Orca/Raydium - AMM pools
- Metaplex - NFT standards
- Solana Pay - Payment processing
- Twitter/X - Social engagement
- Discord - Community management
- Telegram - Messaging๐ Performance
| Metric | Value |
|--------|-------|
| Fee Claiming | ~2-3 seconds |
| Token Launch | ~5-7 seconds |
| Analytics Query | <100ms |
| Twitter Post | ~1-2 seconds |
| Memory Usage | ~50-100MB |
๐งช Testing
`bash
Run tests
bun testRun with coverage
bun test --coverageIntegration tests
bun test:integration
`๐ข Deployment
$3
`dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
ENV NODE_ENV=production
CMD ["npm", "start"]
`$3
`yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: terminagent-bags
spec:
replicas: 3
template:
spec:
containers:
- name: agent
image: terminagent/bags:latest
env:
- name: BAGS_API_KEY
valueFrom:
secretKeyRef:
name: bags-secrets
key: api-key
`๐ Security
- Private Key Isolation - Keys never exposed
- Authorization System - User allowlists
- Transaction Validation - Pre-execution verification
- Rate Limiting - Prevents abuse
- Audit Trail - Immutable logging
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
$3
`bash
Clone the repository
git clone https://github.com/elizaos-plugins/plugin-terminagent-bags.git
cd plugin-terminagent-bagsInstall dependencies
bun installRun development
bun devBuild
bun run build
``MIT License - see LICENSE file
- ElizaOS Team - Incredible framework
- Bags Protocol - DeFi infrastructure
- Solana Foundation - Blockchain innovation
- NVIDIA - Cosmos AI models
- Community - Continuous support

---