Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

`fizzy` is a command-line interface for [Fizzy](https://fizzy.do). Manage boards, cards, comments, and more from your terminal or through AI agents.

- Works standalone or with any AI agent (Claude, Codex, Copilot, Gemini)
- Works standalone or with any AI agent (Claude, Codex, Copilot, Gemini, Grok)
- JSON output with breadcrumbs for easy navigation
- Token authentication via personal access tokens
- Includes agent skill and Claude plugin setup
Expand Down
19 changes: 15 additions & 4 deletions internal/commands/skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var skillLocations = []SkillLocation{
{Name: "OpenCode (Global)", Path: "~/.config/opencode/skill/fizzy/SKILL.md"},
{Name: "OpenCode (Project)", Path: ".opencode/skill/fizzy/SKILL.md"},
{Name: "Codex (Global)", Path: codexGlobalSkillPath()},
{Name: "Grok (Global)", Path: grokGlobalSkillPath()},
}

var skillCmd = &cobra.Command{
Expand Down Expand Up @@ -257,11 +258,21 @@ func normalizeSkillPath(path string) string {
}

func codexGlobalSkillPath() string {
codexHome := strings.TrimSpace(os.Getenv("CODEX_HOME"))
if codexHome == "" {
return "~/.codex/skills/fizzy/SKILL.md"
return agentGlobalSkillPath("CODEX_HOME", "~/.codex")
}

func grokGlobalSkillPath() string {
return agentGlobalSkillPath("GROK_HOME", "~/.grok")
}

// agentGlobalSkillPath locates the skill under an agent's home directory:
// homeEnv when set, otherwise homeDir.
func agentGlobalSkillPath(homeEnv, homeDir string) string {
home := strings.TrimSpace(os.Getenv(homeEnv))
if home == "" {
return homeDir + "/skills/fizzy/SKILL.md"
}
return filepath.Join(codexHome, "skills", "fizzy", skillFilename)
return filepath.Join(home, "skills", "fizzy", skillFilename)
}

// expandSkillPath expands ~ to home directory.
Expand Down
25 changes: 25 additions & 0 deletions internal/commands/skill_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,31 @@ func TestExpandSkillPath(t *testing.T) {
}
}

func TestAgentGlobalSkillPath(t *testing.T) {
tests := []struct {
name string
env string
envVal string
path func() string
want string
}{
{"codex default", "CODEX_HOME", "", codexGlobalSkillPath, "~/.codex/skills/fizzy/SKILL.md"},
{"codex override", "CODEX_HOME", "/opt/codex", codexGlobalSkillPath, filepath.Join("/opt/codex", "skills", "fizzy", "SKILL.md")},
{"codex blank override", "CODEX_HOME", " ", codexGlobalSkillPath, "~/.codex/skills/fizzy/SKILL.md"},
{"grok default", "GROK_HOME", "", grokGlobalSkillPath, "~/.grok/skills/fizzy/SKILL.md"},
{"grok override", "GROK_HOME", "/opt/grok", grokGlobalSkillPath, filepath.Join("/opt/grok", "skills", "fizzy", "SKILL.md")},
{"grok blank override", "GROK_HOME", " ", grokGlobalSkillPath, "~/.grok/skills/fizzy/SKILL.md"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Setenv(tt.env, tt.envVal)
if got := tt.path(); got != tt.want {
t.Errorf("%s = %q, want %q", tt.name, got, tt.want)
}
})
}
}

func TestInstallSkillFiles(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
Expand Down