Skip to content

CodexSkills

🛈 DocStrings

Source code in src/codexed/client/skills.py
class CodexSkills:
    def __init__(self, client: CodexClient):
        self._client = client

    async def list_skills(
        self,
        *,
        cwds: list[str] | None = None,
        force_reload: bool | None = None,
    ) -> list[SkillMetadata]:
        """List available skills.

        Args:
            cwds: Optional working directories to scope skills
            force_reload: Force reload of skills cache

        Returns:
            List of skills with metadata
        """
        params = SkillsListParams(cwds=cwds, force_reload=force_reload)
        result = await self._client.dispatch.send_request("skills/list", params)
        response = SkillsListResponse.model_validate(result)
        if response.data:
            return response.data[0].skills
        return []

    async def config_write(self, path: str, *, enabled: bool) -> None:
        """Write skills configuration.

        Args:
            path: Path to the skill
            enabled: Whether the skill is enabled
        """
        params = SkillsConfigWriteParams(path=path, enabled=enabled)
        await self._client.dispatch.send_request("skills/config/write", params)

    async def remote_list(
        self,
        *,
        hazelnut_scope: HazelnutScope = "example",
        product_surface: ProductSurface = "codex",
        enabled: bool = False,
    ) -> list[RemoteSkillSummary]:
        """List remote skills.

        Args:
            hazelnut_scope: Scope filter (example/workspace-shared/all-shared/personal)
            product_surface: Product surface filter (chatgpt/codex/api/atlas)
            enabled: Whether to filter by enabled status

        Returns:
            List of remote skill summaries
        """
        params = SkillsRemoteListParams(
            hazelnut_scope=hazelnut_scope,
            product_surface=product_surface,
            enabled=enabled,
        )
        result = await self._client.dispatch.send_request("skills/remote/list", params)
        response = SkillsRemoteListResponse.model_validate(result)
        return response.data

    async def remote_export(self, hazelnut_id: str) -> SkillsRemoteExportResponse:
        """Export a skill to remote storage.

        Args:
            hazelnut_id: ID of the remote skill to export

        Returns:
            SkillsRemoteExportResponse with id and local path
        """
        params = SkillsRemoteExportParams(hazelnut_id=hazelnut_id)
        result = await self._client.dispatch.send_request("skills/remote/export", params)
        return SkillsRemoteExportResponse.model_validate(result)

config_write async

config_write(path: str, *, enabled: bool) -> None

Write skills configuration.

Parameters:

Name Type Description Default
path str

Path to the skill

required
enabled bool

Whether the skill is enabled

required
Source code in src/codexed/client/skills.py
async def config_write(self, path: str, *, enabled: bool) -> None:
    """Write skills configuration.

    Args:
        path: Path to the skill
        enabled: Whether the skill is enabled
    """
    params = SkillsConfigWriteParams(path=path, enabled=enabled)
    await self._client.dispatch.send_request("skills/config/write", params)

list_skills async

list_skills(
    *, cwds: list[str] | None = None, force_reload: bool | None = None
) -> list[SkillMetadata]

List available skills.

Parameters:

Name Type Description Default
cwds list[str] | None

Optional working directories to scope skills

None
force_reload bool | None

Force reload of skills cache

None

Returns:

Type Description
list[SkillMetadata]

List of skills with metadata

Source code in src/codexed/client/skills.py
async def list_skills(
    self,
    *,
    cwds: list[str] | None = None,
    force_reload: bool | None = None,
) -> list[SkillMetadata]:
    """List available skills.

    Args:
        cwds: Optional working directories to scope skills
        force_reload: Force reload of skills cache

    Returns:
        List of skills with metadata
    """
    params = SkillsListParams(cwds=cwds, force_reload=force_reload)
    result = await self._client.dispatch.send_request("skills/list", params)
    response = SkillsListResponse.model_validate(result)
    if response.data:
        return response.data[0].skills
    return []

remote_export async

remote_export(hazelnut_id: str) -> SkillsRemoteExportResponse

Export a skill to remote storage.

Parameters:

Name Type Description Default
hazelnut_id str

ID of the remote skill to export

required

Returns:

Type Description
SkillsRemoteExportResponse

SkillsRemoteExportResponse with id and local path

Source code in src/codexed/client/skills.py
async def remote_export(self, hazelnut_id: str) -> SkillsRemoteExportResponse:
    """Export a skill to remote storage.

    Args:
        hazelnut_id: ID of the remote skill to export

    Returns:
        SkillsRemoteExportResponse with id and local path
    """
    params = SkillsRemoteExportParams(hazelnut_id=hazelnut_id)
    result = await self._client.dispatch.send_request("skills/remote/export", params)
    return SkillsRemoteExportResponse.model_validate(result)

remote_list async

remote_list(
    *,
    hazelnut_scope: HazelnutScope = "example",
    product_surface: ProductSurface = "codex",
    enabled: bool = False,
) -> list[RemoteSkillSummary]

List remote skills.

Parameters:

Name Type Description Default
hazelnut_scope HazelnutScope

Scope filter (example/workspace-shared/all-shared/personal)

'example'
product_surface ProductSurface

Product surface filter (chatgpt/codex/api/atlas)

'codex'
enabled bool

Whether to filter by enabled status

False

Returns:

Type Description
list[RemoteSkillSummary]

List of remote skill summaries

Source code in src/codexed/client/skills.py
async def remote_list(
    self,
    *,
    hazelnut_scope: HazelnutScope = "example",
    product_surface: ProductSurface = "codex",
    enabled: bool = False,
) -> list[RemoteSkillSummary]:
    """List remote skills.

    Args:
        hazelnut_scope: Scope filter (example/workspace-shared/all-shared/personal)
        product_surface: Product surface filter (chatgpt/codex/api/atlas)
        enabled: Whether to filter by enabled status

    Returns:
        List of remote skill summaries
    """
    params = SkillsRemoteListParams(
        hazelnut_scope=hazelnut_scope,
        product_surface=product_surface,
        enabled=enabled,
    )
    result = await self._client.dispatch.send_request("skills/remote/list", params)
    response = SkillsRemoteListResponse.model_validate(result)
    return response.data

:fa-brands-github: Show source on GitHub