Skip to content

feat: Enhance Smart Suggestion with Previous Command Output Context #25

@QuakeWang

Description

@QuakeWang

Description

Currently, Smart Suggestion does not provide a way to utilize the output of previously executed commands when generating new command suggestions. This limits its ability to provide context-aware suggestions when working with command outputs that the user wants to further process.

Feature Request

Add the ability for Smart Suggestion to:

  1. Provide an option to capture the output of a specific command when needed
  2. Include this captured output as context in the prompt sent to the AI model when the user triggers a suggestion with Ctrl+O
  3. Generate commands that are aware of and can process the data shown in the previous output

Example Use Case

# User runs a command and explicitly captures its output for smart suggestion
$ smart-capture head -n 5 context.log
2024-05-20T08:15:23.456Z [app-server-01] INFO: {"session":"s-9f4d2e","user":"alice@example.com"...}
2024-05-20T08:16:45.789Z [db-server-03] ERROR: {"operation":"CONNECT","target":"postgres://...}
...

# User then types a request and triggers Smart Suggestion with Ctrl+O
$ # Find all ERROR logs and extract the error_code field

In this scenario, Smart Suggestion should:

  1. Use the previously captured output from the smart-capture command
  2. Let the AI model analyze the format and structure of the data
  3. Generate an appropriate command based on both the user's request and the captured output

Benefits

This enhancement would significantly improve Smart Suggestion's usefulness in interactive shell sessions, allowing for more intelligent and contextually relevant command suggestions based on specific outputs the user wants to process further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions