Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/souvik-223/kernel-aipilot
An NPM based AI Agent for quick and feasible AI code copiloting without extensions and is extremly useful in SSH based cloud terminals.
https://github.com/souvik-223/kernel-aipilot
ai nodejs npm npm-package typescript
Last synced: 14 days ago
JSON representation
An NPM based AI Agent for quick and feasible AI code copiloting without extensions and is extremly useful in SSH based cloud terminals.
- Host: GitHub
- URL: https://github.com/souvik-223/kernel-aipilot
- Owner: Souvik-223
- Created: 2025-01-03T18:28:02.000Z (23 days ago)
- Default Branch: main
- Last Pushed: 2025-01-06T19:39:09.000Z (20 days ago)
- Last Synced: 2025-01-06T20:32:23.467Z (20 days ago)
- Topics: ai, nodejs, npm, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/kernel-aipilot
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kernal Pilot
A Next.js package that provides AI-powered file analysis capabilities.
## Installation
```bash
npm install kernel-pilot
```## Usage
1. Start the analysis server:
```bash
npx kernel-pilot start
```2. In your Next.js application:
```typescript
import { analyzeFile, FileAnalyzer } from 'kernal-pilot';// Using the React component
function MyComponent() {
const handleAnalysisComplete = (result) => {
console.log('Analysis result:', result);
};return ;
}// Or using the function directly
async function analyzeMyFile() {
try {
const result = await analyzeFile({
filePath: '/path/to/file',
prompt: 'Your analysis prompt'
});
console.log('Analysis result:', result);
} catch (error) {
console.error('Analysis failed:', error);
}
}
```
Or3. Use Code Generator:
```typescript
import { CodeGenerator } from 'kernal-pilot';function MyComponent() {
const handleGenerationComplete = (filePath: string) => {
console.log('Code generated at:', filePath);
};return (
);
}
```
## API```typescript
// Using fetch
const response = await fetch('http://localhost:4561/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'Create functions with error cases like division by zero',
filename: 'error-cases.js'
})
});const result = await response.json();
console.log('Generated file path:', result.filePath);
```
### analyzeFile(options)Analyzes a file using AI.
Parameters:
- `options.filePath`: Path to the file to analyze
- `options.prompt`: Prompt for the AI analysisReturns: Promise with analysis results
### FileAnalyzer Component
React component for file analysis.
Props:
<<<<<<< HEAD
- `onAnalysisComplete`: Callback function called with analysis results
=======
- `onAnalysisComplete`: Callback function called with analysis results
>>>>>>> main