inteliterm
v1.0.3
Published
A natural language terminal command executor - execute Unix commands using plain English powered by AI. Supports multiple AI providers: OpenAI, Anthropic (Claude), XAI (Grok), and DeepSeek.
Maintainers
Readme
Inteliterm
A natural language terminal command executor - execute Unix commands using plain English powered by AI. Supports multiple AI providers: OpenAI, Anthropic (Claude), XAI (Grok), and DeepSeek.
Installation
npm install -g intelitermOr use it locally:
npm install intelitermSetup
Choose Your AI Provider
Inteliterm supports multiple AI providers. Set your provider and API key:
OpenAI (Default)
export INTELITERM_PROVIDER=openai
export OPENAI_API_KEY="your-openai-api-key"
# or
export INTELITERM_API_KEY="your-openai-api-key"Anthropic (Claude)
export INTELITERM_PROVIDER=anthropic
export ANTHROPIC_API_KEY="your-anthropic-api-key"
# or
export INTELITERM_API_KEY="your-anthropic-api-key"XAI (Grok)
export INTELITERM_PROVIDER=xai
export XAI_API_KEY="your-xai-api-key"
# or
export INTELITERM_API_KEY="your-xai-api-key"DeepSeek
export INTELITERM_PROVIDER=deepseek
export DEEPSEEK_API_KEY="your-deepseek-api-key"
# or
export INTELITERM_API_KEY="your-deepseek-api-key"Note: If INTELITERM_PROVIDER is not set, it defaults to openai.
Usage
Command Line Interface
Execute commands directly:
inteliterm "kill process running in port 3000"
inteliterm "list all files in current directory"
inteliterm "find files larger than 100MB"Select Provider via CLI
You can override the provider for a single command:
inteliterm --provider anthropic "kill process running in port 3000"
inteliterm -p xai "list all files in current directory"Interactive Mode
Run without arguments for interactive mode:
intelitermThen type your requests in plain English:
inteliterm> kill process running in port 3000
inteliterm> show me disk usage
inteliterm> find all node_modules directoriesProgrammatic Usage
import { Inteliterm, AIProviderType } from 'inteliterm';
// Using default provider from environment
const inteliterm = new Inteliterm();
// Or specify provider explicitly
const inteliterm = new Inteliterm({
provider: 'anthropic' as AIProviderType,
apiKey: process.env.ANTHROPIC_API_KEY,
});
// Execute a command
const result = await inteliterm.execute('kill process running in port 3000');
console.log(result.output);
// Just get the suggested command without executing
const suggestion = await inteliterm.suggestCommand('list files in current directory');
console.log(suggestion.command); // e.g., "ls -la"Examples
"kill process running in port 3000"→lsof -ti:3000 | xargs kill -9"list all files in current directory"→ls -la"find files larger than 100MB"→find . -type f -size +100M"show disk usage"→df -h"show running processes"→ps aux
Supported AI Providers
| Provider | Model | Environment Variable | Notes |
|----------|-------|---------------------|-------|
| OpenAI | gpt-4o-mini | OPENAI_API_KEY | Default provider |
| Anthropic | claude-3-5-sonnet | ANTHROPIC_API_KEY | High quality responses |
| XAI | grok-beta | XAI_API_KEY | Requires XAI API access |
| DeepSeek | deepseek-chat | DEEPSEEK_API_KEY | Cost-effective option |
Safety Features
- Commands that may be destructive require confirmation before execution
- The AI is instructed to generate only safe Unix commands
- You can review the suggested command before execution
- All providers use the same safety guidelines
Requirements
- Node.js >= 14.0.0
- API key for at least one supported AI provider
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
