Skip to content

Bug: /init command generates invalid opencode.json (instructions field is a string, expects an array) #22678

@ANGELUSD11

Description

@ANGELUSD11

Description

When running the initialization command (/init), the generated opencode.json file formats the instructions field as a plain string instead of an array of strings. This causes the CLI to crash immediately when trying to run the tool afterwards.

The /init command should wrap the path in an array so it passes the strict validation. It should generate:
"instructions": ["./AGENTS.md"]

Configuration is invalid at /home/.../opencode.json
↳ Invalid input: expected array, received string instructions

### Plugins

None

### OpenCode version

1.4.6

### Steps to reproduce

1. Run the initialization command in a folder of a project (e.g., `opencode /init`)
2. Open the generated `opencode.json` file.
3. Notice that the instructions field is formatted as: `"instructions": "./AGENTS.md"`
4. Run `opencode`.
5. See error.

### Screenshot and/or share link

_No response_

### Operating System

Linux Mint 22.3  | Linux 6.17.0-20-generic

### Terminal

_No response_

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions