| Crates.io | fastgpt |
| lib.rs | fastgpt |
| version | 0.2.2 |
| created_at | 2025-05-28 15:42:11.119955+00 |
| updated_at | 2025-07-31 13:13:27.705004+00 |
| description | A CLI client for Kagi's FastGPT API |
| homepage | https://github.com/0xgingi/kagi-fastgpt-cli |
| repository | https://github.com/0xgingi/kagi-fastgpt-cli |
| max_upload_size | |
| id | 1692972 |
| size | 103,831 |
A command-line interface for Kagi's FastGPT API written in Rust.
cargo install fastgpt
git clone https://github.com/0xgingi/kagi-fastgpt-cli
cd kagi-fastgpt-cli
cargo install --path .
Get your API key from Kagi:
Set your API key (one time setup):
fastgpt --config
Start chatting:
fastgpt
# Set API key
fastgpt --set-api-key "your-api-key"
# Show current API key
fastgpt --show-api-key
# Reset/remove stored API key
fastgpt --reset-api-key
fastgpt [OPTIONS]
Options:
--set-api-key <SET_API_KEY> Set API key (will be saved for future use)
--show-api-key Show current API key
--config Interactive configuraiton setup
--cache Whether to allow cached responses [default: true]
--json Output raw JSON response
--reset-api-key Reset stored API key
--references Enable or disable showing references [default: true]
-h, --help Print help
-V, --version Print version
fastgpt --config
fastgpt
fastgpt --json
While in interactive mode, you can use these special commands:
/exit or /quit - Exit the session/clear - Clear conversation history and start fresh/history - Show your complete conversation history/help - Display available commands/balance - Check API balance/add-file <path> - Add a file or directory to context for queries/remove-file <path> - Remove a specific file from context/list-files - Show all files currently in context/clear-files - Remove all files from contextThe FastGPT CLI now supports adding local files and directories as context for your queries. This allows you to:
The CLI automatically processes these file extensions:
.txt, .md.rs, .py, .js, .ts, .html, .css.json, .xml, .yml, .yaml, .toml.sh, .bat# Add a single file
/add-file src/main.rs
# Add an entire directory
/add-file src/
# Ask questions about your files
What does the main function in main.rs do?
# List files in context
/list-files
# Remove a specific file
/remove-file src/main.rs
# Clear all file contexts
/clear-files
The API key is stored in your system's config directory:
~/.config/fastgpt/config.toml~/Library/Application Support/fastgpt/config.toml%APPDATA%\fastgpt\config.tomlThe config file is created automatically when you set your API key.