@infinityloop.labs/ai-cli
v0.2.0
Published
Template TypeScript CLI library compiled for Node.js
Readme
ILL CLI
Config-driven CLI runner.
Usage
ill <commandKey> --name=MyFeatureAlso supported:
ill <commandKey> --name MyFeature --config ./infinityloop.config.js --cwd .Config
CLI auto-detects one of:
infinityloop.config.jsinfinityloop.config.mjsinfinityloop.config.cjs
commands is a hash-map where each key is a command, and value is an array of steps.
module.exports = {
commands: {
createWidget: [
{
type: "add",
from: "_templates/react_template/_template/widget",
to: "generated/widgets/$name",
replace: [{ Sample: "$name" }, { sample: "$name" }],
},
{
type: "paste",
to: "generated/widgets/$name/README.md",
content: "\nCreated for $name\n",
mode: "append",
},
],
removeWidget: [
{
type: "remove",
target: "generated/widgets/$name",
},
],
},
};Step Types
add: copy folder fromfromtotowith optionalreplace.paste: writecontentto fileto(appendby default; alsoprependorreplace).remove: deletetargetpath recursively.
Replace Rules
replace is an array of objects. Two formats are supported:
{ from: "Sample", to: "$name" }{ "Sample": "$name" }
$name comes from CLI argument --name.
Case is preserved by match:
sample->popupSample->PopupSAMPLE->POPUP
