
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@bernierllc/braingrid-cli-wrapper
Advanced tools
Type-safe wrapper for the BrainGrid CLI that provides a clean, programmatic interface for interacting with BrainGrid projects, requirements, and tasks.
This package provides atomic utilities for interacting with the BrainGrid CLI in a type-safe manner. It wraps BrainGrid CLI commands with Zod schema validation, ensuring type safety and proper error handling.
execa and zodnpm install @bernierllc/braingrid-cli-wrapper
import {
createIdea,
listProjects,
createProject,
listRequirements,
updateRequirementStatus,
createTask
} from '@bernierllc/braingrid-cli-wrapper';
// Create a new project
const project = await createProject('My Project', 'Project description');
console.log(`Created project ${project.id}`);
// List all projects
const projects = await listProjects();
console.log(`Found ${projects.length} projects`);
// Create a new requirement (IDEA)
const requirement = await createIdea('Add OAuth2 authentication', project.id);
console.log(`Created requirement ${requirement.id} with status ${requirement.status}`);
// List requirements
const requirements = await listRequirements(project.id);
console.log(`Found ${requirements.length} requirements`);
// Update requirement status
await updateRequirementStatus(requirement.id, 'PLANNED');
console.log(`Updated requirement to PLANNED status`);
// Create a task under a requirement
const task = await createTask(requirement.id, {
title: 'Build login UI',
description: 'Create login form component',
tags: ['DEV', 'frontend'],
dependencies: []
});
console.log(`Created task ${task.id}`);
createIdea(prompt: string, projectId?: string): Promise<BrainGridRequirement>Creates a new requirement (IDEA) in BrainGrid.
Input:
prompt (string, required): Description of the requirement/ideaprojectId (string, optional): Project ID to associate with the requirementOutput:
BrainGridRequirement object with:
id: Requirement IDprojectId: Associated project IDtitle: Requirement titlestatus: Requirement status (IDEA, PLANNED, IN_PROGRESS, COMPLETED, CANCELLED, PAUSED)description: Optional descriptioncreatedAt: Optional creation timestampupdatedAt: Optional update timestampExample:
const req = await createIdea('Add user authentication system');
// { id: 'req-123', projectId: 'proj-456', title: 'Add user authentication system', status: 'IDEA' }
listProjects(): Promise<BrainGridProject[]>Lists all projects in BrainGrid.
Input: None
Output:
BrainGridProject objects with:
id: Project IDname: Project namedescription: Optional project descriptionExample:
const projects = await listProjects();
// [{ id: 'proj-1', name: 'My Project', description: 'Project description' }]
createProject(name: string, description?: string): Promise<BrainGridProject>Creates a new project in BrainGrid.
Input:
name (string, required): Project namedescription (string, optional): Project descriptionOutput:
BrainGridProject objectExample:
const project = await createProject('My Project', 'Project description');
// { id: 'proj-123', name: 'My Project', description: 'Project description' }
listRequirements(projectId?: string): Promise<BrainGridRequirement[]>Lists requirements, optionally filtered by project.
Input:
projectId (string, optional): Filter by project IDOutput:
BrainGridRequirement objectsExample:
// List all requirements
const allRequirements = await listRequirements();
// List requirements for a specific project
const projectRequirements = await listRequirements('proj-123');
// [{ id: 'req-1', projectId: 'proj-123', title: 'Add auth', status: 'IDEA' }]
updateRequirementStatus(requirementId: string, status: RequirementStatus): Promise<void>Updates a requirement's status.
Input:
requirementId (string, required): Requirement ID to updatestatus (RequirementStatus, required): New status (IDEA, PLANNED, IN_PROGRESS, COMPLETED, CANCELLED, PAUSED)Output: Promise that resolves when update is complete
Example:
await updateRequirementStatus('req-123', 'PLANNED');
await updateRequirementStatus('req-123', 'IN_PROGRESS');
await updateRequirementStatus('req-123', 'COMPLETED');
createTask(reqId: string, options: CreateTaskOptions): Promise<BrainGridTask>Creates a task under a requirement.
Input:
reqId (string, required): Requirement IDoptions (CreateTaskOptions, required):
title (string, required): Task titledescription (string, optional): Task descriptiontags (string[], optional): Task tagsdependencies (string[], optional): Task dependency IDsOutput:
BrainGridTask object with:
id: Task IDreqId: Parent requirement IDtitle: Task titlestatus: Task status (TODO, READY, BLOCKED, IN_PROGRESS, COMPLETED, FAILED, PAUSED)description: Optional descriptiontags: Optional array of tagsdependencies: Optional array of dependency IDsassignedTo: Optional assignee IDcreatedAt: Optional creation timestampupdatedAt: Optional update timestampmetadata: Optional metadata objectExample:
const task = await createTask('req-123', {
title: 'Build login UI',
description: 'Create login form component',
tags: ['DEV', 'frontend'],
dependencies: ['task-100']
});
// { id: 'task-456', reqId: 'req-123', title: 'Build login UI', status: 'TODO', ... }
listTasks(options?: ListTasksOptions): Promise<BrainGridTask[]>Lists tasks with optional filters.
Input:
options (ListTasksOptions, optional):
reqId (string, optional): Filter by requirement IDstatus (TaskStatus[], optional): Filter by status arraytags (string[], optional): Filter by tags arrayOutput:
BrainGridTask objectsExample:
// List all tasks
const allTasks = await listTasks();
// List tasks for a specific requirement
const reqTasks = await listTasks({ reqId: 'req-123' });
// List tasks by status
const inProgressTasks = await listTasks({ status: ['IN_PROGRESS'] });
// Combine filters
const filteredTasks = await listTasks({
reqId: 'req-123',
status: ['TODO', 'READY'],
tags: ['DEV']
});
updateTaskStatus(taskId: string, options: UpdateTaskOptions): Promise<void>Updates task status and metadata.
Input:
taskId (string, required): Task ID to updateoptions (UpdateTaskOptions, optional):
status (TaskStatus, optional): New task statusassignedTo (string, optional): Assignee IDmetadata (Record<string, unknown>, optional): Metadata objectOutput: Promise that resolves when update is complete
Example:
// Update task status
await updateTaskStatus('task-123', { status: 'IN_PROGRESS' });
// Update with assignee
await updateTaskStatus('task-123', {
status: 'IN_PROGRESS',
assignedTo: 'user-456'
});
// Update with metadata
await updateTaskStatus('task-123', {
status: 'IN_PROGRESS',
metadata: { progress: 50, notes: 'Half done' }
});
BrainGridProjectinterface BrainGridProject {
id: string;
name: string;
description?: string;
}
BrainGridRequirementinterface BrainGridRequirement {
id: string;
projectId: string;
title: string;
status: RequirementStatus;
description?: string;
createdAt?: string;
updatedAt?: string;
}
BrainGridTaskinterface BrainGridTask {
id: string;
reqId: string;
title: string;
status: TaskStatus;
description?: string;
tags?: string[];
dependencies?: string[];
assignedTo?: string;
createdAt?: string;
updatedAt?: string;
metadata?: Record<string, unknown>;
}
RequirementStatustype RequirementStatus = 'IDEA' | 'PLANNED' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELLED' | 'PAUSED';
TaskStatustype TaskStatus = 'TODO' | 'READY' | 'BLOCKED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'PAUSED';
The package throws BrainGridCliError when CLI commands fail:
class BrainGridCliError extends Error {
command: string;
exitCode: number;
stderr: string;
}
Example:
import { createIdea, BrainGridCliError } from '@bernierllc/braingrid-cli-wrapper';
try {
const req = await createIdea('Test requirement');
} catch (error) {
if (error instanceof BrainGridCliError) {
console.error(`CLI command failed: ${error.command}`);
console.error(`Exit code: ${error.exitCode}`);
console.error(`Error output: ${error.stderr}`);
}
}
BRAINGRID_CLI_PATH: Custom path to the BrainGrid CLI executable (defaults to 'braingrid')Example:
export BRAINGRID_CLI_PATH=/custom/path/braingrid
import {
createProject,
listProjects,
createIdea,
listRequirements,
updateRequirementStatus,
createTask,
listTasks,
updateTaskStatus
} from '@bernierllc/braingrid-cli-wrapper';
async function workflow() {
// 1. Create or list projects
const project = await createProject(
'My Project',
'Authentication system project'
);
// Or list existing projects
const projects = await listProjects();
console.log(`Found ${projects.length} projects`);
// 2. Create a requirement
const requirement = await createIdea(
'Build user authentication system',
project.id
);
// 3. List and update requirements
const requirements = await listRequirements(project.id);
console.log(`Project has ${requirements.length} requirements`);
await updateRequirementStatus(requirement.id, 'PLANNED');
// 4. Create tasks
const task1 = await createTask(requirement.id, {
title: 'Design authentication flow',
tags: ['DESIGN']
});
const task2 = await createTask(requirement.id, {
title: 'Implement login endpoint',
tags: ['DEV', 'backend'],
dependencies: [task1.id]
});
// 5. List tasks
const tasks = await listTasks({ reqId: requirement.id });
console.log(`Created ${tasks.length} tasks`);
// 6. Update task status
await updateTaskStatus(task1.id, { status: 'COMPLETED' });
await updateTaskStatus(task2.id, {
status: 'IN_PROGRESS',
assignedTo: 'user-123'
});
// 7. Mark requirement as in progress
await updateRequirementStatus(requirement.id, 'IN_PROGRESS');
}
import { createIdea, BrainGridCliError } from '@bernierllc/braingrid-cli-wrapper';
async function createRequirementSafely(prompt: string) {
try {
const req = await createIdea(prompt);
return req;
} catch (error) {
if (error instanceof BrainGridCliError) {
console.error(`BrainGrid CLI error: ${error.message}`);
console.error(`Command: ${error.command}`);
console.error(`Exit code: ${error.exitCode}`);
console.error(`Stderr: ${error.stderr}`);
throw new Error('Failed to create requirement');
}
throw error;
}
}
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
Status: not-applicable
This is a pure utility core package with no dependencies. Logging is handled by consuming packages. Does not require @bernierllc/logger integration.
Status: ready
Complete API documentation with TypeScript types and examples available for documentation suite integration.
Status: not-applicable
Pure utility package with no runtime dependencies. NeverHub integration is handled at the service-level packages that consume this utility. Does not require @bernierllc/neverhub-adapter integration.
This package follows the core package rules:
execa, zod)index.tsanyMIT License - see LICENSE file for details.
FAQs
Type-safe wrapper for BrainGrid CLI
We found that @bernierllc/braingrid-cli-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.