Skip to content

Conversation

@Code-Victor
Copy link
Collaborator

PR: Run Commands in Terminal from Code Blocks

Closes #60

Summary

This PR implements the feature request to allow users to run commands directly in the terminal from code blocks. The following changes were made:

  • Added a CodeBlockRunButton component to code blocks, enabling users to execute code or commands in the integrated terminal with a single click.
  • Enhanced the code block UI and context management to support this functionality.
  • Improved terminal context handling, including command execution and busy state management.
  • Refactored code block components for better modularity and performance.
  • Updated the code block skeleton loader to use horizontal skeleton bars instead of a spinner, providing a more realistic loading state.

Details

  • Users can now click a run button on supported code blocks to send the code/command to the terminal.
  • The terminal UI reflects the running state and prevents duplicate/rapid command execution.
  • Skeleton loaders for code blocks now visually mimic code structure for a more intuitive loading experience.
  • Refactoring and cleanup were performed to support these features and improve maintainability.

…modularity and performance

- Removed the existing code block implementation and replaced it with a modular structure.
- Introduced new components: CodeBlockContainer, CodeBlockHeader, CodeBlockBody, CodeBlockCopyButton, CodeBlockDownloadButton, and CodeBlockSkeleton.
- Implemented context management for code sharing between components.
- Enhanced clipboard functionality with a dedicated copy button.
- Added download functionality for code snippets with appropriate file extensions.
- Updated package dependencies to include @streamdown/code and upgraded streamdown to version 2.1.0.
@vercel
Copy link

vercel bot commented Jan 22, 2026

@Code-Victor is attempting to deploy a commit to the jamesmurdza's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AI] Run AI assistant commands in Terminal

1 participant