
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
code-prompt
Advanced tools
**CodePrompt** is a tool that crafts GPT prompts using your local code files. With the flexibility of `glob` patterns, you can effortlessly specify which files to incorporate into your prompt.
CodePrompt is a tool that crafts GPT prompts using your local code files. With the flexibility of glob patterns, you can effortlessly specify which files to incorporate into your prompt.
code-prompt generate '**/*.ts' -m "your prompt"
This command will search for all TypeScript files in your directory and its subdirectories. It then crafts a GPT prompt using the contents of these files, followed by the message "your prompt".
| CLI Output | Prompt Result |
|---|---|
![]() | ![]() |
glob patterns to easily select files for prompts.tiktoken for accurate token metrics.npm install -g code-prompt
Incorporate CodePrompt directly into your projects for a more programmatic approach.
import CodePrompt from 'code-prompt'
const result = await CodePrompt('**/*.ts', {
prefixPrompt: 'Considering the following code from project XXX...',
prompt: 'Given the xxx function in xx.ts, how could we optimize it further?',
copyToClipboard: true,
cwd: process.cwd(),
})
Dive straight into generating prompts with our command-line tool:
code-prompt generate <pattern> [options]
-p, --prefixPrompt <prefixPrompt>: Set the stage with a custom introduction.-m, --promptMessage <promptMessage>: The heart of your query or instruction.-i, --ignore <ignore>: Exclude specific patterns (default: 'node_modules/**').-e, --encodingModel <encodingModel>: Opt for your desired encoding model (default: 'gpt-4').-c, --copyToClipboard: Auto-copy results for swift actions (default: true).--cwd <cwd>: Set your current directory (default: process's current working directory).code-prompt generate '**/*.ts' -p "Examining project Y's codebase..." -m "How do we refactor this section for efficiency?"
Help us in making CodePrompt even better. Open issues, suggest enhancements, or contribute directly by submitting pull requests.
Licensed under the MIT License.
FAQs
**CodePrompt** is a tool that crafts GPT prompts using your local code files. With the flexibility of `glob` patterns, you can effortlessly specify which files to incorporate into your prompt.
The npm package code-prompt receives a total of 5 weekly downloads. As such, code-prompt popularity was classified as not popular.
We found that code-prompt demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.