@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
30 lines • 898 B
JavaScript
export function parseInput(input) {
const trimmed = input.trim();
// Check for bash command (prefixed with !)
if (trimmed.startsWith('!')) {
const bashCommand = trimmed.slice(1);
return {
isCommand: false, // Not a regular command
isBashCommand: true,
bashCommand: bashCommand,
};
}
// Check for regular command (prefixed with /)
if (!trimmed.startsWith('/')) {
return { isCommand: false };
}
const commandText = trimmed.slice(1);
if (!commandText) {
return { isCommand: true, command: '', args: [], fullCommand: '' };
}
const parts = commandText.split(/\s+/);
const command = parts[0];
const args = parts.slice(1);
return {
isCommand: true,
command,
args,
fullCommand: commandText,
};
}
//# sourceMappingURL=command-parser.js.map