@ishaanranjan/code-completion
v1.0.0
Published
Code completion CLI.
Readme
code-completion (CLI)
A tiny Node.js CLI that sends your file content and an instruction prompt to a completion API and prints the result.
Install (global)
npm i -g @ishaanranjan/code-completionUsage
# Print completion
code-completion -f path/to/file.py -p "Continue the code. Only code, no fences."
# Append completion to the file
code-completion -f path/to/file.py --append -p "Add input validation."
# Write to a new file
code-completion -f path/to/file.py -o path/to/file.completed.py -p "Refactor into functions."Options
-f, --file <path>: required source file-p, --prompt <text>: instruction prompt--max-tokens <n>: max tokens (default 512)--temperature <n>: sampling temperature (default 0.2)-o, --out <path>: write result to this path--append: append result to the input file--keep-fences: keep triple-backtick code fences if present
Notes
- Works with Node.js 18+.
