Starting 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.

To start a non-interactive session:

Open a new terminal window.

Navigate to the main directory of your project.

Run the bob -p command to start Bob Shell in your terminal.

Note:

Before starting a non-interactive session for the first time, you must accept the license agreement. You can do this by either:

  • Running the following command in your terminal: bob --accept-license -p "Explain this project"
  • Starting Bob Shell with an interactive session first to review and accept the license.

For example:

bob -p "Explain this project"

Basic usage

Providing prompts to Bob Shell

Use the bob -p command to get Bob to address your prompt:

bob -p "Explain this project"

Pipe content as input

You can pipe text content to Bob Shell:

cat buildError.txt | bob -p "Explain this build error"

Save results to a file

Redirect the output to save results:

bob -p "Review @bigFile.java" > review.md

Reference project files

Use the @ symbol to reference files in your project:

bob -p "Summarize the functionality in @src/main.js"

Advanced options

Enable file modifications

By default, Bob Shell only uses non-destructive tools (like reading files) in non-interactive session. To enable writing and updating files, add the --yolo flag:

bob -p "Fix bugs in @app.js" --yolo

Even with the --yolo flag enabled, Bob Shell will not write or update files outside the directory where it was started.

Format output for processing

The output contains both Bob Shell's answer and its thinking steps. For easier processing, add instructions to format the output:

bob -p "What Java version is this application using? Check @pom.xml. Enclose the answer in markdown tags" > analysis.md

When to use non-interactive session

Non-interactive session works best for:

  • Integrating Bob Shell into automation scripts
  • Processing multiple files with a single command
  • Getting quick insights without starting an interactive session
  • Generating documentation from code

Tips for effective use

  • For complex tasks that might require multiple tool uses, interactive session usually works better.
  • When processing large files or projects, be specific about which files to analyze.
  • Use structured output instructions (like "Format the output as JSON") for easier parsing in scripts.
  • Consider creating shell aliases or scripts for frequently used Bob Shell commands.
  • For multi-line prompts, save them to a file and pipe to Bob Shell:
cat prompt.txt | bob
How is this topic?