ratpi-cli is a utility for quickly generating script templates using Commander and Chalk.
You can run it directly with npx:
npx ratpi-cli create-script:initratpi-cli create-script:init [options]
Options:
--template <name>– use one of the built-in templates located intemplates/.--use <path>– path to a JSON configuration file describing the commands.--no-install-deps– skip installingcommanderandchalkas devDependencies in the current project.--output <dir>– directory where the project will be generated. If not provided you will be prompted.
A configuration file should look like:
{
"name": "supercli",
"description": "An all-in-one CLI tool to automate your tasks.",
"version": "1.0.0",
"args": [
{
"name": "name",
"small": "n",
"type": "string",
"required": false,
"description": "Name of the person to greet",
"example": "Alex",
"interactive": true
}
]
}This will create a new folder my-script containing an executable index.js using Commander and Chalk.
Ratpi CLI includes an AI agent powered by Gemini Flash 2.0, designed to assist users with technical tasks, workflow automation, and answering questions. The agent follows a supervised task completion protocol to ensure quality and relevance of its responses.
- Project context awareness: The agent can analyze the current environment (git repo, dependencies, scripts, etc.).
- Tool usage: Access to tools for reading/writing files, running shell commands, listing files, and more.
- Structured interaction: The agent never asks free-form questions; it uses a dedicated tool to request clarifications from the user.
- Automatic supervision: Each task is optimized, verified, and corrected if needed by an AI supervisor before final validation.
- Error handling: The agent clearly informs the user in case of errors or if an action cannot be completed.
Set the GEMINI_API_KEY environment variable, then run:
ratpi-cli agent "<your goal>"Example:
ratpi-cli agent "Generate a Node.js script that reads a JSON file and prints its content."The agent will:
- Optimize your instruction.
- Execute the task using available tools.
- Present a summary and wait for your confirmation.
- Finalize or correct based on your feedback.
- Read/write files
- Run shell commands
- List files/folders
- Retrieve project context
- Request user input
- Analysis and actions: The agent presents a summary of its actions.
- Awaiting confirmation: You validate or request a correction.
- Finalization: The agent completes the task or continues as needed.
For more details, see the src/modules/agent/ folder.
bun install
bun run buildVisit ratpi-studio.fr for more tools and documentation.
