xonsh

Document xonsh completion systems, RichCompletion, CommandContext, and related APIs.

1.4k|36|Updated Mar 17, 2020
One-click install
npx skills add https://github.com/carapace-sh/carapace --skill xonsh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xonsh
Source: https://github.com/carapace-sh/carapace/tree/main/skills/xonsh
Command: npx skills add https://github.com/carapace-sh/carapace --skill xonsh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Streamlines mastering the xonsh shell by consolidating completion systems, context models, and integration patterns into a unified reference for developers and power users.

Core Features & Use Cases

  • Comprehensive reference for xonsh internals, including completion pipelines, RichCompletion, CommandContext, contextual completers, and event hooks.
  • Practical guidance for extending xonsh with xontribs, rc.xsh configuration, and prompt-toolkit integration across shells.
  • Real-world workflows covering path completion, Python completions, and cross-shell bridging in xonsh.

Quick Start

Ask how to implement a custom xonsh completer and test it in an interactive session.

Frequently Asked Questions about xonsh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a custom xonsh completer for an interactive shell?

To implement a custom xonsh completer, use the RichCompletion and CommandContext APIs to build contextual completion logic, then test the completer directly within an interactive xonsh session.

How does the xonsh completion system handle prompt-toolkit integration?

Xonsh completion integrates with prompt-toolkit by routing RichCompletion objects and CommandContext data through prompt-toolkit's rendering pipeline to display interactive shell suggestions.

Can I extend xonsh shell functionality using xontribs and rc.xsh configuration?

Yes, you can extend xonsh shell functionality by developing xontribs as packaged extensions and defining environment variables or event hooks in the rc.xsh configuration file.

What is the role of CommandContext in xonsh contextual completers?

CommandContext provides the surrounding command line state to contextual completers, enabling them to generate RichCompletion objects tailored to the specific cursor position and arguments of the interactive shell input.

Does xonsh support cross-shell bridging and Python completions?

Xonsh supports cross-shell bridging and Python completions natively by routing path completion logic and Python object introspection through its unified completion pipeline and contextual completers.