@nanocollective/nanocoder
Version:
A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter
69 lines • 2.06 kB
TypeScript
import type { CustomCommand } from '../types/index.js';
export declare class CustomCommandLoader {
private commands;
private aliases;
private projectRoot;
private projectCommandsDir;
private personalCommandsDir;
private deprecationWarned;
constructor(projectRoot?: string);
/**
* Load all custom commands from both project and personal directories
*/
loadCommands(): void;
/**
* Check for deprecated .nanocoder/skills directories and warn
*/
private checkDeprecatedSkillsDirs;
/**
* Recursively scan directory for .md files, supporting directory-as-command
*/
private scanDirectory;
/**
* Load a single command file.
* If commandDir is provided, also load resources from its resources/ subdirectory.
*/
private loadCommand;
/**
* Load resources from a command's resources/ subdirectory
*/
private loadResources;
/**
* Get a command by name (checking aliases too)
*/
getCommand(name: string): CustomCommand | undefined;
/**
* Get all available commands
*/
getAllCommands(): CustomCommand[];
/**
* Get only commands that participate in auto-injection
* (those with triggers or tags defined)
*/
getAutoInjectableCommands(): CustomCommand[];
/**
* Get command suggestions for autocomplete
*/
getSuggestions(prefix: string): string[];
/**
* Find relevant commands for auto-injection based on user request
*/
findRelevantCommands(request: string, availableTools: string[]): CustomCommand[];
/**
* Calculate relevance score for a command against a user request
*/
private calculateRelevanceScore;
/**
* Check if commands directory exists
*/
hasCustomCommands(): boolean;
/**
* Get the project commands directory path
*/
getCommandsDirectory(): string;
/**
* Get the personal commands directory path
*/
getPersonalCommandsDirectory(): string;
}
//# sourceMappingURL=loader.d.ts.map