pi-kimi-tools
Kimi WebSearch and FetchURL tools for the pi coding agent.
Package details
Install pi-kimi-tools from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-kimi-tools- Package
pi-kimi-tools- Version
0.1.0- Published
- Aug 1, 2026
- Downloads
- 579/mo · 69/wk
- Author
- lucassstory
- License
- MIT
- Types
- extension
- Size
- 35.6 KB
- Dependencies
- 3 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./dist/index.mjs"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-kimi-tools
Kimi WebSearch and FetchURL tools for the pi coding agent.
Install
pi install npm:pi-kimi-tools
Configure
Create a Kimi Code API key in the Kimi Code Console, then export it before starting pi:
export KIMI_API_KEY="YOUR_API_KEY"
pi
This extension accepts no configuration file and reads no other credential or endpoint variables. It sends requests to the Kimi Code search and fetch services. Kimi Open Platform keys are not interchangeable with Kimi Code keys.
The extension refuses to load when KIMI_API_KEY is missing or blank.
Tools
WebSearchsearches the web and returns result summaries with source URLs.FetchURLfetches a public HTTP(S) URL, using Kimi's extraction service first and a guarded local fetch as fallback.
Both tools forward pi cancellation signals. FetchURL blocks private and loopback destinations, revalidates redirects, limits response bodies to 10 MiB, and extracts the main text from HTML pages.
When enabled, both tools are listed by name in pi's Available tools system-prompt section. The extension also adds concise Guidelines covering when to search, when to fetch a full page, and how to cite retrieved sources.
In interactive mode, tool results stay compact until you use pi's tool-output expansion shortcut (Ctrl+O by default). Search shows the result count and fetch shows the extracted character count while collapsed.
Before each agent run, the extension appends the current local date and IANA time zone to the end of pi's system prompt:
current date: 2026-08-01
timezone: Asia/Shanghai
The date is regenerated for every new user request and remains stable throughout that agent run. User messages are left unchanged. Because the value changes only when the calendar day or system time zone changes, the stable system-prompt prefix remains cache-friendly.
Acknowledgements
The WebSearch and FetchURL implementations in this project are adapted from Kimi Code, created by Moonshot AI. Thanks to the Kimi Code maintainers and contributors for making their work available under the MIT License.