Skip to content

需要一个每次启动自动执行的prompt功能 #9615

Closed

Description

@AndersHsueh

建议增加一个功能,允许用户设置每次启动时自动执行的prompt,比如设置'##始终用中文回答##'这样的指令,这样就不用每次对话都重复输入相同的提示了。

Activity

  1. github-actions commented on Jan 20, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These issues all relate to automatically executing or setting default instructions/prompts without having to repeat them in each conversation.

    Feel free to ignore if your specific use case is different from these.

  2. zer0Black commented on Jan 20, 2026

    @zer0Black

    该功能具备,请把该要求写入全局的AGENTS.md中,全局AGENTS.md与 opencode.json配置文件在同级目录。看下图:

    Image

    我的全局AGENTS.md示例:

    # 输出语言
    - 使用中文进行输出
    - /init 命令生成的AGENTS.md以中文生成
    
  3. AndersHsueh commented on Jan 20, 2026

    @AndersHsueh
    Author

    This issue has been addressed by PR #9625 which implements the autoexec prompt functionality.\n\nThe implementation adds:\n- autoexec_prompt field to config schema\n- Modified Session.initialize to execute autoexec prompts at session start\n- Allows users to set prompts that automatically execute, such as 'if gh command ready then do not use git command'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions