Skip to content

feat(commands): Add namespace support for hierarchical custom command organization #1943

@dariuszkowalski-com

Description

@dariuszkowalski-com

Description

Currently, custom commands in Forge must be placed in flat directories (~/forge/commands or .forge/commands), making it difficult to organize large sets of commands. This feature request proposes adding namespace support to enable hierarchical command organization using folder structures.

Current Behavior

Command files are loaded from flat directories:

  • ~/forge/commands/
  • .forge/commands/

After loading, commands are available as /command

Proposed Changes

Enable organizing commands in nested folders, where folder names become namespaces in the command invocation path.

Example Structure

~/forge/commands/
  git/
    commit.md
    rebase.md
    pr.md
  docker/
    build.md
    run.md
  database/
    postgres/
      backup.md
      restore.md

Resulting Commands

  • /git:commit
  • /git:rebase
  • /git:pr
  • /docker:build
  • /docker:run
  • /database:postgres:backup
  • /database:postgres:restore

Benefits

  1. Better Organization - Group related commands logically by category
  2. Scalability - Manage large command sets without cluttering single directory
  3. Discoverability - TAB completion shows available commands within namespace (e.g., typing /git: + TAB lists all git-related commands)
  4. Flexibility - Unlimited nesting depth for complex command hierarchies
  5. Namespace Clarity - Clear command context from invocation path

Additional Context

This pattern is common in modern CLI tools and would significantly improve command management for users with extensive custom command libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions