AI pair programming in your terminal
npm i -g the-cisco
Warning: 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
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 command
Use 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.
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"
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' })
}
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
}
Completes the request of the message.
It will create or edit files automatically.
Signal to cancel the current stream of the answer.
Can be used several times.
Add a new file for editing and context.
Remove a file from the context.
List of current files in the context.
History of messages.
Currently, it's stateless. E.g. Closing the terminal resets the chat.
There are more methods but I'm limiting the documentation.
API is not stable due very early stages of development.
MIT