Skip to content

Commit 9e5bcbc

Browse files
aitools install: drop positional [skill-name] form
Per Simon's review: avoid locking the top-level `databricks aitools install` into a positional that means "skill", since the aitools surface may grow commands for things beyond skills. `--skills name1,name2` remains the documented way to scope an install. The legacy alias `experimental aitools skills install <name>` keeps its positional form by translating to `--skills` before delegating. Co-authored-by: Isaac
1 parent 51d5258 commit 9e5bcbc

2 files changed

Lines changed: 5 additions & 41 deletions

File tree

aitools/cmd/install.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func NewInstallCmd() *cobra.Command {
5757
var projectFlag, globalFlag bool
5858

5959
cmd := &cobra.Command{
60-
Use: "install [skill-name]",
60+
Use: "install",
6161
Short: "Install AI skills for coding agents",
6262
Long: `Install Databricks AI skills for detected coding agents.
6363
@@ -66,21 +66,13 @@ Use --project to install to the current project directory instead.
6666
When multiple agents are detected, skills are stored in a canonical location
6767
and symlinked to each agent to avoid duplication.
6868
69-
Pass a single skill name as a positional argument to install just that skill,
70-
or use --skills name1,name2 for multiple. The two forms are mutually exclusive.
69+
Use --skills name1,name2 to install specific skills.
7170
7271
Supported agents: Claude Code, Cursor, Codex CLI, OpenCode, GitHub Copilot, Antigravity`,
73-
Args: cobra.MaximumNArgs(1),
72+
Args: cobra.NoArgs,
7473
RunE: func(cmd *cobra.Command, args []string) error {
7574
ctx := cmd.Context()
7675

77-
if len(args) == 1 {
78-
if skillsFlag != "" {
79-
return errors.New("cannot use positional [skill-name] together with --skills; pick one")
80-
}
81-
skillsFlag = args[0]
82-
}
83-
8476
// Resolve scope.
8577
scope, err := resolveScopeWithPrompt(ctx, projectFlag, globalFlag)
8678
if err != nil {

aitools/cmd/install_test.go

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -262,45 +262,17 @@ func TestInstallAgentsFlagSkipsPrompt(t *testing.T) {
262262
assert.Equal(t, []string{"claude-code", "cursor"}, (*calls)[0].agents)
263263
}
264264

265-
func TestInstallPositionalSkillName(t *testing.T) {
266-
setupTestAgents(t)
267-
calls := setupInstallMock(t)
268-
265+
func TestInstallRejectsPositionalArgs(t *testing.T) {
269266
ctx := cmdio.MockDiscard(t.Context())
270267
cmd := NewInstallCmd()
271268
cmd.SetContext(ctx)
272269
cmd.SetArgs([]string{"databricks-jobs"})
273-
274-
require.NoError(t, cmd.Execute())
275-
require.Len(t, *calls, 1)
276-
assert.Equal(t, []string{"databricks-jobs"}, (*calls)[0].opts.SpecificSkills)
277-
}
278-
279-
func TestInstallPositionalAndSkillsFlagConflict(t *testing.T) {
280-
setupTestAgents(t)
281-
setupInstallMock(t)
282-
283-
ctx := cmdio.MockDiscard(t.Context())
284-
cmd := NewInstallCmd()
285-
cmd.SetContext(ctx)
286-
cmd.SetArgs([]string{"databricks-jobs", "--skills", "databricks-pipelines"})
287270
cmd.SilenceErrors = true
288271
cmd.SilenceUsage = true
289272

290273
err := cmd.Execute()
291274
require.Error(t, err)
292-
assert.Contains(t, err.Error(), "cannot use positional")
293-
}
294-
295-
func TestInstallRejectsTwoPositionalArgs(t *testing.T) {
296-
ctx := cmdio.MockDiscard(t.Context())
297-
cmd := NewInstallCmd()
298-
cmd.SetContext(ctx)
299-
cmd.SetArgs([]string{"databricks-jobs", "databricks-pipelines"})
300-
cmd.SilenceErrors = true
301-
cmd.SilenceUsage = true
302-
303-
require.Error(t, cmd.Execute())
275+
assert.Contains(t, err.Error(), "unknown command")
304276
}
305277

306278
func TestUpdateRejectsPositionalArgs(t *testing.T) {

0 commit comments

Comments
 (0)