
codeforgeai
codeforge ai assistant cli backend engine
Repository Info
About This Server
codeforge ai assistant cli backend engine
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
🔧 CodeforgeAI
!CodeforgeAI !Python !License
🚀 Overview
CodeforgeAI is a powerful command-line developer tool that leverages AI to assist developers in their workflow. With a variety of commands and integration capabilities, it helps you analyze, generate, and improve code efficiently.
📋 Table of Contents
- Installation
- Configuration
- Commands Overview
- Core Features
- AI Models & Integration
- Web3 Development Tools
- Solana MCP Integration
- Vyper Smart Contract Development
- Advanced Usage
- Contributing
- License
- Integrations
🔌 Installation
Prerequisites
- Python 3.8 or higher
- Git
- Ollama (for local AI models)
Step-by-Step Installation of package codeforgeai
To install CodeforgeAI, follow these steps:
- Clone the repository:
git clone https://github.com/codeforge-ide/codeforgeai.git
cd codeforgeai
- Install the package in development mode:
pip install -e .
This command installs the package in "editable" mode, which means changes to the source code will be immediately reflected without needing to reinstall.
- Verify installation:
codeforgeai --help
You should see the help message with available commands.
⚙️ Configuration
CodeforgeAI uses a configuration file stored at ~/.codeforgeai.json. The first time you run a command, this file will be created with default settings.
View Current Configuration
codeforgeai config
Key Configuration Options
general_model: The AI model for general prompts (default: "tinyllama")code_model: The AI model for code-specific tasks (default: "qwen2.5-coder:0.5b")format_line_separator: Number of newlines between extracted code blocks (default: 5)
You can manually edit the config file to customize these settings.
📜 Commands Overview
CodeforgeAI offers a rich set of commands for various development tasks:
Basic Commands
| Command | Description |
|---|---|
analyze | Analyze the current working directory |
prompt | Process a user prompt with AI |
config | Run configuration checkup |
strip | Print tree structure after removing gitignored files |
explain | Explain code in a given file |
edit | Edit code in specified files or folders |
extract | Extract code blocks from file or string |
format | Format code blocks for readability |
command | Process a command request |
suggestion | Get quick code suggestions |
commit-message | Generate a commit message with gitmoji |
Secret AI Integration
| Command | Description |
|---|---|
secret-ai list-models | List available Secret AI models |
secret-ai test-connection | Test Secret AI connection |
secret-ai chat | Chat with Secret AI |
Web3 Development
| Command | Description |
|---|---|
web3 scaffold | Scaffold a new web3 project |
web3 analyze-contract | Analyze a smart contract |
web3 estimate-gas | Estimate gas costs for a smart contract |
web3 generate-tests | Generate tests for a smart contract |
web3 check-env | Check web3 development environment |
web3 install-deps | Install web3 dependencies |
Vyper Smart Contracts
| Command | Description |
|---|---|
vyper compile | Compile a Vyper smart contract |
vyper analyze | Analyze a Vyper smart contract |
vyper check | Check if Vyper is installed |
🔍 Core Features
🔄 Project Analysis
Analyze your entire project structure and understand its composition:
codeforgeai analyze
This will examine your project and create a .codeforge.json file with metadata about your codebase.
For continuous monitoring, use:
codeforgeai analyze --loop
💬 AI Prompting
Get AI assistance for coding tasks:
codeforgeai prompt "Create a function to calculate Fibonacci numbers"
📝 Code Explanation
Get explanations for code in a file:
codeforgeai explain path/to/file.py
✏️ Code Editing
Edit files according to a prompt:
codeforgeai edit src/ --user_prompt "Add error handling to all functions"
To include directories that might be gitignored:
codeforgeai edit build/ --user_prompt "Fix deprecated API calls" --allow-ignore
💡 Code Suggestions
Get quick code suggestions:
# For a specific line in a file
codeforgeai suggestion --file app.py --line 42
# For the entire file
codeforgeai suggestion --file app.py --entire
# For a code snippet
codeforgeai suggestion --string "def factorial(n):"
📊 Git Integration
Generate commit messages automatically:
codeforgeai commit-message
🧠 AI Models & Integration
CodeforgeAI works with various AI models:
Local Models (via Ollama)
By default, CodeforgeAI uses local models through Ollama:
tinyllamafor general promptsqwen2.5-coder:0.5bfor code-specific tasks
Secret AI SDK Integration
For advanced capabilities, CodeforgeAI integrates with Secret AI:
# Set your API key
export CLAIVE_AI_API_KEY=your_api_key_here
# Test connection
codeforgeai secret-ai test-connection
# List available models
codeforgeai secret-ai list-models
# Chat with Secret AI
codeforgeai secret-ai chat "How do I implement WebSockets in Node.js?"
⛓️ Web3 Development Tools
CodeforgeAI includes specialized tools for Web3 development:
Scaffold Projects
# Create a basic dApp
codeforgeai web3 scaffold my-dapp
# Create an NFT project
codeforgeai web3 scaffold my-nft --type nft
# Create a token project in a specific directory
codeforgeai web3 scaffold my-token --type token --output ~/projects
Smart Contract Analysis
codeforgeai web3 analyze-contract contracts/Token.sol
Gas Estimation
codeforgeai web3 estimate-gas contracts/Token.sol
Test Generation
codeforgeai web3 generate-tests contracts/Token.sol --output tests/
Environment Check
codeforgeai web3 check-env
Install Dependencies
# Minimal dependencies
codeforgeai web3 install-deps
# Full development environment
codeforgeai web3 install-deps --full
🚀 Solana MCP Integration
CodeforgeAI now supports the revolutionary Model Context Protocol (MCP) paradigm for Solana blockchain development! MCPs represent the next evolution in blockchain programming.
MCP Commands
Interact with Solana MCPs directly from the command line:
# Check Solana Agent status and configuration
codeforgeai solana status
# Check wallet balance
codeforgeai solana balance
codeforgeai solana balance --address <WALLET_ADDRESS>
# Send SOL transaction
codeforgeai solana transfer <DESTINATION_ADDRESS> <AMOUNT> --memo "Optional memo"
# Interact with an MCP
codeforgeai solana mcp interact <PROGRAM_ID> <ACTION_TYPE> --params '{"key": "value"}'
# Get MCP state
codeforgeai solana mcp state <PROGRAM_ID> <ACCOUNT_ADDRESS>
# Initialize MCP account
codeforgeai solana mcp init-account <PROGRAM_ID> <SPACE> --params '{"owner": true}'
Python API for MCPs
Build MCP-powered applications using our Python API:
from codeforgeai.integrations.solana_agent import SolanaAgentClient
# Initialize client
client = SolanaAgentClient()
# Check balance
balance = client.get_balance()
print(f"SOL Balance: {balance.get('balance')}")
# Interact with MCP
response = client.execute_mcp_action(
program_id="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
action_type="transfer",
params={"destination": "8ZUczU...", "amount": 1000}
)
# Read MCP state
state = client.read_mcp_state(
program_id="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
account_address="8ZUczUAUZbMbRFL4JgKMS9sHxwZXBAZGG3WQ4MaQULKZ"
)
print(f"Token Balance: {state.get('state', {}).get('balance')}")
For more information, see the Solana Agent MCP integration docs.
🐍 Vyper Smart Contract Development
CodeforgeAI includes specialized tools for building smart contracts using the Vyper language:
Check Vyper Installation
Check if the Vyper compiler is installed on your system:
codeforgeai vyper check
Compile Vyper Contracts
Compile a Vyper smart contract:
# Basic compilation (outputs ABI by default)
codeforgeai vyper compile contracts/SimpleAuction.vy
# Compile to get bytecode
codeforgeai vyper compile contracts/SimpleAuction.vy -f bytecode
# Compile with optimization for gas efficiency
codeforgeai vyper compile contracts/SimpleAuction.vy --optimize gas
# Compile for specific EVM version
codeforgeai vyper compile contracts/SimpleAuction.vy --evm-version paris
Analyze Vyper Contracts
Analyze a Vyper contract for features and patterns:
codeforgeai vyper analyze contracts/SimpleAuction.vy
This will detect common contract types like auctions, tokens, voting systems, and crowdfunding contracts based on the code patterns found in the examples.
Vyper Contract Examples
The tool comes with several example Vyper contracts demonstrating common patterns:
- Simple open auction
- Blind auction
- Safe remote purchases
- Crowdfunding
- Voting systems
- Company stock management
These examples show Vyper's focus on security and simplicity in smart contract development.
🔄 Advanced Usage
Command Processing
Determine if a request should be handled as code or terminal commands:
codeforgeai command "set up a React project with TypeScript"
Code Format Processing
Extract code blocks from files or strings:
codeforgeai extract --file response.md
Format code blocks for better readability:
codeforgeai format --file extracted_code.txt
Directory Structure Analysis
View your project structure without gitignored files:
codeforgeai strip
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgements
- Thanks to all contributors and users of CodeforgeAI
- Ollama for local AI model support
- Secret AI SDK for advanced AI capabilities
- The open-source community for inspiration and tools
Integrations
ZerePy Integration
CodeForgeAI includes a lightweight integration with ZerePy, allowing you to interact with ZerePy agents and services directly from your CodeForgeAI workflows.
With this integration, you can:
- Connect to ZerePy servers
- List and load ZerePy agents
- Execute agent actions
- Interact with ZerePy connections (Twitter, OpenAI, Ethereum, etc.)
- Send chat messages to agents
To use the ZerePy integration:
from codeforgeai.integrations.zerepy.zerepy_integration import ZerePyClient
# Initialize client
client = ZerePyClient()
# List available agents
agents = client.list_agents()
# Load an agent
client.load_agent("example")
# Execute an action
client.perform_action(
connection="openai",
action="generate-text",
params={
"prompt": "Write documentation for my code",
"system_prompt": "You are a technical writer",
"model": "gpt-4"
}
)
For more details, see the ZerePy integration documentation.
🤖 GitHub Copilot Integration
CodeforgeAI now features robust, modular integration with GitHub Copilot via the Copilot Language Server Protocol (LSP). This enables advanced AI code completion, suggestions, and authentication directly from the CLI or any GUI/IDE that wraps the CLI.
Copilot Subcommands
| Command | Description |
|---|---|
github copilot lsp | Install the Copilot language server globally (requires pnpm, yarn, or npm) |
github copilot login | Authenticate with GitHub Copilot (opens browser for OAuth) |
github copilot logout | Logout from GitHub Copilot |
github copilot status | Check Copilot authentication and connection status |
github copilot inline-completion --file <file> --line <line> --character <character> | Get inline code completion at a specific position |
github copilot panel-completion --file <file> --line <line> --character <character> | Get panel (multi-line) code completion at a specific position |
Usage Examples (CLI)
# Install Copilot language server globally
codeforgeai github copilot lsp
# Authenticate with Copilot (follow browser instructions)
codeforgeai github copilot login
# Logout from Copilot
codeforgeai github copilot logout
# Check Copilot status
codeforgeai github copilot status
# Get inline completion for a file at line 10, character 5
codeforgeai github copilot inline-completion --file app.py --line 10 --character 5
# Get panel completion for a file at line 20, character 0
codeforgeai github copilot panel-completion --file main.py --line 20 --character 0
Usage in IDEs/GUI
- Any IDE or GUI that can call these CLI subcommands can leverage Copilot's AI completions and authentication.
- For Flutter or Electron-based GUIs, simply invoke the relevant subcommand and parse the output for completions or status.
- The Copilot LSP client is modular and can be imported in Python for direct integration in custom tools.
Programmatic Usage (Python)
from codeforgeai.integrations.github_copilot import copilot
# Authenticate with Copilot
copilot.copilot_login()
# Get inline completion
result = copilot.CopilotLSPClient().inline_completion('app.py', 10, 5)
print(result)
Note: The Copilot LSP integration is fully modular and can be extended for advanced IDE features, such as real-time completions, document sync, and more.
Quick Start
Clone the repository
git clone https://github.com/codeforge-ide/codeforgeaiInstall dependencies
cd codeforgeai
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.