Skip to main content

Code Execution

Docket can execute code directly in the chat, making it a powerful offline development companion.

Getting Started

For the best coding experience, use Qwen 2.5 7B Coder with the Coder preset. This combination is optimized for generating clean, executable code.

Coder Example

Running Code

When the AI generates a code block, you'll see action buttons in the top-right corner:

  • Run — Execute the code
  • Save — Save to your files
  • Copy — Copy to clipboard

Click Run to execute the code.

Run Code Button

Confirmation Dialog

By default, Docket asks for confirmation before running any code. This is a safety feature to ensure you review the code before execution.

Are You Sure

Click Are you sure? again to confirm and execute.

tip

You can disable this confirmation in Chat Settings if you trust the code being generated.

Viewing Results

After execution, the output appears directly in the chat below the code block.

Code Result

The output panel shows:

  • Exit codeExit 0 means success
  • Execution time — How long the code took to run
  • Output — The actual output from the code

Output Actions

You can interact with the output:

ActionDescription
CopyCopy the output to clipboard
SaveSave the output to your files
Add to InputInsert the output into your next message

Supported Languages

Docket can execute code in any language your system supports:

  • Python — Requires Python installed
  • Bash — Built-in on macOS/Linux
  • PowerShell — Built-in on Windows
  • JavaScript — Requires Node.js installed
  • And more — Any executable language on your system

Working Directory

Code executes in a configurable working directory. By default, this is your home directory. You can change it in Chat Settings.

Tips for Better Results

  • Be specific — Tell the AI what language and format you want
  • Use the Coder preset — Optimized settings for code generation
  • Review before running — Always check code before execution
  • Start simple — Test with small scripts before complex ones

Next Steps