agi-core
v1.0.5
Published
Universal Artificial General Intelligence Framework - Advanced AI orchestration, automation, and cognitive computing
Maintainers
Readme
AGI Core
A powerful AI-powered CLI assistant for software engineering. Chat with AI, execute tools, edit files, run commands, and automate complex development tasks - all from your terminal.
Features
- Interactive Chat - Conversational AI interface with streaming responses
- Tool Execution - Read/write/edit files, execute commands, search code
- Git Integration - Built-in git status, diff, commit, branch management
- Auto-Run Mode - AI autonomously completes multi-step tasks
- Session Persistence - Resume conversations across sessions
- Retry Logic - Automatic retry with exponential backoff for reliability
Installation
# Install globally
npm install -g agi-core
# Or install from source
git clone https://github.com/your-org/agi-core.git
cd agi-core
npm install
npm run build
npm linkRequirements: Node.js 20.0.0+
Quick Start
# Set your API key
export OPENAI_API_KEY=your_key_here
# Start interactive mode
agi
# Quick one-shot query
agi -q "explain this error" < error.logCommands
Chat & Configuration
| Command | Description |
|---------|-------------|
| /key <key> | Set OpenAI API key |
| /model <name> | Switch AI model (gpt-4o, gpt-4, etc.) |
| /clear | Clear conversation history |
| /history | View/manage conversation history |
| /c | Toggle auto-run mode |
Information
| Command | Description |
|---------|-------------|
| /help | Show all commands |
| /status | System status |
| /stats | Session statistics |
| /tools | List available AI tools |
Session
| Command | Description |
|---------|-------------|
| /toggle <mode> | Toggle stream/verbose/autosave |
| exit / quit / q | Exit CLI |
AI Tools
The AI has access to these tools for completing tasks:
File Operations
read_file- Read file contentswrite_file- Create or overwrite filesedit_file- Make precise text replacementslist_directory- List directory contentssearch_files- Search by filename or content
Code Search
grep_search- Regex pattern searchfind_definition- Find function/class definitions
Execution
execute_command- Run shell commands (with safety checks)
Git
git_status- View modified/staged/untracked filesgit_diff- Show file changesgit_log- View commit historygit_commit- Stage and commit changesgit_branch- Manage branches
Web
web_search- Search the webfetch_url- Fetch URL content
Modes
Stream Mode (default: on)
Displays AI responses character-by-character as they're generated.
Auto-Run Mode (default: on)
When enabled, the AI will automatically continue executing tasks until completion without waiting for user input. Toggle with /c.
Verbose Mode (default: off)
Shows additional details like response timing and tool result previews.
AutoSave Mode (default: off)
Automatically saves conversation history after each exchange.
Keyboard Shortcuts
| Shortcut | Action |
|----------|--------|
| Ctrl+C | Interrupt / Exit |
| Ctrl+D | Exit |
| Ctrl+L | Clear screen |
| ↑ / ↓ | Navigate command history |
Session Persistence
AGI Core automatically saves and restores your conversation:
- Sessions persist for 24 hours within the same workspace
- Use
/history saveto manually save - Use
/history clearto clear saved history - Use
/clearto start a fresh conversation
When resuming a session, you'll see:
↻ Resumed session with X previous messages
Use /clear to start fresh or /history to see detailsError Handling
AGI Core includes intelligent error handling:
- Automatic Retry - Retries on rate limits (429), server errors (5xx), and network issues
- Exponential Backoff - Waits progressively longer between retries
- Recovery Suggestions - Provides helpful tips when errors occur
Configuration
Configuration is stored in ~/.agi/:
~/.agi/
├── config.json # API keys, model preferences, mode settings
└── history.json # Saved conversation historyCLI Options
agi [options]
Options:
-v, --version Show version
-h, --help Show help
-q, --quick Quick mode (non-interactive single query)
--model <name> Select model
--advanced Enable advanced featuresExamples
Code Editing
❯ read the main.ts file and fix any TypeScript errorsGit Operations
❯ check git status and commit all changes with a descriptive messageCode Search
❯ find all files that import the UserService classFile Operations
❯ create a new React component called Button in src/componentsCommand Execution
❯ run the tests and fix any failuresDevelopment
# Build
npm run build
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Clean build
npm run cleanProject Structure
src/
├── bin/
│ ├── agi.ts # Main CLI entry point
│ └── ui.ts # UI components and theming
├── core/
│ └── agi.ts # Core AGI framework
├── tools/
│ └── execution.ts # Command execution utilities
└── __tests__/ # Test suitesLicense
MIT
AGI Core - AI-powered development from your terminal
