[GH-ISSUE #820] interactive mode with prompt as argument #78071

Closed
opened 2026-05-08 21:44:48 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @jonas-w on GitHub (Oct 17, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/820

When passing a prompt as an argument e.g. ollama run $MODEL "Hello World!", ollama will exit after this prompt and don't wait for further input, like it is with ollama run $MODEL.

Would it be possible to add an -i --interactive flag when passing the prompt directly?

Originally created by @jonas-w on GitHub (Oct 17, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/820 When passing a prompt as an argument e.g. `ollama run $MODEL "Hello World!"`, ollama will exit after this prompt and don't wait for further input, like it is with `ollama run $MODEL`. Would it be possible to add an `-i` `--interactive` flag when passing the prompt directly?
Author
Owner

@mchiang0610 commented on GitHub (Oct 17, 2023):

Hey @jonas-w Thank you for submitting this! I would love to understand your use case a little more. Possible to join our Discord? https://discord.gg/ollama

Regarding the current behavior, it's made so that if you pass in an argument it'll complete it. For interactive mode, you can do ollama run model. Open to suggestions though. The reason why to not immediately add another -i or --interactive flag is because having so many flags in the future can make the project complicated to use. We should all as contributors keep the project simple.

Thank you so much! And really open to suggestions.

<!-- gh-comment-id:1767128469 --> @mchiang0610 commented on GitHub (Oct 17, 2023): Hey @jonas-w Thank you for submitting this! I would love to understand your use case a little more. Possible to join our Discord? https://discord.gg/ollama Regarding the current behavior, it's made so that if you pass in an argument it'll complete it. For interactive mode, you can do `ollama run model`. Open to suggestions though. The reason why to not immediately add another `-i` or `--interactive` flag is because having so many flags in the future can make the project complicated to use. We should all as contributors keep the project simple. Thank you so much! And really open to suggestions.
Author
Owner

@jonas-w commented on GitHub (Oct 17, 2023):

@mchiang0610 no worries, my use case would be to give the model some context and the first question/prompt via the cli and then ask further questions/give further instructions via the interactive readline input.

I understand that adding flags here and there can make stuff complicated, but the cli currently has nearly no configurability without creating a model through a Modelfile, I don't think a bit more configuration options/flags would hurt.

<!-- gh-comment-id:1767250422 --> @jonas-w commented on GitHub (Oct 17, 2023): @mchiang0610 no worries, my use case would be to give the model some context and the first question/prompt via the cli and then ask further questions/give further instructions via the interactive readline input. I understand that adding flags here and there can make stuff complicated, but the cli currently has nearly no configurability without creating a model through a Modelfile, I don't think a bit more configuration options/flags would hurt.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#78071