新增wiki命令文件
This commit is contained in:
@@ -0,0 +1,301 @@
|
||||
#ubuntu #vibe-kanban #vibe-coding #npm #npx #pm2
|
||||
|
||||
|
||||
```table-of-contents
|
||||
```
|
||||
|
||||
**Ubuntu Server 下安装、管理 Vibe-Kanban + OpenCode 的完整文档**,以 `shenwei` 用户操作、使用 Node 20 和 pm2 管理进程,包含详细命令和验证步骤。
|
||||
|
||||
以下是完整 Markdown 文档:
|
||||
|
||||
---
|
||||
---
|
||||
title: Vibe-Kanban + OpenCode 在 Ubuntu Server 上安装与管理指南
|
||||
author: shenwei
|
||||
tags: [npm, npx, pm2, ubuntu, vibe-coding, vibe-kanban]
|
||||
---
|
||||
---
|
||||
title: Vibe-Kanban + OpenCode 在 Ubuntu Server 上安装与管理指南
|
||||
source:
|
||||
author: shenwei
|
||||
published:
|
||||
created:
|
||||
description:
|
||||
tags: [npm, npx, pm2, ubuntu, vibe-coding, vibe-kanban]
|
||||
---
|
||||
|
||||
# Vibe-Kanban + OpenCode 在 Ubuntu Server 上安装与管理指南
|
||||
|
||||
本文档详细说明了如何在 Ubuntu Server 上使用非 root 用户(`shenwei`)安装 Node 20、Vibe-Kanban 与 OpenCode,并通过 pm2 管理进程,同时提供完整的验证步骤。
|
||||
|
||||
---
|
||||
|
||||
## 1️⃣ 清理旧的安装
|
||||
|
||||
**目的**:清理之前安装的 Node、Vibe-Kanban、OpenCode、工作树等,避免权限冲突和端口占用。
|
||||
|
||||
### 步骤:
|
||||
|
||||
1. 停止所有旧进程
|
||||
|
||||
|
||||
```bash
|
||||
# 查看旧的 vibe-kanban 或 opencode 进程
|
||||
ps aux | grep -E 'vibe-kanban|opencode' | grep -v grep
|
||||
|
||||
# 停掉进程
|
||||
kill <PID>
|
||||
```
|
||||
|
||||
2. 删除旧工作树与缓存
|
||||
|
||||
|
||||
```bash
|
||||
rm -rf /var/tmp/vibe-kanban/worktrees/*
|
||||
rm -rf ~/.vibe-kanban
|
||||
```
|
||||
|
||||
3. 确保用户 `shenwei` 对目录有读写权限
|
||||
|
||||
|
||||
```bash
|
||||
sudo chown -R shenwei:shenwei /var/tmp/vibe-kanban
|
||||
sudo chown -R shenwei:shenwei ~/.vibe-kanban
|
||||
```
|
||||
|
||||
4. 如果之前系统安装了旧 Node 或全局 npm 包,可选择卸载
|
||||
|
||||
|
||||
```bash
|
||||
sudo apt remove nodejs npm -y
|
||||
sudo rm -rf /usr/local/lib/node_modules
|
||||
sudo rm -f /usr/local/bin/node /usr/local/bin/npm
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2️⃣ 安装 Node 20(使用 nvm)
|
||||
|
||||
**目的**:确保 Node 版本为 20,兼容最新 Vibe-Kanban 和 OpenCode。
|
||||
|
||||
### 安装 nvm
|
||||
|
||||
```bash
|
||||
# 下载并安装 nvm(代理环境下可用 proxychains)
|
||||
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
|
||||
# 添加环境变量到 shenwei 的 bash 配置
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc
|
||||
|
||||
# 重新加载 bash
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
### 安装 Node 20
|
||||
|
||||
```bash
|
||||
nvm install 20
|
||||
nvm use 20
|
||||
nvm alias default 20
|
||||
|
||||
# 验证 Node 和 npm
|
||||
node -v # 应该显示 v20.x.x
|
||||
npm -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3️⃣ 安装 Vibe-Kanban 与 OpenCode(用户 `shenwei`)
|
||||
|
||||
### 安装 Vibe-Kanban
|
||||
|
||||
```bash
|
||||
# 安装最新版本
|
||||
npm install -g vibe-kanban
|
||||
|
||||
# 创建工作目录
|
||||
mkdir -p ~/vibe-kanban-projects
|
||||
cd ~/vibe-kanban-projects
|
||||
```
|
||||
|
||||
### 安装 OpenCode
|
||||
|
||||
```bash
|
||||
# 安装 OpenCode CLI
|
||||
npm install -g opencode-ai
|
||||
|
||||
# 验证安装
|
||||
opencode --version
|
||||
```
|
||||
|
||||
> ⚠️ 注意:不要用 root 启动 OpenCode serve,vibe-kanban 会自动 spawn executor
|
||||
|
||||
---
|
||||
|
||||
## 4️⃣ 查看安装后的进程和验证
|
||||
|
||||
### 查看进程
|
||||
|
||||
```bash
|
||||
# 查看 Node 相关进程
|
||||
ps aux | grep -E 'vibe-kanban|opencode' | grep -v grep
|
||||
|
||||
# 查看监听端口
|
||||
ss -lntp | grep opencode
|
||||
ss -lntp | grep vibe-kanban
|
||||
```
|
||||
|
||||
### 参考用pm2启动进程
|
||||
### 验证 vibe-kanban 启动
|
||||
|
||||
```bash
|
||||
# 使用 debug 模式启动
|
||||
RUST_LOG=debug HOST=0.0.0.0 PORT=9999 npx vibe-kanban
|
||||
```
|
||||
|
||||
- 日志中应包含:
|
||||
|
||||
|
||||
```
|
||||
Server running on http://0.0.0.0:9999
|
||||
Starting executor on port <random_port>
|
||||
```
|
||||
|
||||
- 如果浏览器无法自动打开,可手动访问:[http://192.168.3.45:9999](http://192.168.3.45:9999/)
|
||||
|
||||
|
||||
### 验证 OpenCode executor
|
||||
|
||||
- vibe-kanban 启动后会 spawn executor(随机端口),可通过日志查看端口
|
||||
|
||||
- 检查端口是否在监听:
|
||||
|
||||
|
||||
```bash
|
||||
ss -lntp | grep opencode
|
||||
```
|
||||
|
||||
- 用 curl 测试 executor 健康(假设端口 40829):
|
||||
|
||||
|
||||
```bash
|
||||
curl http://127.0.0.1:40829/health
|
||||
# 返回 OK
|
||||
```
|
||||
|
||||
> ⚠️ 遇到 I/O error 时,通常是 executor 没启动或端口被占用
|
||||
|
||||
---
|
||||
|
||||
## 5️⃣ 使用 pm2 管理进程
|
||||
|
||||
### 安装 pm2
|
||||
|
||||
```bash
|
||||
npm install -g pm2
|
||||
```
|
||||
|
||||
### 使用 pm2 启动 Vibe-Kanban
|
||||
|
||||
```bash
|
||||
pm2 start "RUST_LOG=debug HOST=0.0.0.0 PORT=9999 npx vibe-kanban" --name vibe-kanban
|
||||
|
||||
# 查看状态
|
||||
pm2 status
|
||||
|
||||
# 查看日志
|
||||
pm2 logs vibe-kanban
|
||||
```
|
||||
|
||||
### 使用 pm2 启动 OpenCode Executor
|
||||
``` bash
|
||||
pm2 start "opencode serve --hostname 127.0.0.1 --port 40829" --name opencode-executor
|
||||
|
||||
# 查看状态
|
||||
pm2 status
|
||||
|
||||
# 查看日志
|
||||
pm2 logs opencode-executor
|
||||
```
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 6️⃣ 完整验证步骤
|
||||
|
||||
1. 清理旧工作树和进程
|
||||
|
||||
2. 确认 Node 20 已正确安装
|
||||
|
||||
3. 确认 Vibe-Kanban 与 OpenCode 已安装并属于 `shenwei` 用户
|
||||
|
||||
4. 启动 vibe-kanban:
|
||||
|
||||
|
||||
```bash
|
||||
RUST_LOG=debug HOST=0.0.0.0 PORT=9999 npx vibe-kanban
|
||||
```
|
||||
|
||||
5. 检查日志:
|
||||
|
||||
|
||||
```
|
||||
Server running on http://0.0.0.0:9999
|
||||
Starting executor on port <random_port>
|
||||
```
|
||||
|
||||
6. 检查监听端口:
|
||||
|
||||
|
||||
```bash
|
||||
ss -lntp | grep node
|
||||
```
|
||||
|
||||
7. 用浏览器或 curl 访问:
|
||||
|
||||
|
||||
```
|
||||
http://127.0.0.1:9999
|
||||
curl http://127.0.0.1:<executor_port>/health
|
||||
```
|
||||
|
||||
8. pm2 管理进程:
|
||||
|
||||
|
||||
```bash
|
||||
pm2 start "RUST_LOG=debug HOST=0.0.0.0 PORT=9999 npx vibe-kanban" --name vibe-kanban
|
||||
pm2 logs vibe-kanban
|
||||
pm2 save
|
||||
pm2 startup systemd -u shenwei --hp /home/shenwei
|
||||
```
|
||||
|
||||
9. 完整测试:
|
||||
|
||||
|
||||
- 创建测试项目
|
||||
|
||||
- 创建任务
|
||||
|
||||
- 日志中不应再出现:
|
||||
|
||||
|
||||
```
|
||||
OpenCode executor error: I/O error: error sending request ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### ✅ 总结
|
||||
|
||||
- **不要用 root** 启动 OpenCode serve
|
||||
|
||||
- **vibe-kanban 自行 spawn executor**,随机端口即可
|
||||
|
||||
- pm2 只管理 **vibe-kanban**,executor 随进程一起管理
|
||||
|
||||
- 保证 `/var/tmp/vibe-kanban` 和 `~/.vibe-kanban` 权限属于用户
|
||||
|
||||
- Node 版本 20 + npm 最新即可
|
||||
|
||||
71
raw/Vibe Coding/vibe coding经验收集.md
Normal file
71
raw/Vibe Coding/vibe coding经验收集.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
title: vibe-coding-cn/i18n/zh/documents/Methodology and Principles/A Formalization of Recursive Self-Optimizing Generative Systems.md at main · 2025Emma/vibe-coding-cn
|
||||
source: https://github.com/2025Emma/vibe-coding-cn/blob/main/i18n/zh/documents/Methodology%20and%20Principles/vibe-coding-%E7%BB%8F%E9%AA%8C%E6%94%B6%E9%9B%86.md
|
||||
author: shenwei
|
||||
published:
|
||||
created: 2025-12-30
|
||||
description: Contribute to 2025Emma/vibe-coding-cn development by creating an account on GitHub.
|
||||
tags: []
|
||||
---
|
||||
|
||||
|
||||
|
||||
[https://x.com/3i8ae3pgjz56244/status/1993328642697707736?s=46](https://x.com/3i8ae3pgjz56244/status/1993328642697707736?s=46)
|
||||
|
||||
我是把设计文档写得很细,包括service层的具体逻辑都用伪代码写了,然后交给AI,一遍直出,再用另一个AI review一遍,根据review意见修改一下,跑一下测试用例,让AI自己生成commit后push
|
||||
|
||||
点评:需求 -> 伪代码 -> 代码
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/jesselaunz/status/1993231396035301437?s=20](https://x.com/jesselaunz/status/1993231396035301437?s=20)
|
||||
|
||||
针对gemini 3 pro的系统prompt,使多个代理基准测试的性能提高了约 5%。
|
||||
|
||||
---
|
||||
|
||||
点 -> 线 -> 体 的逐级迭代,对应使用范围内的任务,先打磨好单个基础任务,然后基于此进行批量执行
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/nake13/status/1995123181057917032?s=46](https://x.com/nake13/status/1995123181057917032?s=46)
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/9hills/status/1995308023578042844?s=46](https://x.com/9hills/status/1995308023578042844?s=46)
|
||||
|
||||
---
|
||||
|
||||
文件头注释,一段话描述代码作用,上下游链路,文档维护agents或者claude维护每个模块的一段话说明,降低认知负载,尽量做减法和索引,参考claude skill
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/dogejustdoit/status/1996464777313542204?s=46](https://x.com/dogejustdoit/status/1996464777313542204?s=46)
|
||||
|
||||
随着软件规模不断扩大,靠人眼去“看代码”不仅无法应对增长的复杂度,还会让开发者疲于奔命。代码最终会被转换成机器码执行,高级语言只是一层方便人类理解的抽象,重要的是验证程序的执行逻辑,通过自动化测试、静态分析、形式化验证等手段确保行为正确。未来的软件工程核心不是“看懂代码”,而是“验证代码按正确逻辑运行”
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/yanboofficial/status/1996188311451480538?s=46](https://x.com/yanboofficial/status/1996188311451480538?s=46)
|
||||
|
||||
```
|
||||
请你根据我的要求,用 Three.js 创建一个实时交互的3D粒子系统,如果你第一次就做得好,我将会打赏你100美元的小费;我的要求是:
|
||||
```
|
||||
|
||||
点评:这个提示词可能会提升生成的效果
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/zen\_of\_nemesis/status/1996591768641458368?s=46](https://x.com/zen_of_nemesis/status/1996591768641458368?s=46)
|
||||
|
||||
---
|
||||
|
||||
[https://github.com/tesserato/CodeWeaver](https://github.com/tesserato/CodeWeaver)
|
||||
|
||||
CodeWeaver 将你的代码库编织成一个可导航的 Markdown 文档
|
||||
|
||||
它能把你整个项目,不管有多少屎山代码,直接“编织”成一个条理清晰的 Markdown 文件,结构是树形的,一目了然。所有代码都给你塞进代码块里,极大地简化了代码库的共享、文档化以及与 AI/ML 工具集成
|
||||
|
||||
---
|
||||
|
||||
[https://x.com/magic47972451/status/1998639692905087356?s=46](https://x.com/magic47972451/status/1998639692905087356?s=46)
|
||||
159
raw/Vibe Coding/在Ubuntu上安装Vibe-Kanban.md
Normal file
159
raw/Vibe Coding/在Ubuntu上安装Vibe-Kanban.md
Normal file
@@ -0,0 +1,159 @@
|
||||
---
|
||||
title: 在Ubuntu 上安装Vibe-Kanban
|
||||
source:
|
||||
author: shenwei
|
||||
published:
|
||||
created:
|
||||
description:
|
||||
tags: [npm, npx, pm2, ubuntu, vibe-coding, vibe-kanban]
|
||||
---
|
||||
|
||||
#ubuntu #vibe-kanban #vibe-coding #npm #npx #pm2
|
||||
|
||||
```table-of-contents
|
||||
```
|
||||
|
||||
# 在Ubuntu 上安装Vibe-Kanban
|
||||
|
||||
## Git 项目
|
||||
https://github.com/BloopAI/vibe-kanban
|
||||
|
||||
https://www.vibekanban.com/docs/getting-started
|
||||
## Prerequisites
|
||||
|
||||
Before installing Vibe Kanban, ensure you have:
|
||||
|
||||
- **Node.js**: Latest LTS version recommended
|
||||
- **Coding agent authentication**: Authenticate with your preferred coding agents outside of Vibe Kanban
|
||||
|
||||
## Safety Notice
|
||||
|
||||
Vibe Kanban runs AI agents with —dangerously-skip-permissions/—yolo flags by default so they can work autonomously without constant approval prompts. Each task runs in an isolated git worktree, preventing agents from interfering with each other. Agents can still perform system-level actions, so review their work and keep backups.
|
||||
|
||||
## Installation & Setup
|
||||
|
||||
### 1 Authenticate with a coding agent
|
||||
|
||||
Before launching Vibe Kanban, ensure you’re authenticated with at least one [supported coding agent](https://www.vibekanban.com/docs/supported-coding-agents). Follow the installation and authentication instructions for your preferred agent.
|
||||
|
||||
### 2 Install and launch Vibe Kanban
|
||||
|
||||
Open a terminal and run:
|
||||
|
||||
```
|
||||
npx vibe-kanban
|
||||
```
|
||||
|
||||
The application will bind to a random free port, print the URL in the terminal, and automatically open in your default browser.
|
||||
|
||||
### 3 Complete initial setup
|
||||
|
||||
Complete the setup dialogs to configure your coding agent and editor preferences. GitHub integration relies on the GitHub CLI and is configured when needed.
|
||||
|
||||
### 4 Create your first project
|
||||
|
||||
You’ll land on the Projects page, populated with your three most recently active git projects if automatically discovered. Click “Create project” to add more projects.
|
||||
|
||||
### 5 Add tasks
|
||||
|
||||
Start tracking your work by [creating tasks](https://www.vibekanban.com/docs/core-features/creating-tasks) within your project.
|
||||
|
||||
### 6 Optional: GitHub integration
|
||||
|
||||
Vibe Kanban uses the [GitHub CLI](https://cli.github.com/) for creating pull requests. Ensure `gh` is installed and authenticated on your system, or follow the setup prompts when creating your first pull request.
|
||||
|
||||
### 7 Optional: Set up MCP integration
|
||||
|
||||
Streamline task creation with coding agents by [setting up MCP integration](https://www.vibekanban.com/docs/integrations/vibe-kanban-mcp-server).
|
||||
|
||||
To use a fixed port, specify the `PORT` environment variable: `PORT=8080 npx vibe-kanban`
|
||||
|
||||
|
||||
## 使用 PM2来管理Vibe-Kanban 进程
|
||||
|
||||
PM2 是一个进程管理器,非常适合管理像 `vibe-kanban` 这种基于 Node.js 的工具。它可以自动重启、开机自启,并提供简单的管理界面。
|
||||
|
||||
**1. 安装 PM2:**
|
||||
|
||||
Bash
|
||||
|
||||
```
|
||||
sudo npm install -g pm2
|
||||
```
|
||||
|
||||
**2. 后台启动 vibe-kanban:**
|
||||
|
||||
Bash
|
||||
|
||||
```
|
||||
# 注意这里需要用引号把启动命令包起来
|
||||
pm2 start "HOST=0.0.0.0 PORT=9999 npx vibe-kanban" --name vibe-kanban
|
||||
```
|
||||
|
||||
```
|
||||
shenwei@shenwei-ubuntu-2:~$ pm2 start "HOST=0.0.0.0 PORT=9999 npx vibe-kanban" --name vibe-kanban
|
||||
|
||||
-------------
|
||||
|
||||
__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
|
||||
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
|
||||
_\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
|
||||
_\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
|
||||
_\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
|
||||
_\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
|
||||
_\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
|
||||
_\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
|
||||
_\///______________\///______________\///__\///////////////__
|
||||
|
||||
|
||||
Runtime Edition
|
||||
|
||||
PM2 is a Production Process Manager for Node.js applications
|
||||
with a built-in Load Balancer.
|
||||
|
||||
Start and Daemonize any application:
|
||||
$ pm2 start app.js
|
||||
|
||||
Load Balance 4 instances of api.js:
|
||||
$ pm2 start api.js -i 4
|
||||
|
||||
Monitor in production:
|
||||
$ pm2 monitor
|
||||
|
||||
Make pm2 auto-boot at server restart:
|
||||
$ pm2 startup
|
||||
|
||||
To go further checkout:
|
||||
http://pm2.io/
|
||||
|
||||
|
||||
-------------
|
||||
|
||||
[PM2] Spawning PM2 daemon with pm2_home=/home/shenwei/.pm2
|
||||
[PM2] PM2 Successfully daemonized
|
||||
[PM2] Starting /usr/bin/bash in fork_mode (1 instance)
|
||||
[PM2] Done.
|
||||
┌────┬────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
|
||||
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
|
||||
├────┼────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
|
||||
│ 0 │ vibe-kanban │ default │ N/A │ fork │ 2232962 │ 0s │ 0 │ online │ 0% │ 13.9mb │ shenwei │ disabled │
|
||||
└────┴────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
|
||||
|
||||
```
|
||||
|
||||
|
||||
**3. 如何管理:**
|
||||
|
||||
- **查看状态**:`pm2 list`
|
||||
|
||||
- **查看实时日志**:`pm2 logs vibe-kanban`
|
||||
|
||||
- **手动停止**:`pm2 stop vibe-kanban`
|
||||
|
||||
- **重启**:`pm2 restart vibe-kanban`
|
||||
|
||||
- **彻底删除进程记录**:`pm2 delete vibe-kanban`
|
||||
|
||||
|
||||
**4. 打开vibe-kanban:**
|
||||
http://192.168.3.45:9999/
|
||||
239
raw/Vibe Coding/如何在Ubuntu上安装opencode并配置Vibe-Kanban.md
Normal file
239
raw/Vibe Coding/如何在Ubuntu上安装opencode并配置Vibe-Kanban.md
Normal file
@@ -0,0 +1,239 @@
|
||||
---
|
||||
title:
|
||||
source:
|
||||
author: shenwei
|
||||
published:
|
||||
created:
|
||||
description:
|
||||
tags: [opencode, ubuntu, vibe-coding, vibe-kanban]
|
||||
---
|
||||
|
||||
|
||||
#opencode #ubuntu #vibe-coding #vibe-kanban
|
||||
|
||||
```table-of-contents
|
||||
```
|
||||
|
||||
## Get started with OpenCode.
|
||||
|
||||
[**OpenCode**](https://opencode.ai/) is an open source AI coding agent. It’s available as a terminal-based interface, desktop app, or IDE extension.
|
||||
|
||||
## [Install](https://opencode.ai/docs#install)
|
||||
|
||||
The easiest way to install OpenCode is through the install script.
|
||||
|
||||
Terminal window
|
||||
|
||||
```
|
||||
curl -fsSL https://opencode.ai/install | bash
|
||||
```
|
||||
|
||||
## [Configure](https://opencode.ai/docs#configure)
|
||||
|
||||
With OpenCode you can use any LLM provider by configuring their API keys.
|
||||
|
||||
If you are new to using LLM providers, we recommend using [OpenCode Zen](https://opencode.ai/docs/zen). It’s a curated list of models that have been tested and verified by the OpenCode team.
|
||||
|
||||
1. Run the `/connect` command in the TUI, select opencode, and head to [opencode.ai/auth](https://opencode.ai/auth).
|
||||
|
||||
```
|
||||
/connect
|
||||
```
|
||||
|
||||
2. Sign in, add your billing details, and copy your API key.
|
||||
|
||||
3. Paste your API key.
|
||||
|
||||
```
|
||||
┌ API key││└ enter
|
||||
```
|
||||
|
||||
|
||||
Alternatively, you can select one of the other providers. [Learn more](https://opencode.ai/docs/providers#directory).
|
||||
|
||||
---
|
||||
|
||||
## [Initialize](https://opencode.ai/docs#initialize)
|
||||
|
||||
Now that you’ve configured a provider, you can navigate to a project that you want to work on.
|
||||
|
||||
Terminal window
|
||||
|
||||
```
|
||||
cd /path/to/project
|
||||
```
|
||||
|
||||
And run OpenCode.
|
||||
|
||||
Terminal window
|
||||
|
||||
```
|
||||
opencode
|
||||
```
|
||||
|
||||
Next, initialize OpenCode for the project by running the following command.
|
||||
|
||||
```
|
||||
/init
|
||||
```
|
||||
|
||||
This will get OpenCode to analyze your project and create an `AGENTS.md` file in the project root.
|
||||
|
||||
Tip
|
||||
|
||||
You should commit your project’s `AGENTS.md` file to Git.
|
||||
|
||||
This helps OpenCode understand the project structure and the coding patterns used.
|
||||
|
||||
---
|
||||
|
||||
## [Usage](https://opencode.ai/docs#usage)
|
||||
|
||||
You are now ready to use OpenCode to work on your project. Feel free to ask it anything!
|
||||
|
||||
If you are new to using an AI coding agent, here are some examples that might help.
|
||||
|
||||
---
|
||||
|
||||
### [Ask questions](https://opencode.ai/docs#ask-questions)
|
||||
|
||||
You can ask OpenCode to explain the codebase to you.
|
||||
|
||||
Tip
|
||||
|
||||
Use the `@` key to fuzzy search for files in the project.
|
||||
|
||||
```
|
||||
How is authentication handled in @packages/functions/src/api/index.ts
|
||||
```
|
||||
|
||||
This is helpful if there’s a part of the codebase that you didn’t work on.
|
||||
|
||||
---
|
||||
|
||||
### [Add features](https://opencode.ai/docs#add-features)
|
||||
|
||||
You can ask OpenCode to add new features to your project. Though we first recommend asking it to create a plan.
|
||||
|
||||
1. **Create a plan**
|
||||
|
||||
OpenCode has a _Plan mode_ that disables its ability to make changes and instead suggest _how_ it’ll implement the feature.
|
||||
|
||||
Switch to it using the **Tab** key. You’ll see an indicator for this in the lower right corner.
|
||||
|
||||
```
|
||||
<TAB>
|
||||
```
|
||||
|
||||
Now let’s describe what we want it to do.
|
||||
|
||||
```
|
||||
When a user deletes a note, we'd like to flag it as deleted in the database.Then create a screen that shows all the recently deleted notes.From this screen, the user can undelete a note or permanently delete it.
|
||||
```
|
||||
|
||||
You want to give OpenCode enough details to understand what you want. It helps to talk to it like you are talking to a junior developer on your team.
|
||||
|
||||
Tip
|
||||
|
||||
Give OpenCode plenty of context and examples to help it understand what you want.
|
||||
|
||||
2. **Iterate on the plan**
|
||||
|
||||
Once it gives you a plan, you can give it feedback or add more details.
|
||||
|
||||
```
|
||||
We'd like to design this new screen using a design I've used before.[Image #1] Take a look at this image and use it as a reference.
|
||||
```
|
||||
|
||||
Tip
|
||||
|
||||
Drag and drop images into the terminal to add them to the prompt.
|
||||
|
||||
OpenCode can scan any images you give it and add them to the prompt. You can do this by dragging and dropping an image into the terminal.
|
||||
|
||||
3. **Build the feature**
|
||||
|
||||
Once you feel comfortable with the plan, switch back to _Build mode_ by hitting the **Tab** key again.
|
||||
|
||||
```
|
||||
<TAB>
|
||||
```
|
||||
|
||||
And asking it to make the changes.
|
||||
|
||||
```
|
||||
Sounds good! Go ahead and make the changes.
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
### [Make changes](https://opencode.ai/docs#make-changes)
|
||||
|
||||
For more straightforward changes, you can ask OpenCode to directly build it without having to review the plan first.
|
||||
|
||||
```
|
||||
We need to add authentication to the /settings route. Take a look at how this ishandled in the /notes route in @packages/functions/src/notes.ts and implementthe same logic in @packages/functions/src/settings.ts
|
||||
```
|
||||
|
||||
You want to make sure you provide a good amount of detail so OpenCode makes the right changes.
|
||||
|
||||
---
|
||||
|
||||
### [Undo changes](https://opencode.ai/docs#undo-changes)
|
||||
|
||||
Let’s say you ask OpenCode to make some changes.
|
||||
|
||||
```
|
||||
Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
```
|
||||
|
||||
But you realize that it is not what you wanted. You **can undo** the changes using the `/undo` command.
|
||||
|
||||
```
|
||||
/undo
|
||||
```
|
||||
|
||||
OpenCode will now revert the changes you made and show your original message again.
|
||||
|
||||
```
|
||||
Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
```
|
||||
|
||||
From here you can tweak the prompt and ask OpenCode to try again.
|
||||
|
||||
Tip
|
||||
|
||||
You can run `/undo` multiple times to undo multiple changes.
|
||||
|
||||
Or you **can redo** the changes using the `/redo` command.
|
||||
|
||||
```
|
||||
/redo
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## [Share](https://opencode.ai/docs#share)
|
||||
|
||||
The conversations that you have with OpenCode can be [shared with your team](https://opencode.ai/docs/share).
|
||||
|
||||
```
|
||||
/share
|
||||
```
|
||||
|
||||
This will create a link to the current conversation and copy it to your clipboard.
|
||||
|
||||
Note
|
||||
|
||||
Conversations are not shared by default.
|
||||
|
||||
Here’s an [example conversation](https://opencode.ai/s/4XP1fce5) with OpenCode.
|
||||
|
||||
---
|
||||
|
||||
## [Customize](https://opencode.ai/docs#customize)
|
||||
|
||||
And that’s it! You are now a pro at using OpenCode.
|
||||
|
||||
To make it your own, we recommend [picking a theme](https://opencode.ai/docs/themes), [customizing the keybinds](https://opencode.ai/docs/keybinds), [configuring code formatters](https://opencode.ai/docs/formatters), [creating custom commands](https://opencode.ai/docs/commands), or playing around with the [OpenCode config](https://opencode.ai/docs/config).
|
||||
31
raw/Vibe Coding/如何在项目里安装Claude-Code-Templates Skills.md
Normal file
31
raw/Vibe Coding/如何在项目里安装Claude-Code-Templates Skills.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title:
|
||||
source:
|
||||
author: shenwei
|
||||
published:
|
||||
created:
|
||||
description:
|
||||
tags: [claude-code, claude-skills, trae]
|
||||
---
|
||||
|
||||
|
||||
#claude-skills #claude-code #trae
|
||||
|
||||
```table-of-contents
|
||||
```
|
||||
|
||||
## Claude Code Templates - Skills
|
||||
https://www.aitmpl.com/skills
|
||||
|
||||
## Claude Code Templates - Agents
|
||||
https://www.aitmpl.com/agents
|
||||
|
||||
## Claude Code Templates - MCP
|
||||
https://www.aitmpl.com/mcps
|
||||
|
||||
|
||||
直接进入项目目录后执行 `npx`命令比如:
|
||||
https://www.aitmpl.com/component/skill/git-commit-helper
|
||||
```
|
||||
npx claude-code-templates@latest --skill=development/git-commit-helper --yes
|
||||
```
|
||||
Reference in New Issue
Block a user