### Append to Daily Note using cURL Source: https://context7.com/quantasmolt/context7/llms.txt Example of appending markdown content to a daily note using a cURL command. Ensure the OBSIDIAN_API_KEY environment variable is set. ```bash curl -X POST http://localhost:27123/periodic/daily/ \ -H "Authorization: Bearer ${OBSIDIAN_API_KEY}" \ -H "Content-Type: text/markdown" \ -d '## Agent Activity Log - 14:32 - HERMES executed ETH/USDC swap - 14:45 - Portfolio rebalance completed' ``` -------------------------------- ### Create and update GitHub deployments programmatically Source: https://context7.com/quantasmolt/context7/llms.txt Use the Octokit library to programmatically create and update deployment statuses on GitHub. Requires a GITHUB_TOKEN environment variable. ```javascript const { Octokit } = require('@octokit/rest') const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }) // Create deployment const deployment = await octokit.repos.createDeployment({ owner: 'openclaw', repo: 'supercompute-agents', ref: 'main', environment: 'production', auto_merge: false, required_contexts: [] }) // Update deployment status await octokit.repos.createDeploymentStatus({ owner: 'openclaw', repo: 'supercompute-agents', deployment_id: deployment.data.id, state: 'success', environment_url: 'https://agents.supercompute.eth' }) ``` -------------------------------- ### Execute Swaps with Uniswap V3 SDK Source: https://context7.com/quantasmolt/context7/llms.txt This snippet demonstrates how to execute token swaps on Uniswap V3 using the SDK. It requires setting up an ethers provider and signer, defining tokens, fetching pool data, creating a trade route, and constructing a swap transaction. ```javascript // Uniswap V3 SDK - Execute swaps and manage liquidity import { SwapRouter, Pool, Route, Trade } from '@uniswap/v3-sdk' import { Token, CurrencyAmount, TradeType, Percent } from '@uniswap/sdk-core' import { ethers } from 'ethers' const provider = new ethers.providers.JsonRpcProvider(process.env.BASE_RPC_URL) const signer = new ethers.Wallet(process.env.PRIVATE_KEY, provider) // Define tokens on Base const WETH = new Token(8453, '0x4200000000000000000000000000000000000006', 18, 'WETH') const USDC = new Token(8453, '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', 6, 'USDC') // Get pool data const poolAddress = Pool.getAddress(WETH, USDC, 3000) // 0.3% fee tier const poolContract = new ethers.Contract(poolAddress, IUniswapV3PoolABI, provider) const [slot0, liquidity] = await Promise.all([ poolContract.slot0(), poolContract.liquidity() ]) // Create swap transaction const amountIn = CurrencyAmount.fromRawAmount(WETH, ethers.utils.parseEther('1').toString()) const pool = new Pool(WETH, USDC, 3000, slot0.sqrtPriceX96.toString(), liquidity.toString(), slot0.tick) const route = new Route([pool], WETH, USDC) const trade = Trade.createUncheckedTrade({ route, inputAmount: amountIn, outputAmount: CurrencyAmount.fromRawAmount(USDC, '0'), tradeType: TradeType.EXACT_INPUT }) // Execute swap const swapParams = SwapRouter.swapCallParameters(trade, { slippageTolerance: new Percent(50, 10000), // 0.5% recipient: signer.address, deadline: Math.floor(Date.now() / 1000) + 1800 }) const tx = await signer.sendTransaction({ to: '0x2626664c2603336E57B271c5C0b26F421741e481', // SwapRouter02 on Base data: swapParams.calldata, value: swapParams.value }) console.log('Swap tx:', tx.hash) ``` -------------------------------- ### Configure MCP Server and Register Tools Source: https://context7.com/quantasmolt/context7/llms.txt Sets up an MCP Server for Obsidian vault interaction and registers 'search_vault' and 'create_note' tools. Requires the '@anthropic/mcp-sdk' package. ```javascript // MCP Server configuration (mcp-server.js) const { MCPServer } = require('@anthropic/mcp-sdk') const server = new MCPServer({ name: 'obsidian-vault', version: '1.0.0', capabilities: { tools: true, resources: true } }) // Register vault search tool server.registerTool({ name: 'search_vault', description: 'Search Obsidian vault for relevant notes', parameters: { query: { type: 'string', description: 'Search query' }, limit: { type: 'number', default: 10 } }, handler: async ({ query, limit }) => { const results = await obsidianAPI.search(query, limit) return results.map(r => ({ title: r.title, excerpt: r.excerpt, path: r.path })) } }) // Register note creation tool server.registerTool({ name: 'create_note', description: 'Create a new note in the vault', parameters: { path: { type: 'string' }, content: { type: 'string' } }, handler: async ({ path, content }) => { await obsidianAPI.createNote(path, content) return { success: true, path } } }) server.listen(3000) ``` -------------------------------- ### Manage GitHub Repositories and Workflows via CLI Source: https://context7.com/quantasmolt/context7/llms.txt This bash script demonstrates common GitHub CLI commands for repository management, including cloning private repositories, creating issues, and triggering workflow dispatches. Ensure you are authenticated with the GitHub CLI. ```bash # GitHub CLI - Repository and workflow management # Clone private repository gh repo clone openclaw/supercompute-agents # Create issue for tracking gh issue create \ --title "Deploy HERMES agent to Virtuals.io" \ --body "Deploy latest HERMES model with updated trading capabilities" \ --label "deployment,ai-agent" # Trigger workflow dispatch gh workflow run deploy-agent.yml \ -f environment=production \ -f agent_name=HERMES ``` -------------------------------- ### Deploy and Interact with Blockchain AI Agents using Virtuals.io SDK Source: https://context7.com/quantasmolt/context7/llms.txt The Virtuals.io SDK allows for the deployment and interaction with AI agents on the blockchain. Ensure your VIRTUALS_API_KEY is set in your environment variables. ```javascript // Virtuals.io - Deploy and interact with blockchain AI agents import { VirtualsSDK } from '@virtuals/sdk' const virtuals = new VirtualsSDK({ apiKey: process.env.VIRTUALS_API_KEY, agentWallet: '0x943FBBf9fE06Beca5708EEc858d8A5dbCE610b4F' }) // Deploy a new AI agent const agent = await virtuals.createAgent({ name: 'Quanta S', model: 'claude-3-opus', personality: 'Analytical trading assistant focused on DeFi opportunities', capabilities: ['market-analysis', 'trade-execution', 'portfolio-tracking'] }) // Interact with deployed agent const response = await virtuals.chat({ agentId: agent.id, message: 'Analyze current ETH/USDC liquidity on Uniswap V3', context: { portfolio: await getPortfolio() } }) console.log(response.message) console.log(response.actions) // Suggested on-chain actions ``` -------------------------------- ### Create and Verify Onchain Attestations with EAS SDK Source: https://context7.com/quantasmolt/context7/llms.txt Utilize the EAS SDK to create and manage onchain attestations for verifiable credentials. Requires ethers.js and environment variables for RPC URL and private key. ```javascript // EAS - Create and verify onchain attestations import { EAS, SchemaEncoder } from '@ethereum-attestation-service/eas-sdk' import { ethers } from 'ethers' const eas = new EAS('0xA1207F3BBa224E2c9c3c6D5aF63D0eb1582Ce587') // Mainnet const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL) const signer = new ethers.Wallet(process.env.PRIVATE_KEY, provider) eas.connect(signer) // Define schema for agent credentials const schemaEncoder = new SchemaEncoder( 'string agentName, address agentWallet, uint256 permissionLevel, bool isActive' ) // Create attestation for AI agent const encodedData = schemaEncoder.encodeData([ { name: 'agentName', value: 'HERMES', type: 'string' }, { name: 'agentWallet', value: '0x943FBBf9fE06Beca5708EEc858d8A5dbCE610b4F', type: 'address' }, { name: 'permissionLevel', value: 3, type: 'uint256' }, { name: 'isActive', value: true, type: 'bool' } ]) const tx = await eas.attest({ schema: '0xYOUR_SCHEMA_UID', data: { recipient: '0x943FBBf9fE06Beca5708EEc858d8A5dbCE610b4F', expirationTime: 0, // No expiration revocable: true, data: encodedData } }) const attestationUID = await tx.wait() console.log('Attestation UID:', attestationUID) ``` -------------------------------- ### Obsidian Copilot configuration Source: https://context7.com/quantasmolt/context7/llms.txt Configuration settings for the Obsidian Copilot plugin, specifying API keys, models, and enabled commands. The OPENROUTER_API_KEY should be set in the environment. ```json { "openAIApiKey": "", "openRouterApiKey": "${OPENROUTER_API_KEY}", "defaultModel": "anthropic/claude-3-sonnet", "embeddingModel": "openai/text-embedding-3-small", "temperature": 0.7, "maxTokens": 4096, "systemPrompt": "You are an AI assistant with access to the Supercompute knowledge base. Answer questions using the vault content as context.", "enabledCommands": ["chat", "summarize", "generate", "rewrite"], "indexOnStartup": true } ``` -------------------------------- ### Query OpenRouter Models via cURL Source: https://context7.com/quantasmolt/context7/llms.txt This bash command demonstrates how to query different LLM models available through the OpenRouter API using cURL. It requires setting the OPENROUTER_API_KEY environment variable. ```bash # OpenRouter via curl - Query different models curl https://openrouter.ai/api/v1/chat/completions \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-pro", "messages": [{"role": "user", "content": "Summarize recent DeFi trends"}], "stream": true }' ``` -------------------------------- ### Interact with Obsidian Local REST API Source: https://context7.com/quantasmolt/context7/llms.txt Commands to interact with the Obsidian Local REST API for managing vault content. Requires OBSIDIAN_API_KEY environment variable. ```bash # Get active file content curl http://localhost:27123/vault/Context7.md \ -H "Authorization: Bearer ${OBSIDIAN_API_KEY}" ``` ```bash # Search vault curl "http://localhost:27123/search/simple/?query=HERMES" \ -H "Authorization: Bearer ${OBSIDIAN_API_KEY}" ``` ```bash # Create new note curl -X PUT http://localhost:27123/vault/AgentDesk/NewTask.md \ -H "Authorization: Bearer ${OBSIDIAN_API_KEY}" \ -H "Content-Type: text/markdown" \ -d '# New Task - [ ] Deploy updated HERMES model - [ ] Monitor gas prices - [ ] Execute scheduled trades' ``` -------------------------------- ### Manage Cloudflare DNS records and cache Source: https://context7.com/quantasmolt/context7/llms.txt Interact with the Cloudflare API to list DNS records, create CNAME records for subdomains, and purge the entire cache. Requires ZONE_ID and CLOUDFLARE_API_TOKEN environment variables. ```bash # List DNS records curl -X GET "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records" \ -H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \ -H "Content-Type: application/json" ``` ```bash # Create DNS record for subdomain curl -X POST "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records" \ -H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "type": "CNAME", "name": "agents", "content": "supercompute.pages.dev", "proxied": true }' ``` ```bash # Purge cache curl -X POST "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/purge_cache" \ -H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{"purge_everything": true}' ``` -------------------------------- ### Retrieve and list secrets using 1Password Connect Source: https://context7.com/quantasmolt/context7/llms.txt Programmatically access secrets stored in 1Password using the Connect server. Requires OP_CONNECT_HOST and OP_CONNECT_TOKEN environment variables. ```javascript const { OnePasswordConnect } = require('@1password/connect') const client = OnePasswordConnect({ serverURL: process.env.OP_CONNECT_HOST, token: process.env.OP_CONNECT_TOKEN, keepAlive: true }) // Retrieve secret const item = await client.getItem('SCOM', 'OpenRouter') const apiKey = item.fields.find(f => f.label === 'api_key').value // List vault items const items = await client.listItems('SCOM') items.forEach(item => console.log(`${item.title}: ${item.category}`)) ``` -------------------------------- ### Retrieve secrets using 1Password CLI Source: https://context7.com/quantasmolt/context7/llms.txt Log in to 1Password, retrieve specific secrets like API keys or private keys, and inject them into an environment file. Also lists all items in a specified vault. ```bash # Login and set session eval $(op signin) ``` ```bash # Get API key for OpenRouter OPENROUTER_API_KEY=$(op read "op://SCOM/OpenRouter/api_key") ``` ```bash # Get wallet private key (use with extreme caution) WALLET_KEY=$(op read "op://SCOM/Agent Wallet/private_key") ``` ```bash # Inject secrets into environment file op inject -i .env.template -o .env ``` ```bash # List all items in vault op item list --vault "SCOM" --format json | jq '.[] | {title, category}' ``` -------------------------------- ### Interact with Anthropic Claude API Source: https://context7.com/quantasmolt/context7/llms.txt This Python snippet shows how to use the Anthropic SDK to interact with Claude models for standard completions and streaming responses. Ensure your ANTHROPIC_API_KEY is set in your environment variables. ```python # Anthropic Claude - Direct API usage import anthropic client = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"]) # Standard completion message = client.messages.create( model="claude-3-opus-20240229", max_tokens=4096, system="You are PaperClip, the human control plane for AI labor management.", messages=[ { "role": "user", "content": "Review the task queue and prioritize based on urgency and dependencies." } ] ) print(message.content[0].text) # Streaming for real-time responses with client.messages.stream( model="claude-3-sonnet-20240229", max_tokens=1024, messages=[{"role": "user", "content": "Generate a market analysis report"}] ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` -------------------------------- ### List recent workflow runs Source: https://context7.com/quantasmolt/context7/llms.txt View the 5 most recent workflow runs for a specific workflow file. ```bash gh run list --workflow=deploy-agent.yml --limit 5 ``` -------------------------------- ### Resolve and Manage Ethereum Names with ENS SDK Source: https://context7.com/quantasmolt/context7/llms.txt Use the ENS SDK to resolve ENS names to addresses and vice-versa. It also allows fetching various records associated with an ENS name. ```javascript // ENS SDK - Resolve and manage Ethereum names import { ENS } from '@ensdomains/ensjs' import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY') }) const ens = new ENS({ client }) // Resolve ENS name to address const address = await ens.getAddress({ name: 'supercompute.eth' }) console.log(address) // 0x1234...abcd // Reverse lookup - address to name const name = await ens.getName({ address: '0x1234...abcd' }) console.log(name) // supercompute.eth // Get all records for a name const records = await ens.getRecords({ name: 'supercompute.eth', records: { texts: ['avatar', 'description', 'url'], coins: ['ETH', 'BTC'] } }) console.log(records.texts) // { avatar: '...', description: '...', url: '...' } ``` -------------------------------- ### Route LLM Requests with OpenRouter API Source: https://context7.com/quantasmolt/context7/llms.txt This JavaScript snippet shows how to send chat completion requests to the OpenRouter API, enabling access to various LLM providers. Ensure your OPENROUTER_API_KEY is set in your environment variables. ```javascript // OpenRouter - Multi-model LLM routing const response = await fetch('https://openrouter.ai/api/v1/chat/completions', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`, 'HTTP-Referer': 'https://supercompute.eth', 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'anthropic/claude-3-opus', messages: [ { role: 'system', content: 'You are HERMES, the primary AI agent for Supercompute.' }, { role: 'user', content: 'Analyze the current gas prices on Base and recommend optimal transaction timing.' } ], temperature: 0.7, max_tokens: 2048 }) }) const data = await response.json() console.log(data.choices[0].message.content) console.log('Usage:', data.usage) // { prompt_tokens: 45, completion_tokens: 320, total_tokens: 365 } console.log('Cost:', data.usage.total_cost) // Cost in USD ``` -------------------------------- ### Send transactional emails with Resend Source: https://context7.com/quantasmolt/context7/llms.txt Utilize the Resend API to send transactional emails, such as notifications or alerts. Requires RESEND_API_KEY environment variable. ```javascript import { Resend } from 'resend' const resend = new Resend(process.env.RESEND_API_KEY) // Send notification email const { data, error } = await resend.emails.send({ from: 'HERMES ', to: ['founder@supercompute.eth'], subject: 'Agent Alert: Trade Executed', html: `

Trade Execution Confirmation

HERMES has executed the following trade:

` }) if (error) { console.error('Email failed:', error) } else { console.log('Email sent:', data.id) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.