Ai-Punk is an open source AI-powered software development assistant hosted on GitHub and developed by developer Netsky. It is based on the LangChain ReAct model, combined with modern AI models, to help users automate programming tasks.Ai-Punk's core feature is a completely transparent thinking process, allowing users to view every step of the AI's reasoning in real time. The project is modular in design, providing features such as file manipulation, code search, terminal commands, etc., and supporting multi-language interactions (English and Russian).Ai-Punk emphasizes security, restricting all operations to a specified working directory, making it suitable for developers, programmers, and users who need to automate tasks. The code is public, the community is free to contribute, the project is active and frequently updated.
Function List
- Fully transparent thinking process: Real-time display of the AI's reasoning steps to help users understand the logic of the operation.
- Autonomous tasking: AI can independently plan and execute complex programming tasks.
- Modular Architecture: Clear code structure and separation of functional modules for easy maintenance and expansion.
- Safe Workspace: All operations are restricted to user-selected directories to ensure data security.
- Rich Toolset: Support for file manipulation, searching, terminal commands and code editing.
- Beautiful terminal interface: Provides an intuitive terminal UI that shows the complete process.
- Multi-language support: Automatically detects the user's language and supports English and Russian interaction.
- Intelligent File Search: Supports semantic search and fuzzy matching to improve the efficiency of document finding.
- High Performance Integration: Runs fast with LangChain optimization tools.
Using Help
Installation process
To use Ai-Punk, you need to get the code from the GitHub repository and configure the runtime environment. Here are the detailed steps:
- Clone or download code
interviewshttps://github.com/netsky-devel/Ai-Punk
Click on the "Code" button and select "Download ZIP" to download the source code, or clone it using the Git command:git clone https://github.com/netsky-devel/Ai-Punk.git
After cloning, go to the project directory:
cd Ai-Punk
- Installation of dependencies
Ai-Punk depends on Python 3.8+ and specific libraries. Make sure Python is installed, then run the following command to install the dependencies:pip install -r requirements.txt
Dependencies include LangChain (for AI model integration), Rich (for endpoint interface beautification), and more, as detailed in the
requirements.txt
The - Configuring AI Service Providers
Ai-Punk requires a connection to an AI service (such as OpenAI, Google, or Anthropic). Run the main program and select configuration options:python main.py
Select "1 - Setup AI Provider" in the interface and enter your API key. The key should be obtained from the AI service provider's website. The configuration information will be saved to the
config/models.py
or in an environment variable. - Selecting a working directory
After running the program, select "2 - Select Working Directory" to specify the working directory for the operation.Ai-Punk ensures that all file operations are restricted to this directory for security. - Initializing the AI Agent
Select "3 - Initialize Agent" to initialize the AI agent. The system loads the configuration and prepares the toolset. - Starting Interaction
Select "4 - Start Chat with Agent" to enter the interactive mode. The user can enter a task command and the AI will automatically execute and display the reasoning process.
Main Functions
The core feature of Ai-Punk is the automation of programming tasks, which is described in detail below:
- Fully transparent thinking process
What makes Ai-Punk unique is the real-time display of the AI's reasoning steps. For example, when a user asks to analyze the structure of a project, the terminal displays:╭─ 🧠 Agent Thinking (Step 1) ───────────────────────────────╮ │ 需要先分析项目结构,了解代码库内容。开始列出目录文件。│ ╰──────────────────────────────────────────────────────────╯
The AI then calls
list_directory
tool that lists the contents of the catalog and explains the results. The user can clearly see each step of the operation through the terminal interface. - Autonomous tasking
AI can accomplish complex tasks on its own. For example, if the user types "add error handling to main.py", the AI will:- retrieve
main.py
file (using theread_file
(Tools). - Analyze the structure of the code and identify locations where error handling needs to be added.
- utilization
edit_file
tool inserts a try-catch statement. - Displays the modified code and explains the change logic.
- retrieve
- Intelligent File Search
Ai-Punk provides semantic search and fuzzy matching. The user types "find all profiles" and the AI calls thefile_search
tool, which scans the directory and returns relevant files (such as theconfig.json
). The search supports regular expressions and semantic analysis. Example:python main.py --search "config.*\.json"
The results will be sorted by relevance, showing the file path and a summary of the contents.
- file operation
Ai-Punk supports a wide range of file operations:- Listing of catalogs: Run
list_directory
tool that displays directory contents and file details. - Read file: Use
read_file
, supports syntax highlighting of code. - Edit file: By
edit_file
, supports find and replace and batch modification. - Delete file: Use
delete_file
The system ensures secure deletion and automatic backups.
For example, deleting an old backup file:
python main.py --delete "backup_*.bak"
The AI validates the file and prompts the user for confirmation.
- Listing of catalogs: Run
- Terminal command execution
Users can access therun_terminal
tool to execute terminal commands. Example:python main.py --terminal "git status"
Commands are run in a controlled environment to prevent accidental operation.
Featured Function Operation
- Beautiful terminal interface
Ai-Punk uses the Rich library to create an intuitive terminal UI that displays reasoning processes, operation results, and error messages. The interface supports color highlighting and structured output. For example, when performing a file search, the results are displayed in a table with the file name, path, and relevance score. - Multi-language support
Ai-Punk automatically detects the language of user input and supports both English and Russian. For example, if the user types "создай новый файл config.json", the AI will respond in Russian and create the file:python main.py --create "config.json"
The language is configured in the
src/localization/
Catalog management, support for extending other languages. - Safe Workspace
All operations are restricted to the user-selected working directory. the AI uses thesrc/workspace/manager.py
Perform path validation to ensure that external files are not accessed. For example, try to access the../sensitive.txt
An error message is triggered.
caveat
- dependency check: Make sure all dependencies are installed before running, check
requirements.txt
Completeness. - API Configuration: An unconfigured API key will cause the run to fail. Refer to
env.example
Setting environment variables. - error detection: When a runtime error is reported, view the detailed error message output from the terminal, or check the
logs/
log file in the directory. - Update Code: Regular operation
git pull
Get the latest code and stay synchronized with the official repositories.
application scenario
- Codebase Analysis
When developers need to quickly understand the structure of a large project, Ai-Punk automatically scans the directory and generates a report on the file structure, which is ideal for taking over a new project or code review. - Automated code modification
When programmers need to add error handling or refactor code in bulk, Ai-Punk quickly edits multiple files, inserts standard code snippets, and saves time on manual operations. - Document management and cleanup
When development teams need to clean up old backup files or organize project directories, Ai-Punk's Secure File Manipulation tool gets the job done efficiently. - Multi-language development support
When multinational teams interact in English or Russian, Ai-Punk automatically adapts the language to provide a consistent development experience. - Learning and Debugging
Programming beginners can learn how AI analyzes and solves problems through a transparent thought process, suitable for educational scenarios.
QA
- What AI models does Ai-Punk support?
Support for models from OpenAI, Google, and Anthropic is configured in thesrc/config/models.py
Set in. - How do I ensure safe operation?
Ai-Punk restricts all operations to selected directories, using relative path validation to prevent access to external files. All file operations are logged. - How can I extend the new features?
Fork repository, in thesrc/tools/
Add new tool module, updatesrc/agent/wrappers/factory.py
and then submit the Pull Request. - What about slow running?
Check network connectivity (AI API calls require a stable network) and make sure that optimized dependencies (such as the latest version of LangChain) are installed. - How do I switch languages?
Ai-Punk automatically detects the input language, eliminating the need to manually switch. The language file is available in thesrc/localization/messages/
Middle Management.