A step-by-step code manipulation CLI tool that helps developers generate and modify code, files, folders, and run commands in a project.
npm install stepcode -g
-
File Operations:
- Create, delete, move, and rename files
- Create, delete, move, and rename folders
- Set or update file contents
- Find and modify specific content in files
- Smart content matching (ignores extra whitespace, tabs, and newlines)
-
Command Operations:
- Run shell commands
- Interactive command confirmation
Create a instruction.builder.json
file in your project root with your desired steps. You can have multiple .builder.json
files for different purposes.
[
{
"action": "create-folder",
"path": "src/components",
"description": "Create components directory"
},
{
"action": "create-file",
"path": "src/components/Button.tsx",
"content": "export const Button = () => {\n return <button>Click me</button>\n}",
"description": "Create Button component"
}
]
stepcode
The CLI will:
- Look for
.builder.json
files in the current directory - If only
instruction.builder.json
exists, use it automatically - If multiple builder files exist, prompt you to select one
- Ask whether to run steps manually or automatically
{
"action": "create-file",
"path": "path/to/file.txt",
"content": "File content here",
"description": "Create new file"
}
{
"action": "delete-file",
"path": "path/to/file.txt",
"description": "Delete file"
}
{
"action": "move-file",
"path": "original/path/file.txt",
"newPath": "new/path/file.txt",
"description": "Move file to new location"
}
{
"action": "rename-file",
"path": "path/file.txt",
"newPath": "path/newname.txt",
"description": "Rename file"
}
{
"action": "set-content",
"path": "path/to/file.txt",
"content": "This will replace the entire file content",
"description": "Replace file content"
}
{
"action": "find-content-to-update",
"path": "path/to/file.txt",
"searchText": "text to find",
"replaceWith": "replacement text",
"description": "Update specific content"
}
{
"action": "find-content-to-add",
"path": "path/to/file.txt",
"searchText": "text to find",
"content": "content to add after found text",
"description": "Add content after specific text"
}
{
"action": "find-content-to-delete",
"path": "path/to/file.txt",
"searchText": "text to delete",
"description": "Delete specific content"
}
{
"action": "create-folder",
"path": "path/to/folder",
"description": "Create new folder"
}
{
"action": "delete-folder",
"path": "path/to/folder",
"description": "Delete folder"
}
{
"action": "move-folder",
"path": "original/path",
"newPath": "new/path",
"description": "Move folder to new location"
}
{
"action": "rename-folder",
"path": "path/folder",
"newPath": "path/newname",
"description": "Rename folder"
}
{
"action": "run-command",
"command": "npm install",
"description": "Install dependencies"
}
{
"action": "confirm-command",
"command": "git status",
"confirmationMessage": "Check git status?",
"description": "Check git status with confirmation"
}
When using content operations (find-content-to-update
, find-content-to-delete
, find-content-to-add
), the tool uses smart matching that:
- Ignores extra whitespace
- Ignores tabs and newlines
- Treats multiple spaces as a single space
- Preserves original formatting when making changes
This makes it easier to match content without worrying about exact whitespace matching.
The tool supports two running modes:
-
Step by Step (Manual)
- Review each step before execution
- Choose to execute, skip, or view details of each step
- Perfect for learning and careful execution
-
All at Once (Automatic)
- Executes all steps automatically
- Faster for known and tested operations
- Good for automation and scripting
The tool provides:
- Clear error messages
- Step-by-step feedback
- Progress indicators
- Confirmation for destructive operations
Issues and pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
UNLICENSED
Finlup Engineering Team dev@finlup.id