§01 · Walkthrough
Three steps.
Install the CLI, register adapters, write code against
useAdapter. Swap providers later by editing
one JSON file.
-
01 Install
Pick the CLI plus whichever adapters fill the categories your app needs. You can add more later.
npm install @openagentry/cli @openagentry/adapter-llm-cli @openagentry/adapter-wiki-fsThe CLI is the operator surface. Adapters are the providers behind each category — swap them later without touching app code.
-
02 Initialise a workspace
Register the adapters with the CLI. Writes .agentry/workspace.json with defaultEnv: 'dev'.
npx agentry init @openagentry/adapter-llm-cli @openagentry/adapter-wiki-fs$ npx agentry init @openagentry/adapter-llm-cli @openagentry/adapter-wiki-fs created .agentry/workspace.json (2 plugins · defaultEnv: dev)Pass --force to overwrite an existing workspace. The file is plain JSON — edit it directly when you want to.
-
03 Compose
Resolve adapters at runtime via useAdapter(category). The framework hands back whichever provider you registered.
// app.ts import { useAdapter } from '@openagentry/core'; // "the LLM" — whichever adapter the workspace registered for the llm category. const llm = useAdapter('llm'); const response = await llm.generate({ prompt: 'Write me a haiku about adapters.', maxTokens: 200, }); // "the wiki" — the workspace's wiki adapter. const wiki = useAdapter('wiki'); await wiki.write('workspace/notes/haiku.md', response.text);Confirm what loaded:
$ npx agentry capabilities llm * llm-cli (@openagentry/adapter-llm-cli) wiki * wiki-fs (@openagentry/adapter-wiki-fs)