Usage examples
Practical examples showing how to use Bob Shell for debugging, code improvement, file creation, documentation generation, and learning new concepts.
Fixing errors in shell commands
When you encounter errors in your shell commands, Bob Shell can help diagnose and fix them:
# Navigate to your project directory
cd your-project/
# Start Bob Shell
bob
# Switch to shell mode
> !
# Type in the command that's causing an error
> make build
# When you see an error message like 'No rule to make target `xxx', needed by `yyy'.'
# Press ESC or enter '!' again to exit shell mode
# Ask Bob Shell for help
> Help me to fix the errorCode explanation and improvement
Bob Shell can help you understand and improve existing code:
# Start Bob Shell in your project directory
bob
# Ask for an explanation of a specific file
> Explain what @src/utils.js does and how it works
# Request improvements to your code
> Review @src/api.js and suggest improvements for error handlingCreating new files and features
Use Bob Shell to help you create new components or features:
# Start Bob Shell in your project directory
bob
# Ask for help creating a new component
> Create a React component for a user profile page that displays name, email, and avatar
# Generate a utility function
> Write a utility function that formats dates in YYYY-MM-DD formatDebugging assistance
Bob Shell can help you debug issues in your code:
# Start Bob Shell in your project directory
bob
# Share error logs with Bob Shell
> I'm getting this error when running my app: "TypeError: Cannot read property 'map' of undefined". Here's the relevant code: @src/components/List.js
# Or pipe error output directly to Bob Shell
# In your terminal (not in Bob Shell)
npm run start 2>&1 | bob -p "Help me understand and fix this error"Documentation generation
Generate documentation for your code using Bob Shell:
# Start Bob Shell in your project directory
bob
# Generate documentation for a specific file
> Create JSDoc comments for all functions in @src/helpers.js
# Generate a README for your project
> Create a README.md file for my project based on the code in @src/index.jsLearning new concepts
Use Bob Shell to learn about new technologies or concepts:
# Start Bob Shell
bob
# Ask about a specific technology
> Explain how React hooks work and give me examples of useState and useEffect
# Learn about design patterns
> Explain the Observer pattern and how I might implement it in JavaScriptStarting a non-interactive session
Non-interactive session provide a method to use Bob Shell directly from the command line without entering an interactive session. Use for automation, scripting, and batch processing tasks.
Tools
Learn how Bob Shell uses specialized tools to read files, edit code, run commands, and interact with your development environment from the command line.