Complete global configuration setup
- Add comprehensive global setup documentation - Create ~/.config/opencode/config.json with all agents - Copy all prompt files to global location - Update README with detailed global configuration steps - Include verification instructions and structure overview
This commit is contained in:
59
README.md
59
README.md
@ -244,35 +244,70 @@ opencode
|
||||
#### Step 1: Install Globally
|
||||
```bash
|
||||
# Copy to global OpenCode config directory
|
||||
mkdir -p ~/.config/opencode/agent
|
||||
mkdir -p ~/.config/opencode/agent ~/.config/opencode/prompts
|
||||
cp /path/to/nano-opencode-agents/.opencode/agent/* ~/.config/opencode/agent/
|
||||
cp /path/to/nano-opencode-agents/prompts/* ~/.config/opencode/prompts/
|
||||
```
|
||||
|
||||
#### Step 2: Create Global opencode.json
|
||||
#### Step 2: Create Global config.json
|
||||
```bash
|
||||
# Create global config file
|
||||
# Create global config file with all agents
|
||||
cat > ~/.config/opencode/config.json << 'EOF'
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"agent": {
|
||||
"agents": {
|
||||
"build": {
|
||||
"type": "prompt",
|
||||
"path": "prompts/build.txt"
|
||||
},
|
||||
"cleanup": {
|
||||
"description": "Repository cleanup and maintenance",
|
||||
"mode": "subagent",
|
||||
"prompt": "{file:~/.config/opencode/prompts/cleanup.txt}",
|
||||
"tools": { "write": true, "bash": true }
|
||||
"type": "prompt",
|
||||
"path": "prompts/cleanup.txt"
|
||||
},
|
||||
"security": {
|
||||
"type": "prompt",
|
||||
"path": "prompts/security.txt"
|
||||
},
|
||||
"review": {
|
||||
"type": "prompt",
|
||||
"path": "prompts/review.txt"
|
||||
},
|
||||
"docs-writer": {
|
||||
"type": "markdown",
|
||||
"path": "agent/docs-writer.md"
|
||||
},
|
||||
"plan": {
|
||||
"type": "json",
|
||||
"path": "agent/plan.json"
|
||||
}
|
||||
// ... add other agents as needed
|
||||
}
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
#### Step 3: Use in Any Project
|
||||
#### Step 3: Verify Global Setup
|
||||
```bash
|
||||
cd /path/to/any/project
|
||||
# Check global configuration
|
||||
ls -la ~/.config/opencode/
|
||||
cat ~/.config/opencode/config.json
|
||||
|
||||
# Test from any directory
|
||||
cd /tmp
|
||||
opencode # Will load global agents
|
||||
```
|
||||
|
||||
#### Global Structure
|
||||
```
|
||||
~/.config/opencode/
|
||||
├── config.json # Main configuration
|
||||
├── agent/ # Markdown/JSON agents
|
||||
│ └── docs-writer.md # Documentation writer
|
||||
└── prompts/ # Text-based prompts
|
||||
├── build.txt # Build automation
|
||||
├── cleanup.txt # Repository cleanup
|
||||
├── review.txt # Code review
|
||||
└── security.txt # Security analysis
|
||||
```
|
||||
|
||||
### Method 3: Project-Specific Customization
|
||||
|
||||
#### Step 1: Initialize Project
|
||||
|
||||
Reference in New Issue
Block a user