五块卵石 - 终端 REPL
Project description
fp-terminal — 五块卵石终端 REPL
简介
fp-terminal 是五块卵石(Five Pebbles)Agent 框架的交互式命令行界面。它基于 prompt-toolkit 构建,提供了语法高亮、自动补全、多行编辑、历史记录等现代终端体验。
通常通过主包
fp安装,无需单独安装。
特性
- REPL 交互模式 — 实时与 Agent 对话,流式输出响应
- 命令系统 — 内置
/命令用于控制会话、加载插件、切换模型等 - 语法高亮 — 代码块自动识别并着色
- 自动补全 — 命令与参数 Tab 补全
- 多行编辑 — 支持粘贴多行文本或代码
- 会话历史 — 对话历史持久化存储,跨会话可回溯
- 多彩输出 — 基于
rich的渲染引擎
安装
pip install fp-terminal
要求 Python >= 3.11。
Windows 用户:推荐安装 Git for Windows(安装时勾选"Git Bash"并添加到 PATH),以获得完整的 Unix 命令支持。未安装时会自动降级到 cmd.exe,仅支持 Windows 原生命令。
快速使用
启动 REPL
fp
或显式调用:
python -m fp_cli
启动后进入交互模式:
╭─ Five Pebbles ───────────────────────────╮
│ 输入 /help 查看可用命令 │
│ 按 Ctrl+D 或输入 /exit 退出 │
╰──────────────────────────────────────────╯
🤖 你好!我是五块卵石,请告诉我你的问题。
开始对话
>> 请用 Python 写一个快速排序
# 直接输入即发送消息,Agent 会流式输出回复
>> /save session-quicksort
# 保存当前会话
>> /load session-quicksort
# 恢复历史会话
命令列表
| 命令 | 别名 | 说明 |
|---|---|---|
/help |
/h |
显示帮助信息 |
/exit |
/q, /quit |
退出 REPL |
/clear |
/c |
清屏 |
/save <name> |
— | 保存当前会话 |
/load <name> |
— | 加载指定会话 |
/list |
/ls |
列出所有会话 |
/delete <name> |
/rm |
删除指定会话 |
/model <name> |
— | 切换 LLM 模型 |
/plugin list |
— | 列出已加载的插件 |
/plugin load <name> |
— | 动态加载插件 |
/tool list |
— | 列出可用工具 |
/env |
— | 查看当前环境配置 |
/config <key>=<value> |
— | 动态修改配置 |
/reset |
— | 重置当前会话上下文 |
/export <format> |
— | 导出会话(json/md) |
快捷键
| 快捷键 | 功能 |
|---|---|
Tab |
自动补全命令/参数 |
Ctrl+C |
中断当前输出 |
Ctrl+D |
退出 REPL |
Ctrl+L |
清屏 |
Ctrl+R |
反向搜索历史 |
Up/Down |
浏览历史命令 |
Shift+Enter |
换行(多行输入) |
Ctrl+W |
删除前一个词 |
Ctrl+U |
删除整行 |
Ctrl+K |
删除光标至行尾 |
配置
通过命令行标志自定义启动行为:
# 指定配置文件
fp --config ./my-config.yaml
# 指定初始模型
fp --model claude-3-opus
# 静默模式(跳过启动横幅)
fp --quiet
# 调试模式
fp --debug
配置文件示例(YAML):
cli:
theme: dark # dark / light
multi_line: true # 启用多行编辑
max_history: 1000 # 历史记录条数
stream: true # 流式输出
依赖
| 依赖 | 版本 | 用途 |
|---|---|---|
fp-core |
>= 0.1.0 | Agent 核心引擎 |
prompt-toolkit |
>= 3.0.40 | 终端交互框架 |
许可
MIT © zpb
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fp_terminal-0.1.7.tar.gz.
File metadata
- Download URL: fp_terminal-0.1.7.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b98c2fe1cf9b702cfd10b9b29d32017179704474008bb9c5a264462668eb53b
|
|
| MD5 |
f3b77f3f9908d8bad982b004b0e58ef9
|
|
| BLAKE2b-256 |
e90e6a845510cccd9d650741d0298e7a04fe289207aa0e422d7821785160ba23
|
Provenance
The following attestation bundles were made for fp_terminal-0.1.7.tar.gz:
Publisher:
release.yml on zpb911km/fp-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fp_terminal-0.1.7.tar.gz -
Subject digest:
9b98c2fe1cf9b702cfd10b9b29d32017179704474008bb9c5a264462668eb53b - Sigstore transparency entry: 1885295157
- Sigstore integration time:
-
Permalink:
zpb911km/fp-agent@19acf3a8cb841dec3a84f14d6f406ddd436a993e -
Branch / Tag:
refs/tags/0.1.7 - Owner: https://github.com/zpb911km
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@19acf3a8cb841dec3a84f14d6f406ddd436a993e -
Trigger Event:
push
-
Statement type:
File details
Details for the file fp_terminal-0.1.7-py3-none-any.whl.
File metadata
- Download URL: fp_terminal-0.1.7-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f99fd2c061e4f0c37f0fa04b7664fc5741b0ab5d542ac3de654bf447fec06539
|
|
| MD5 |
920dfe80b6ee46564894555ca277ad95
|
|
| BLAKE2b-256 |
fbaaa2e1dc4c81cbfb4f1b6bb8aa6b7addc9af0e90d90f206ec6eba024cbd961
|
Provenance
The following attestation bundles were made for fp_terminal-0.1.7-py3-none-any.whl:
Publisher:
release.yml on zpb911km/fp-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fp_terminal-0.1.7-py3-none-any.whl -
Subject digest:
f99fd2c061e4f0c37f0fa04b7664fc5741b0ab5d542ac3de654bf447fec06539 - Sigstore transparency entry: 1885295295
- Sigstore integration time:
-
Permalink:
zpb911km/fp-agent@19acf3a8cb841dec3a84f14d6f406ddd436a993e -
Branch / Tag:
refs/tags/0.1.7 - Owner: https://github.com/zpb911km
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@19acf3a8cb841dec3a84f14d6f406ddd436a993e -
Trigger Event:
push
-
Statement type: