Skip to content

feat: Add non-interactive mode#18

Merged
adamdotdevin merged 7 commits into
anomalyco:devfrom
mark3labs:non-interactive-mode
May 16, 2025
Merged

feat: Add non-interactive mode#18
adamdotdevin merged 7 commits into
anomalyco:devfrom
mark3labs:non-interactive-mode

Conversation

@ezynda3
Copy link
Copy Markdown
Contributor

@ezynda3 ezynda3 commented May 15, 2025

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

@radutopala
Copy link
Copy Markdown

Hey @ezynda3 do you plan to bring this in the upstream opencode repo?

@ezynda3
Copy link
Copy Markdown
Contributor Author

ezynda3 commented May 16, 2025

@radutopala I was not planning to. Your PR is basically finished there, isn't it? The only thing I added was a spinner, which you're welcome to copy from here.

ezynda3 and others added 2 commits May 16, 2025 10:42
- Moved spinner from format package to tui/components/spinner
- Updated imports and references in root.go
- Added basic test for spinner component

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
@ezynda3
Copy link
Copy Markdown
Contributor Author

ezynda3 commented May 16, 2025

@adamdottv ready to review

@adamdotdevin adamdotdevin merged commit 623d132 into anomalyco:dev May 16, 2025
@adamdotdevin
Copy link
Copy Markdown
Member

thanks so much @ezynda3, so good

sauerdaniel added a commit to sauerdaniel/opencode that referenced this pull request Jan 17, 2026
Fixes memory leaks where LSP client maps grow indefinitely:
- Clear diagnostics Map on shutdown (Issue anomalyco#17)
- Clear files version tracking object on shutdown (Issue anomalyco#18)
nobane added a commit to nobane/opencode that referenced this pull request Jan 30, 2026
- Fix input token accumulation bug: use last step's input tokens instead
  of accumulating (each step's input includes full context, not incremental)
- Replace "opencode" with "Claude Code" in system prompts for Anthropic
  OAuth compatibility (PR anomalyco#18)

v69.0.19: System prompt branding fix
v69.0.20: Token over-counting fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tamarazuk added a commit to tamarazuk/opencode that referenced this pull request Mar 3, 2026
- Log stderr from gh pr view instead of silently returning undefined (anomalyco#10)
- Cap pr-comments pagination at 10 pages to prevent runaway requests (anomalyco#18)
- Use resolveApiErrorMessage in delete-branch dialog for consistent error UX (anomalyco#19)
- Default remoteBranchExists to false while loading to avoid UI flash (anomalyco#20)
tamarazuk added a commit to tamarazuk/opencode that referenced this pull request Mar 21, 2026
- Log stderr from gh pr view instead of silently returning undefined (anomalyco#10)
- Cap pr-comments pagination at 10 pages to prevent runaway requests (anomalyco#18)
- Use resolveApiErrorMessage in delete-branch dialog for consistent error UX (anomalyco#19)
- Default remoteBranchExists to false while loading to avoid UI flash (anomalyco#20)
Rwanbt added a commit to Rwanbt/opencode that referenced this pull request Apr 19, 2026
The audit flagged vcs/meta/icon caches per worktree as "no LRU
eviction", but the existing pickDirectoriesToEvict already LRU-prunes
both the store AND its three caches (disposeDirectory deletes them
together). What was actually loose was the idle window: 20 min is
long for a user bouncing between tabs on a laptop, so tabs closed
earlier in the session sit in RAM longer than they need to.

Drop DIR_IDLE_TTL_MS to 10 min. MAX_DIR_STORES stays at 30 — pinned
directories (active views) are never evicted, so the cap only
affects background worktrees, which should turn over faster.

Closes anomalyco#18/21.
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt added a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
The audit flagged vcs/meta/icon caches per worktree as "no LRU
eviction", but the existing pickDirectoriesToEvict already LRU-prunes
both the store AND its three caches (disposeDirectory deletes them
together). What was actually loose was the idle window: 20 min is
long for a user bouncing between tabs on a laptop, so tabs closed
earlier in the session sit in RAM longer than they need to.

Drop DIR_IDLE_TTL_MS to 10 min. MAX_DIR_STORES stays at 30 — pinned
directories (active views) are never evicted, so the cap only
affects background worktrees, which should turn over faster.

Closes anomalyco#18/21.
JiaHuiRed pushed a commit to JiaHuiRed/RedCode that referenced this pull request Jun 4, 2026
JiaHuiRed pushed a commit to JiaHuiRed/RedCode that referenced this pull request Jun 4, 2026
JiaHuiRed pushed a commit to JiaHuiRed/RedCode that referenced this pull request Jun 4, 2026
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.

3 participants