[PR #18] [MERGED] feat: Add non-interactive mode #9502

Closed
opened 2026-02-16 18:13:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/18
Author: @ezynda3
Created: 5/15/2025
Status: Merged
Merged: 5/16/2025
Merged by: @adamdotdevin

Base: devHead: non-interactive-mode


📝 Commits (7)

📊 Changes

8 files changed (+414 additions, -8 deletions)

View changed files

📝 README.md (+37 -7)
📝 cmd/root.go (+111 -0)
📝 go.mod (+1 -1)
📝 go.sum (+3 -0)
internal/format/format.go (+46 -0)
internal/format/format_test.go (+90 -0)
internal/tui/components/spinner/spinner.go (+102 -0)
internal/tui/components/spinner/spinner_test.go (+24 -0)

📄 Description

Summary

  • Adds non-interactive mode to OpenCode with the -p flag
  • Supports text and JSON output formats with the -f flag
  • Includes a loading spinner (can be disabled with -q flag)

Original implementation by @radutopala, adapted and enhanced for the current codebase.

Test plan

  • Run opencode -p "Hello, world" to test basic functionality
  • Run opencode -p "Hello, world" -f json to test JSON output
  • Run opencode -p "Hello, world" -q to test without spinner

🤖 Generated with opencode


🔄 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/anomalyco/opencode/pull/18 **Author:** [@ezynda3](https://github.com/ezynda3) **Created:** 5/15/2025 **Status:** ✅ Merged **Merged:** 5/16/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `non-interactive-mode` --- ### 📝 Commits (7) - [`b49bb4b`](https://github.com/anomalyco/opencode/commit/b49bb4b5b1defe2f6d8bc36804d2c2025f6f0d6b) Implement non-interactive mode from old PR by @radutopala - [`3a6fa6a`](https://github.com/anomalyco/opencode/commit/3a6fa6a08b5b785df3b93ab484c3926b2b2aad60) remove - [`a151bec`](https://github.com/anomalyco/opencode/commit/a151bece0d2d82089ef9512232e15a011134aec3) fix - [`00cf453`](https://github.com/anomalyco/opencode/commit/00cf453040444fee70884091157ce6a972c6a5a4) fmt - [`05e56aa`](https://github.com/anomalyco/opencode/commit/05e56aa3e42565ad0453cff5d8042f04db4d9510) Merge branch 'dev' into non-interactive-mode - [`e68cf2b`](https://github.com/anomalyco/opencode/commit/e68cf2b974cab3fb4f3af0c01f51625d7ace0682) refactor: move spinner to tui components - [`f865893`](https://github.com/anomalyco/opencode/commit/f865893daa39b6eb49637c31b8827b33b6174829) Merge branch 'dev' of https://github.com/sst/opencode into non-interactive-mode ### 📊 Changes **8 files changed** (+414 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+37 -7) 📝 `cmd/root.go` (+111 -0) 📝 `go.mod` (+1 -1) 📝 `go.sum` (+3 -0) ➕ `internal/format/format.go` (+46 -0) ➕ `internal/format/format_test.go` (+90 -0) ➕ `internal/tui/components/spinner/spinner.go` (+102 -0) ➕ `internal/tui/components/spinner/spinner_test.go` (+24 -0) </details> ### 📄 Description ## Summary - Adds non-interactive mode to OpenCode with the `-p` flag - Supports text and JSON output formats with the `-f` flag - Includes a loading spinner (can be disabled with `-q` flag) Original implementation by @radutopala, adapted and enhanced for the current codebase. ## Test plan - Run `opencode -p "Hello, world"` to test basic functionality - Run `opencode -p "Hello, world" -f json` to test JSON output - Run `opencode -p "Hello, world" -q` to test without spinner 🤖 Generated with opencode --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:40 -05:00
yindo closed this issue 2026-02-16 18:13:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9502