Skip to main content

SDKs

Official Python and TypeScript SDKs for the Nimbus API.

Python SDK

Install:

pip install nimbus-sdk

Quick start

from nimbus_sdk import NimbusClient

client = NimbusClient(api_key="nk_...")

# Run a task
task = client.tasks.run(
description="add rate limiting to /api/upload",
repo="acme/api"
)
task.wait()
print(task.pr_url)

# Run a built-in agent
task = client.agents.run("security-audit", repo="acme/api")
task.wait()

# Search codebase
results = client.search.query("where is rate limiting handled", repo="acme/api")
for r in results:
print(r.path, r.score)

Async usage

import asyncio
from nimbus_sdk import NimbusClient

async def main():
async with NimbusClient(api_key="nk_...") as client:
task = client.tasks.run("add tests for auth module", repo="acme/api")
await task.async_wait()
print(task.pr_url)

asyncio.run(main())

Resources

ResourceMethods
client.tasks.run() .get() .approve() .list()
client.agents.list() .run()
client.skills.list() .search() .install()
client.search.query()

TypeScript SDK

Install:

npm install @nimbus-ai/client

Quick start

import { NimbusClient } from '@nimbus-ai/client';

const client = new NimbusClient({ apiKey: 'nk_...' });

// Run a task
const task = await client.tasks.run({
description: 'add rate limiting to /api/upload',
repo: 'acme/api',
});
await task.wait();
console.log(task.prUrl);

// Run a built-in agent
const agentTask = await client.agents.run('security-audit', { repo: 'acme/api' });
await agentTask.wait();

// List agents by category
const agents = await client.agents.list('security');

Types

interface Task {
id: string;
description: string;
phase: string;
repoId: string;
workspaceId: string;
prUrl?: string;
error?: string;
}

interface Agent {
name: string;
category: string;
description: string;
estimatedPrs: string;
}

interface SearchResult {
path: string;
score: number;
summary: string;
}

TaskHandle

Both SDKs return a TaskHandle from .run():

# Python
task = client.tasks.run("...", repo="...")
task.wait(timeout=600) # blocks until complete
task.pr_url # the opened PR URL
task.phase # current phase

await task.async_wait() # async version
// TypeScript
const task = await client.tasks.run({ description: '...', repo: '...' });
await task.wait(60_000); // ms timeout
task.prUrl; // the opened PR URL
task.phase; // current phase