Step by step code manipulation CLI tool
npm install @ariska138/stepcodebash
npm install stepcode -g
`
Features
- 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
Usage
Create a instruction.builder.json file in your project root with your desired steps. You can have multiple .builder.json files for different purposes.
$3
`json
[
{
"action": "create-folder",
"path": "src/components",
"description": "Create components directory"
},
{
"action": "create-file",
"path": "src/components/Button.tsx",
"content": "export const Button = () => {\n return \n}",
"description": "Create Button component"
}
]
`
$3
`bash
stepcode
`
The CLI will:
1. Look for .builder.json files in the current directory
2. If only instruction.builder.json exists, use it automatically
3. If multiple builder files exist, prompt you to select one
4. Ask whether to run steps manually or automatically
Available Actions
$3
#### Create File
`json
{
"action": "create-file",
"path": "path/to/file.txt",
"content": "File content here",
"description": "Create new file"
}
`
#### Delete File
`json
{
"action": "delete-file",
"path": "path/to/file.txt",
"description": "Delete file"
}
`
#### Move File
`json
{
"action": "move-file",
"path": "original/path/file.txt",
"newPath": "new/path/file.txt",
"description": "Move file to new location"
}
`
#### Rename File
`json
{
"action": "rename-file",
"path": "path/file.txt",
"newPath": "path/newname.txt",
"description": "Rename file"
}
`
$3
#### Set Content
`json
{
"action": "set-content",
"path": "path/to/file.txt",
"content": "This will replace the entire file content",
"description": "Replace file content"
}
`
#### Find and Update Content
`json
{
"action": "find-content-to-update",
"path": "path/to/file.txt",
"searchText": "text to find",
"replaceWith": "replacement text",
"description": "Update specific content"
}
`
#### Find and Add Content
`json
{
"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"
}
`
#### Find and Delete Content
`json
{
"action": "find-content-to-delete",
"path": "path/to/file.txt",
"searchText": "text to delete",
"description": "Delete specific content"
}
`
$3
#### Create Folder
`json
{
"action": "create-folder",
"path": "path/to/folder",
"description": "Create new folder"
}
`
#### Delete Folder
`json
{
"action": "delete-folder",
"path": "path/to/folder",
"description": "Delete folder"
}
`
#### Move Folder
`json
{
"action": "move-folder",
"path": "original/path",
"newPath": "new/path",
"description": "Move folder to new location"
}
`
#### Rename Folder
`json
{
"action": "rename-folder",
"path": "path/folder",
"newPath": "path/newname",
"description": "Rename folder"
}
`
$3
#### Run Command
`json
{
"action": "run-command",
"command": "npm install",
"description": "Install dependencies"
}
`
#### Confirm Command
`json
{
"action": "confirm-command",
"command": "git status",
"confirmationMessage": "Check git status?",
"description": "Check git status with confirmation"
}
`
Special Features
$3
When using content operations (find-content-to-update, find-content-to-delete, find-content-to-add`), the tool uses smart matching that: