[PR #11571] feat(create): accept stdin as --file value #12319

Open
opened 2025-11-12 16:33:20 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11571
Author: @mxyng
Created: 7/29/2025
Status: 🔄 Open

Base: mainHead: mxyng/create-stdin


📝 Commits (2)

  • 19279d7 accept - to create from stdin
  • 087beb4 refactor filesForModel

📊 Changes

3 files changed (+252 additions, -302 deletions)

View changed files

📝 cmd/cmd.go (+23 -43)
📝 cmd/cmd_test.go (+146 -194)
📝 parser/parser.go (+83 -65)

📄 Description

this change modifies ollama create -f to accept - which reads from stdin. this allows users to do things like this

cat <<EOF | ollama create -f- name
FROM model
EOF

this also fixes a bug where FROM /path/to/folder may error when any portion of the path specified is a symlink, not just the individual files inside the directory


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/11571 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/29/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mxyng/create-stdin` --- ### 📝 Commits (2) - [`19279d7`](https://github.com/ollama/ollama/commit/19279d778def721b33ddc0e173af69600937cfdf) accept `-` to create from stdin - [`087beb4`](https://github.com/ollama/ollama/commit/087beb40ed9db12462e61347238965270be79761) refactor filesForModel ### 📊 Changes **3 files changed** (+252 additions, -302 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+23 -43) 📝 `cmd/cmd_test.go` (+146 -194) 📝 `parser/parser.go` (+83 -65) </details> ### 📄 Description this change modifies `ollama create -f` to accept `-` which reads from `stdin`. this allows users to do things like this ```console cat <<EOF | ollama create -f- name FROM model EOF ``` this also fixes a bug where `FROM /path/to/folder` may error when any portion of the path specified is a symlink, not just the individual files inside the directory --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the
pull-request
label 2025-11-12 16:33:20 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama-ollama#12319
No description provided.