Skip to content

Expose the sub commands/options of commands as structured items #1802

Description

@DonJayamanne

Today the API commands.list returns all of the commands and also return the hints for the commands
Here are a few samples

	{
		"name": "compact",
		"description": "Summarize conversation history to reduce context window usage. Optionally provide focus instructions.",
		"kind": "builtin",
		"input": {
			"hint": "focus instructions",
			"preserveMultilineInput": true
		},
		"allowDuringAgentExecution": false,
		"schedulable": false
	},
	{
		"name": "chronicle",
		"description": "Session history tools and insights",
		"kind": "builtin",
		"input": {
			"hint": "standup|search|tips|cost-tips|improve|reindex"
		},
		"allowDuringAgentExecution": false,
		"schedulable": true
	},
	{
		"name": "session",
		"aliases": [
			"sessions"
		],
		"description": "View and manage sessions",
		"kind": "builtin",
		"input": {
			"hint": "info|checkpoints|files|plan|rename"
		},
		"allowDuringAgentExecution": true,
		"schedulable": false
	},
	{
		"name": "subconscious",
		"description": "Manage Copilot Subconscious memory consolidation",
		"kind": "builtin",
		"input": {
			"hint": "run"
		},
		"allowDuringAgentExecution": false,
		"experimental": true,
		"schedulable": true
	},

In the above case:

  • hint is merely just that a hint of what it could be,
    There's no structure to it.
  • We have 2 types of data in the hint (a hint, choices)

Work arounds

  • I could look for | pipe characters and treat those as choices.
    However some don't have them. E.g. subconscious
  • We could always have [...] as the indicator for choices
    Not a great contract, but yes possible.
    However we still don't get the descriptions.

What would be nice to have:

  • Structured data that gave the list of options, currently we have required: true in some cases.
    However users of the SDK don't really know what the exact choices are
  • Hence leave hint as is, its good for display purposes (tool tip, etc)
  • Expose choices that contains the name and description as well
    Take for instance /chronicle standup, what does standup search tips individually mean in the context of /chronicle
    This is knowledge thats internal to CLI
    Would be good to expose the descriptions of those individual choices as well.

Here's the proposed shape

	{
		"name": "chronicle",
		"description": "Session history tools and insights",
		"kind": "builtin",
		"input": {
			"hint": "standup|search|tips|cost-tips|improve|reindex"
			"choices": [
				{ name: "standup", description: "Get a report on your work from the last day"},
				{ name: "search", description: "Search all session content by keyword or topic"},
				{ name: "tips", description: "Get personalized tips based on usage patterns"},
				{ name: "cost-tips", description: "Get personalized tips to reduce token usage and cost"},
				{ name: "improve", description: "Suggest improvements to copilot-instructions.md"},
				{ name: "reindex", description: "Reload data into the session store index"},
			]
		},
		"allowDuringAgentExecution": false,
		"schedulable": true
	},

This will also benefit the CLI
Before

Image

After

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions