# CLI Examples ## Basic Commands ### Modify Project Files ```bash # Basic project modification kbot "Add error handling to API endpoints" # Using stdin for prompt echo "Add error handling to API endpoints" | kbot # Pipe file content as prompt cat prompt.txt | kbot # Specify files using include patterns kbot --include "src/**/*.ts" "Update TypeScript types" kbot "Add unit tests for src/commands/*" --include="./src/commands/*.ts" ``` ### Node.js API Projects ```bash # Add API endpoints kbot --include "src/routes/*.ts" "Add authentication middleware" # Update API models kbot --include "src/models/*.ts" "Add validation" ``` ## Advanced Features ### Using Profiles Profiles allow you to define variables that can be used across your project and templates. These variables can be accessed using `${VARIABLE_NAME}` syntax in your tools and template partials. ```bash # Use a specific profile file kbot "Update configuration" --profile=./profiles/profile.json # Use environment-specific variables kbot "Configure for Hugo release" --profile=./profiles/profile.json --env=hugo-release ``` Example profile.json structure: ```json { "variables" : { "foo": "bar" }, "env": { "hugo-release": { "variables":{ "GIT_USER": "hugo-deployer", "DEPLOY_TARGET": "production" } } } } ``` - Top-level variables are used as defaults - Environment-specific variables (specified by --env) override defaults - Variables can be used in tools and template partials using ${VARIABLE_NAME} syntax ### Custom Output Path ```bash # Save modifications to different directory kbot --output ./modified "Refactor code" ``` ### AI Model Selection ```bash # Use specific OpenAI model kbot --router openai --model gpt-4 "Optimize code" # Use Anthropic Claude kbot --model anthropic/claude-3-opus "Add documentation" ``` ### Tool Control ```bash # Disable specific tools kbot --disable git "Update code without git commits" # Disable multiple tool categories kbot --disable fs,npm,git "Analyze code only" ``` ### File Selection ```bash # Multiple include patterns kbot --include "src/**/*.ts" --include "test/**/*.ts" "Update types" # Exclude patterns kbot --include "src/**/*.ts" --include "!src/generated/**" "Refactor code" ``` ### Environment and Profile ```bash # Use specific environment kbot --env production "Add production configs" # Custom profile path kbot --profile ./custom-profile.json --env production ``` ### Scripting ```bash # Generate modification script kbot --dump ./modify-script.sh "Add types" ``` ### Input Types The tool supports different types of input: ```bash # Text input through stdin echo "Add error handling" | kbot # Piping files cat my-prompt.md | kbot # Specifying a file kbot my-prompt.md ```