Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A Python package that generates complex software projects and fixes errors in your code using OpenAI's GPT API.
ScriptMonkey is an AI-powered CLI tool and Python library that reimagines how projects are built. It doesn’t just generate simple scripts or templates like traditional LLMs—it creates entire, multi-file, multi-directory projects with fully custom code. Complex software projects can be generated in seconds based on your natural language descriptions, providing everything you need, from models and routes to templates and configuration files. With ScriptMonkey, you can instantly bootstrap new ideas or start complex projects without the tedious setup. The tool is perfect for developers looking to quickly prototype, experiment, or build production-ready applications without having to write boilerplate code manually.
Importantly, ScriptMonkey is versatile and can be used to build any type of software project in any programming language. Whether you’re working with Python, JavaScript, Java, C++, or any other language, ScriptMonkey can generate project structures and provide tailored code. Additionally, its context-aware Q&A feature allows you to ask technical questions about projects in any language, with or without providing files for context. You can even use your default editor for longer, multi-line prompts, ensuring that ScriptMonkey can adapt to your specific needs.
Click the image above or watch the video directly on YouTube.
To install ScriptMonkey, simply run:
pip install scriptmonkey
scriptmonkey
CLI ToolScriptMonkey can generate a complete, custom-coded project structure based on a description you provide. This feature helps you quickly set up new projects with the necessary files and folders.
Run the following command in your terminal:
scriptmonkey
A text editor will open (e.g., nano
, vim
, or notepad
depending on your environment). Follow the on-screen instructions to provide a detailed description of your project.
Save and close the editor. ScriptMonkey will then:
README.md
with installation instructions and usage details.I need a Flask-based web application for managing a book library. The application should include:
- User authentication (login, registration, password reset).
- Models for Users, Books, and Authors using SQLAlchemy.
- A REST API with routes for adding, updating, and deleting books and authors.
- An admin dashboard for managing users and viewing statistics.
- HTML templates for user login, book list, and book detail views.
- The database should use PostgreSQL.
- Include environment-specific configurations for development and production.
ScriptMonkey will use this description to create a project structure and code files for you in a directory named generated_project
.
scriptmonkey --ask
CLI ToolScriptMonkey can help answer your technical questions, whether or not you provide code files for context. This feature allows you to leverage the power of ChatGPT to ask questions about files, clarify concepts, get code reviews, or understand best practices in various programming languages.
Pass a question directly:
For quick, short prompts, you can directly pass your question using the --ask
parameter:
scriptmonkey --ask "What are the best practices for database indexing?"
Use your default editor for longer prompts:
If you need to provide a more detailed or multi-line prompt, simply use --ask
without specifying a question. This will open up your default text editor (e.g., vim
, nano
, notepad
) where you can write out your question or prompt:
scriptmonkey --ask
After you write your question in the editor and save and close it, ScriptMonkey will use the content as the question. This is especially useful for longer or more complex queries that require more explanation.
Ask a question about specific local files:
scriptmonkey --ask "Can you help me optimize this function?" --files ./path/to/file1.py ./path/to/file2.js
The --files
flag allows you to provide specific files as context for your question. ScriptMonkey will include the contents of these files in its analysis, allowing it to reference the actual code or data you are working with. This is particularly useful for getting detailed feedback on specific code snippets, debugging issues, or seeking advice on how to improve certain parts of your project.
When you use --files
, ScriptMonkey will read the contents of each provided file, include them in the prompt, and tailor its response based on the combined context of your question and the file contents. This feature ensures that you get precise, context-aware answers, helping you solve code challenges or understand complex concepts more effectively.
Ask a question with a directory tree:
scriptmonkey --ask "How do I organize this project better?" --tree
The --tree
flag will include a tree representation of the current working directory in the context for your question. This is particularly useful when you want to get feedback on the structure of your codebase or when your question relates to the project organization. It can be used in tandem with the --files
flag to provide additional context about how those files fit within the larger context of the project.
ScriptMonkey will analyze your question and any provided files or the directory tree to give a detailed, markdown-formatted response with explanations and code suggestions, if applicable. This feature is great for in-depth guidance on code optimization, architecture, or general programming questions.
--copy
ScriptMonkey's new --copy
feature is designed to streamline the process of copying critical code files and project structure details into your clipboard, making it easier to ask questions to LLMs like ChatGPT or Claude. This feature formats the copied content in a neat way that includes file contents and the directory tree, making it simple to paste into a conversation for contextual help.
Copy file contents directly:
You can use the --copy flag to quickly copy the contents of specified files into your clipboard, neatly formatted for easy sharing with an LLM. When combined with the --files flag, ScriptMonkey will copy the contents of the selected files along with a complete directory tree of your project. This provides additional context, helping LLMs better understand your project’s structure:
scriptmonkey --copy --files path/to/file1.py path/to/file2.js
Your files and project directory tree are automatically copied to your clipboard in the format:
- - - - - - - - - -
Here are some details about the project.
# path/to/file1.py
<content from file1.py>
- - - - - - - - - -
# path/to/file2.js
<content from file2.js>
- - - - - - - - - -
# PROJECT TREE
<directory structure>
scriptmonkey.run()
ScriptMonkey doesn't just build projects; it also makes debugging a breeze.
scriptmonkey
in your Python script.scriptmonkey.run()
to activate the error handler.import scriptmonkey
# Enable ScriptMonkey's error handler
scriptmonkey.run()
# Intentional error for testing
def add(a, b):
return a + b # This will fail if b is a string
print(add(2, "3")) # ScriptMonkey will automatically fix this error and update the file.
Once an error occurs, ScriptMonkey will:
If you haven't set your OpenAI API key yet or need to update it, you can do so with the following command:
python3 -m scriptmonkey --set-api-key your-api-key
This will store the API key in a config locally and use it for all future interactions with OpenAI.
Option 1: Environment Variable
You can set up your API key as an environment variable:
export OPENAI_API_KEY='your-api-key'
Option 2: Entering the API Key When Prompted
If ScriptMonkey does not find an API key in your environment variables, it will prompt you to enter your key. Once entered, it will save the key to a configuration file for future use.
Option 3: Using the --set-api-key
Command
Use the --set-api-key
command as shown above to set or update your API key easily.
Let ScriptMonkey take care of your Python errors and project setup so you can focus on building!
FAQs
A Python package that generates complex software projects and fixes errors in your code using OpenAI's GPT API.
We found that scriptmonkey demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.