CliNotFoundError
Thrown when the Droid CLI binary cannot be found on the system.
Import
import { CliNotFoundError, ensureDroidCli } from '@activade/droid-sdk';
Properties
searchedPaths
readonly searchedPaths: string[]
List of paths that were searched for the CLI.
Usage
try {
await droid.exec('Hello');
} catch (error) {
if (error instanceof CliNotFoundError) {
console.log('CLI not found in:', error.searchedPaths);
// Auto-install the CLI
await ensureDroidCli();
// Retry the operation
await droid.exec('Hello');
}
}
Common Causes
- CLI not installed - Run the installation script
- PATH not configured - Add CLI location to PATH
- Custom path not set - Configure
droidPathin Droid options
Solutions
Install the CLI
curl -fsSL https://app.factory.ai/cli | sh
Use Auto-installer
import { ensureDroidCli } from '@activade/droid-sdk/cli';
await ensureDroidCli({
onProgress: (p) => console.log(`[${p.phase}] ${p.message}`)
});
Specify Custom Path
const droid = new Droid({
droidPath: '/custom/path/to/droid'
});