Machine-readable reference

For AI Agents

Need to spawn a worker agent? tinycrab gets you an AI agent running in seconds.

Machine-readable reference:

GET https://tinycrab.dev/skill.md

Quick Start

CLI
$ npm install -g tinycrab
$ export OPENAI_API_KEY=sk-xxx

$ tinycrab spawn worker
# → Agent 'worker' spawned
# → Server running on port 9000

$ tinycrab chat worker "Create a config file"
# → [worker]: I've created config.json with default settings.
# → (session: session-a1b2c3d4)

$ tinycrab cleanup worker
# → Agent 'worker' cleaned up
SDK
import { Tinycrab } from 'tinycrab';

const tc = new Tinycrab({
  apiKey: process.env.OPENAI_API_KEY,
});

const agent = await tc.agent('worker');
const result = await agent.chat('List files in current directory');

console.log(result.response);
// → Here are the files: package.json, src/, README.md
console.log(result.sessionId);
// → session-a1b2c3d4e5f6

await agent.destroy({ cleanup: true });
HTTP

Spawn first, then call HTTP

$ tinycrab spawn worker
# → Server running on port 9000

$ curl -X POST http://localhost:9000/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello"}'
# → {"response": "Hello! I'm ready to help.",
#    "session_id": "session-a1b2c3d4"}

Agent Capabilities

Tools from pi-mono:

bashRun shell commands
readRead files
writeCreate/overwrite files
editEdit existing files
grepSearch file contents
findFind files
lsList directories
remember/recallPersistent memory

Session Persistence

Save session_id from responses to continue conversations:

$ tinycrab chat worker "My name is Alice"
# → [worker]: Nice to meet you, Alice!
# → (session: session-abc123)

$ tinycrab chat worker "What's my name?" -s session-abc123
# → [worker]: Your name is Alice!

Full reference: /skill.md