mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
177 lines
6.2 KiB
HTML
177 lines
6.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Commands | Kit</title>
|
|
<meta name="description" content="Complete reference for all Kit CLI subcommands.">
|
|
<link rel="canonical" href="/cli/commands">
|
|
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
|
<script type="module" src="/assets/index-Bi0zyiZe.js"></script>
|
|
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Commands","description":"Complete reference for all Kit CLI subcommands.","url":"https://go-kit.dev/cli/commands","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
|
</head>
|
|
<body>
|
|
<div id="tome-root"></div>
|
|
<div data-pagefind-body style="display:none"><h1>Commands</h1>
|
|
# Commands
|
|
|
|
## Authentication
|
|
|
|
For OAuth-enabled providers like Anthropic.
|
|
|
|
```bash
|
|
kit auth login [provider] # Start OAuth flow (e.g., anthropic)
|
|
kit auth logout [provider] # Remove credentials for provider
|
|
kit auth status # Check authentication status
|
|
```
|
|
|
|
## Model database
|
|
|
|
Manage the local model database that maps provider names to API configurations.
|
|
|
|
```bash
|
|
kit models [provider] # List available models (optionally filter by provider)
|
|
kit models --all # Show all providers (not just LLM-compatible)
|
|
kit update-models [source] # Update model database
|
|
```
|
|
|
|
The `update-models` command accepts an optional source argument:
|
|
- *(none)* — update from [models.dev](https://models.dev)
|
|
- A URL — fetch from a custom endpoint
|
|
- A file path — load from a local file
|
|
- `embedded` — reset to the bundled database
|
|
|
|
## Extension management
|
|
|
|
```bash
|
|
kit extensions list # List discovered extensions
|
|
kit extensions validate # Validate extension files
|
|
kit extensions init # Generate example extension template
|
|
```
|
|
|
|
### Installing extensions from git
|
|
|
|
```bash
|
|
kit install <git-url> # Install extensions from git repositories
|
|
kit install -l <git-url> # Install to project-local .kit/git/ directory
|
|
kit install -u <git-url> # Update an already-installed package
|
|
kit install --uninstall <pkg> # Remove an installed package
|
|
kit install --all # Install all extensions without prompting
|
|
```
|
|
|
|
## Skills
|
|
|
|
```bash
|
|
kit skill # Install the Kit extensions skill via skills.sh
|
|
```
|
|
|
|
## Interactive slash commands
|
|
|
|
These commands are available inside the Kit TUI during an interactive session:
|
|
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `/help` | Show available commands |
|
|
| `/tools` | List available MCP tools |
|
|
| `/servers` | Show connected MCP servers |
|
|
| `/model [name]` | Switch model or open model selector |
|
|
| `/theme [name]` | Switch color theme or list available themes |
|
|
| `/thinking [level]` | Set thinking level (off, minimal, low, medium, high) |
|
|
| `/compact [focus]` | Summarize older messages to free context |
|
|
| `/clear` | Clear conversation |
|
|
| `/clear-queue` | Clear queued messages |
|
|
| `/usage` | Show token usage |
|
|
| `/reset-usage` | Reset usage statistics |
|
|
| `/tree` | Navigate session tree |
|
|
| `/fork` | Fork to new session from an earlier message |
|
|
| `/new` | Start a new session (creates new session file) |
|
|
| `/name [name]` | Set or show session display name |
|
|
| `/resume` | Open session picker to switch sessions (alias: `/r`) |
|
|
| `/session` | Show session info |
|
|
| `/export [path]` | Export session as JSONL (default: auto-generated path) |
|
|
| `/import <path>` | Import a session from a JSONL file |
|
|
| `/share` | Upload session to GitHub Gist and get a shareable viewer URL |
|
|
| `/quit` | Exit Kit |
|
|
|
|
### Prompt history
|
|
|
|
Use **↑** and **↓** arrow keys to navigate through previously submitted prompts. Kit keeps the last 100 entries. Consecutive duplicates are skipped.
|
|
|
|
### Cancelling operations
|
|
|
|
Press **ESC twice** to cancel the current operation:
|
|
- During a tool call: rolls back the entire turn to maintain API message pairing
|
|
- During streaming: stops the response generation
|
|
|
|
This ensures that `tool_use` and `tool_result` messages are always sent to the API as matched pairs, avoiding errors from orphaned tool calls.
|
|
|
|
### External editor
|
|
|
|
Press **Ctrl+X e** to open your `$VISUAL` or `$EDITOR` in a temporary file pre-populated with the current input text. On save and quit, the edited content replaces the input textarea. On error exit (e.g., `:cq` in Vim), the original input is preserved.
|
|
|
|
### Mid-turn steering
|
|
|
|
Press **Ctrl+X s** during streaming to inject a system-level instruction mid-turn. This allows you to steer the conversation direction without waiting for the model to finish:
|
|
|
|
- Works during streaming output
|
|
- Sends a steering instruction as a system message
|
|
- Model continues from the interruption point with the new guidance
|
|
|
|
Example: While the model is writing code, press Ctrl+X s and type "Use async/await instead" to change the implementation approach.
|
|
|
|
## Prompt templates
|
|
|
|
### Creating templates
|
|
|
|
Templates use YAML frontmatter for metadata and support argument placeholders:
|
|
|
|
```markdown
|
|
---
|
|
description: Review code for issues
|
|
---
|
|
Review the following code for bugs and security issues.
|
|
Focus on $1 specifically.
|
|
```
|
|
|
|
Save to `~/.kit/prompts/review.md` or `.kit/prompts/review.md`.
|
|
|
|
### Using templates
|
|
|
|
Templates appear as slash commands:
|
|
|
|
```
|
|
/review error handling
|
|
```
|
|
|
|
### Argument placeholders
|
|
|
|
| Placeholder | Description |
|
|
|-------------|-------------|
|
|
| `$1`, `$2`, etc. | Individual arguments by position |
|
|
| `$@`, `$ARGUMENTS` | All arguments joined with spaces (zero or more) |
|
|
| `$+` | All arguments joined with spaces (one or more required) |
|
|
| `${@:N}` | Arguments from position N onwards |
|
|
| `${@:N:L}` | L arguments starting at position N |
|
|
|
|
Placeholders inside fenced code blocks (`` ``` ``) and inline code spans are ignored, so documentation examples won't be substituted.
|
|
|
|
### CLI flags
|
|
|
|
```bash
|
|
# Load a specific template by name
|
|
kit --prompt-template review
|
|
|
|
# Disable template loading
|
|
kit --no-prompt-templates
|
|
```
|
|
|
|
## ACP server
|
|
|
|
Run Kit as an [ACP (Agent Client Protocol)](https://agentclientprotocol.com) agent server. ACP-compatible clients communicate with Kit over JSON-RPC 2.0 on stdin/stdout.
|
|
|
|
```bash
|
|
kit acp # Start as ACP agent
|
|
kit acp --debug # With debug logging to stderr
|
|
```</div>
|
|
</body>
|
|
</html> |