### Quick Start: Create and Run a Server Source: https://github.com/poe-platform/poe-code/blob/main/packages/tiny-stdio-mcp-server/README.md A basic example demonstrating how to create a server, define a tool, and start listening. The 'reverse' tool takes a string and returns its reversed version. ```ts import { createServer, defineSchema } from "tiny-stdio-mcp-server"; const schema = defineSchema({ text: { type: "string", description: "Text to reverse" }, }); createServer({ name: "my-server", version: "1.0.0" }) .tool("reverse", "Reverse a string", schema, ({ text }) => { return text.split("").reverse().join(""); }) .listen(); ``` ```sh node my-server.js ``` -------------------------------- ### Global Setup Example Source: https://github.com/poe-platform/poe-code/blob/main/packages/e2e-test-runner/README.md Illustrates the global setup process for the e2e test runner, showing how to run preflight checks and handle their results to ensure the test environment is ready. ```APIDOC ## Global Setup ```typescript import { runPreflight, formatPreflightResults } from '@poe-code/e2e-test-runner'; export async function setup(): Promise { const { passed, results } = await runPreflight(); console.error(formatPreflightResults(results)); if (!passed) { throw new Error('Preflight checks failed'); } } ``` ``` -------------------------------- ### Vitest Setup Example Source: https://github.com/poe-platform/poe-code/blob/main/packages/e2e-test-runner/README.md Provides a code example demonstrating how to configure Vitest for use with the poe-code e2e test runner, including test timeouts, worker limits, global setup, and setup files. ```APIDOC ## Vitest Setup ```typescript import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { include: ['e2e/**/*.test.ts'], testTimeout: 300000, hookTimeout: 300000, maxWorkers: 1, globalSetup: ['./e2e/setup.ts'], setupFiles: ['@poe-code/e2e-test-runner/matchers'], }, }); ``` ``` -------------------------------- ### Setup and Build Toolcraft Packages Source: https://github.com/poe-platform/poe-code/blob/main/packages/toolcraft/QA-help-output.md Navigate to the toolcraft package directory and build the necessary packages before running the example consumer. ```sh cd packages/toolcraft npm run build npm run build -w tiny-stdio-mcp-test-server ``` -------------------------------- ### Quick Start: Initialize and Run a Poe Agent Source: https://github.com/poe-platform/poe-code/blob/main/packages/poe-agent/README.md Initialize a Poe agent with various plugins and run a task. Ensure you have the necessary API key and ripgrep installed. ```typescript import { agent, compactionPlugin, filesPlugin, memoryPlugin, policyPlugin, shellPlugin, systemPromptPlugin, webPlugin } from "@poe-code/poe-agent"; const result = await agent() .model("anthropic/claude-sonnet-4.6") .use(systemPromptPlugin()) .use(memoryPlugin({ cwd: process.cwd() })) .use(filesPlugin({ cwd: process.cwd() })) .use(shellPlugin({ cwd: process.cwd() })) .use(webPlugin()) .use(policyPlugin({ mode: "edit" })) .use(compactionPlugin({ keepLastTurns: 3 })) .run("Fix the failing test", { apiKey: "", cwd: process.cwd() }); console.log(result.output); ``` -------------------------------- ### Create Container with Proxy Source: https://github.com/poe-platform/poe-code/blob/main/docs/research/e2e-network-interception.md Use this function to create a Docker container with proxy capabilities enabled. It handles Docker network setup, starts the mitmproxy sidecar, installs the CA certificate, and sets necessary environment variables. ```typescript const container = await createContainer({ proxy: true }); ``` -------------------------------- ### Example CLI Usage Source: https://github.com/poe-platform/poe-code/blob/main/packages/toolcraft/README.md Demonstrates how to invoke the 'greet' command with different parameters and how to access help. ```sh mytool greet --name world mytool greet --name world --loud mytool greet --help ``` -------------------------------- ### Install and Get Help for agent-stash Source: https://github.com/poe-platform/poe-code/blob/main/docs/plans/portable-agent-config-sync.md Install the agent-stash npm package globally and view its help information. ```bash npm install -g agent-stash agent-stash --help ``` -------------------------------- ### Custom Slash Command Examples Source: https://github.com/poe-platform/poe-code/blob/main/docs/research/DROID_RESEARCH.md These are examples of custom slash commands that can be defined for repeatable prompts or setup steps. ```shell /review-pr ``` ```shell /my-custom-command ``` -------------------------------- ### CLI: `plan markdown-reader-mcp` example Source: https://github.com/poe-platform/poe-code/blob/main/packages/markdown-reader/src/testing/fixtures/markdown-reader-plan.md Example of starting the `plan markdown-reader-mcp` MCP server. This command runs in the background, reading from stdin and writing to stdout. ```text $ poe-code plan markdown-reader-mcp # (blocks, reading MCP JSON-RPC on stdin / writing on stdout) ``` -------------------------------- ### Quick Start Commands Source: https://github.com/poe-platform/poe-code/blob/main/packages/tiny-stdio-mcp-test-server/README.md Run these commands to quickly start the test server for different tools. ```sh npx tiny-stdio-mcp-test-server serve encrypt npx tiny-stdio-mcp-test-server serve word-of-the-day ``` -------------------------------- ### Call SDK Method Source: https://github.com/poe-platform/poe-code/blob/main/packages/toolcraft-landing-page/examples/index.html Example of how to call the 'greet' command using the SDK with parameters. ```javascript $ await sdk.greet({ name: "world", loud: true }) ``` -------------------------------- ### Start List-Detail Demo Source: https://github.com/poe-platform/poe-code/blob/main/docs/qa/explorer-tui-library.md Starts the Explorer TUI library in list-detail mode for testing. ```bash npm run demo:explorer -- --mode list-detail-mode ``` -------------------------------- ### Install Poe Code Review Source: https://github.com/poe-platform/poe-code/blob/main/packages/agent-code-review/README.md Installs repo-local starter profiles and prompts. Use `--force` to overwrite existing files. ```bash poe-code code-review install [--cwd ] [--force] ``` -------------------------------- ### Run CLI Command Source: https://github.com/poe-platform/poe-code/blob/main/packages/toolcraft-landing-page/examples/index.html Example of how to invoke the 'greet' command from the CLI with specified parameters. ```bash $ mytool greet --name world --loud ``` -------------------------------- ### Apple Container Preflight Failure (Service Stopped) Source: https://github.com/poe-platform/poe-code/blob/main/docs/plans/apple-container-e2e-runner.md Example output indicating a preflight failure due to the Apple Container service not running. It suggests how to start the service. ```text Preflight checks: ✓ Apple container installed ✓ Apple container platform supported ✗ Apple container service running: container system service is not running Start the service: container system start ``` -------------------------------- ### Install Pipeline Skill Source: https://github.com/poe-platform/poe-code/blob/main/docs/README_FULL.md Install the '/plan' pipeline skill and scaffold necessary pipeline files. Options include specifying an agent, installing locally or globally, and forcing the installation. ```bash poe-code pipeline install [--agent ] [--local | --global] [--force] ```