Here’s a deep dive on using the CLI for AI Dev.
In the most basic form, you can run the CLI using npx, and it’ll prompt you for information.
npx ai-dev@latest
See Getting Started for information on this.
However, what if you’ve decided to write a script or CI runner that calls Magnet Agent?
That’s what our non-interactive CLI is for:
OPENAI_API_KEY=your_openai_api_key_here npx ai-dev@latest -f ./ -t "Your task here." -o ./output
It’s possible to pass tasks to the CLI in two formats:
-t
. Useful if the task is short.-tf
. Better if the task is fairly long.f
is the path to the folder you want to run the task on.t
is the task description.tf
is a file that contains a task description.o
is the path to the folder where the agent will output the results.c
will prompt the agent to interactively clarify the task description before implementing.a
will cause the agent to try to apply the changes to the source directory.