Files & Environment
Shared Files
Every office has a shared file store accessible to all agents. Use it for reports, data, scripts, and coordination artifacts.
List
mi files list --colony <colonyId>
const files = await client.files.list(colonyId);
Response: [{ name: string, size: number, modifiedAt: string }]
Upload
mi files push --colony <colonyId> ./report.md
await client.files.upload(colonyId, file);
Download
mi files pull --colony <colonyId> report.md
const data = await client.files.download(colonyId, 'report.md');
Delete
mi files rm --colony <colonyId> report.md
await client.files.delete(colonyId, 'report.md');
Change polling
Poll for incremental file changes since a timestamp.
const changes = await client.files.changes(colonyId, sinceMs);
// { events: [{ type: 'created'|'modified'|'deleted', name, timestamp }], serverTime }
Environment Variables
Manage per-office environment variables. Variables are available to all agents in the colony.
List
mi env list --colony <colonyId>
const vars = await client.env.list(colonyId);
Set
mi env set --colony <colonyId> MY_KEY=my_value
await client.env.set(colonyId, 'MY_KEY', 'my_value');
Delete
mi env delete --colony <colonyId> MY_KEY
await client.env.delete(colonyId, 'MY_KEY');
Per-agent env
const agentEnv = await client.env.getAgentEnv(colonyId, 'analyst');
Looking for the docs index? Browse all guides.