Skip to content

OhMyOpenCode Toggle Tool is a simple command-line utility for toggling the OhMyOpenCode plugin between enabled and disabled states.

License

Notifications You must be signed in to change notification settings

huchi996/oh-my-opencode-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OhMyOpenCode Toggle Tool

一个简单的命令行工具,用于在 OhMyOpenCode 插件的启用和禁用状态之间切换。

✨ 特性

  • 🔄 简单的命令行开关(omo on/off/status
  • ⚡ 即时状态检查
  • 🗂️ 清晰的目录结构
  • 💻 跨平台支持(Windows/macOS/Linux)
  • 🌐 全局命令支持(任意目录可用)
  • 📦 自动化安装脚本

🚀 安装方法

Windows

# 双击运行或在命令行中执行
scripts\install.bat

macOS/Linux

# 给脚本添加执行权限
chmod +x scripts/install.sh

# 运行安装脚本
./scripts/install.sh

如果提示需要管理员权限:

sudo ./scripts/install.sh

📖 使用说明

安装完成后,无论在哪个目录都可以使用 omo 命令:

# 查看当前状态
omo status

# 启用 OhMyOpenCode
omo on
# 或者
omo enable

# 禁用 OhMyOpenCode
omo off
# 或者
omo disable

⚙️ 工作原理

工具通过修改 ~/.config/opencode/opencode.json 文件来切换插件状态:

  • 启用: "oh-my-opencode"
  • 禁用: //"oh-my-opencode"

修改后需要重启 OpenCode 才能使更改生效。

工具会自动检测 OpenCode 配置文件,无需手动创建。

🔧 高级用法

自定义配置路径

如果 OpenCode 配置路径不在默认位置,可以设置环境变量:

# Windows
set OPENCODE_CONFIG_PATH=C:\custom\path\to\config

# macOS/Linux
export OPENCODE_CONFIG_PATH=/custom/path/to/config

直接使用 Node.js

# 进入 src 目录后
cd ~/.config/opencode/src
node omo-toggle.js [command]

⚠️ 系统要求

  • Node.js(已安装)
  • 修改配置文件的权限
  • OpenCode 已正确安装

🤝 贡献

欢迎提交 Issue 和 Pull Request!


项目结构

oh-my-opencode-toggle/
├── README.md                 # 项目说明
├── LICENSE                   # MIT 许可证
├── AGENTS.md                 # 代码规范
├── .gitignore                # Git 忽略文件
├── src/                      # 源代码目录
│   └── omo-toggle.js        # Node.js 核心脚本
└── scripts/                  # 脚本目录
    ├── install.bat          # Windows 安装脚本
    ├── install.sh           # macOS/Linux 安装脚本
    ├── uninstall.bat        # Windows 卸载脚本
    ├── uninstall.sh         # macOS/Linux 卸载脚本
    ├── omo.bat              # Windows 命令包装器
    ├── omo.sh               # macOS/Linux 命令包装器
    └── README.md            # 脚本详细说明

License

MIT License

About

OhMyOpenCode Toggle Tool is a simple command-line utility for toggling the OhMyOpenCode plugin between enabled and disabled states.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published