the-cisco
v1.0.2
Published
AI pair programming in your terminal
Readme
cisco
AI pair programming in your terminal
npm i -g the-ciscoWarning: Experimental and early stages of development.
I recommend using it in new folders with no sensitive files for now.
https://github.com/user-attachments/assets/dda019ca-86c9-4fd5-820c-30e3aed86d2b
Usage (CLI)
cisco [options]
Options:
-V, --version output the version number
-c, --cwd <path> the path to the working directory (default: ".")
-q, --quiet stay silent (default: false)
--verbose print logs (default: false)
-h, --help display help for commandUse the /add [filename] or /drop [filename] commands to handle files in the context.
E.g. You have an existing project, then you might need to add files to the context.
Settings
Use the file ~/.env for global configuration.
Otherwise, use a .env file relative to where you run the commands.
If you use OpenAI API:
OPENAI_API_KEY = "sk-proj-abc123"Your own API:
CISCO_URL = "https://openrouter.ai/api/v1"
CISCO_KEY = "sk-or-v1-abc123"
CISCO_MODEL = "deepseek/deepseek-chat"Usage (Module)
const { execFileSync } = require('child_process')
const Cisco = require('the-cisco')
const cisco = new Cisco()
// This can be from user input, request, etcetera
const message = 'Create a Node.js script named temp.js that prints \
the temperature of Argentina, Buenos Aires \
without using libraries or requiring an API key. \
Use a free API like open-meteo.com'
await cisco.receive(message)
// File created! You will have a ./temp.js file that you can run!
console.log(node('./temp.js'))
await cisco.receive('Change it to print the temperature of \
Santa Fe instead of Buenos Aires, \
update the log also.')
// File updated!
console.log(node('./temp.js'))
function node (filename) {
return execFileSync(process.execPath, [filename], { encoding: 'utf8' })
}API
cisco = new Cisco([options])
Create a new Cisco instance.
Options:
{
url: process.env.CISCO_URL,
key: process.env.CISCO_KEY || process.env.OPENAI_API_KEY,
cwd: '.',
interactive: false,
quiet: true,
verbose: false
}await cisco.receive(message)
Completes the request of the message.
It will create or edit files automatically.
cisco.cancel()
Signal to cancel the current stream of the answer.
Can be used several times.
await cisco.commands.add(filename)
Add a new file for editing and context.
await cisco.commands.drop(filename)
Remove a file from the context.
cisco.files
List of current files in the context.
cisco.chat
History of messages.
Currently, it's stateless. E.g. Closing the terminal resets the chat.
Notes
There are more methods but I'm limiting the documentation.
API is not stable due very early stages of development.
License
MIT
