Node Copilot is a fun and interactive CLI tool that helps you get programming-related answers using the power of LLMs! Just type your question, and let the magic happen! ✨💻🧠
this project is in early development - bugs WILL be encountered
- Interactive prompt for asking programming-related questions
- Save the responses to a specified output file
- Optionally include code from files as context
- Rust (latest stable version)
- API key for Open AI (see
.env.example
)
- Clone the repository:
git clone https://github.com/yourusername/node-copilot.git
- Move into the project directory:
cd node-copilot
- Build the project:
cargo build --release
- Add the
target/release
directory to yourPATH
or create a symlink to the executable.
You can create a symlink to the executable by running one of the following commands, depending on your operating system:
sudo ln -s $(pwd)/target/release/npc /usr/local/bin/npc
mklink %SystemRoot%\System32\node-copilot.exe %CD%\target\release\node-copilot.exe
Alternatively, you can add the target/release directory to your PATH:
For Linux and macOS, add the following line to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.bash_profile):
export PATH="$PATH:/path/to/your/node-copilot/target/release"
Remember to replace /path/to/your/node-copilot with the actual path to your project directory.
For Windows, follow these steps:
- Open the Start menu, search for "Environment Variables" and click on "Edit the system environment variables".
- In the "System Properties" window, click on the "Environment Variables" button.
- In the "Environment Variables" window, under "System variables", find the "Path" variable, select it, and click on "Edit".
- In the "Edit environment variable" window, click on "New" and add the full path to the
target\release directory
(e.g.,C:\path\to\your\node-copilot\target\release
).
After making these changes, restart your shell or terminal for the new PATH
settings to take effect.
npc --out <output_file> [--include "<regex for file paths>"]
<output_file>
: The output file path where the responses will be saved.<regex for file paths>
: (Optional) A regex pattern to include specific files as context. Note that for the time being the regex must be surrounded in quotes. This is a workaround that will be improved eventually.
npc --out results.txt --include "src/*.rs"
This will start an interactive experience where you can ask programming-related questions. The responses will be displayed on the screen and saved to the specified output file.
To exit the interactive session, type 'exit' and press enter.