Quick Start¶
Start with a conversation, then try a small code change. For chat, we need access to an AI model. For coding tasks, we also need the project’s compiler and test tools.
1. Install the CLI¶
From the repository root, Rust 1.100 or later can build and install the CLI:
git clone https://github.com/eonseed/perspt.git
cd perspt
cargo install --locked --path crates/perspt-cli --features bundled
perspt --version
The bundled feature builds DuckDB into the executable, so we do not need a separate DuckDB library.
Compilation can take several minutes.
See Installation for platform and agent prerequisites.
2. Connect a model¶
Set one provider key in the terminal where Perspt will run:
export GEMINI_API_KEY="<api-key>"
perspt chat
OpenAI and Anthropic use OPENAI_API_KEY and ANTHROPIC_API_KEY respectively.
With several credentials set, an explicit provider::model route selects the intended provider.
Model availability depends on the provider account.
For a local conversation, start Ollama in another terminal, then pull and select a model:
ollama pull llama3.2
perspt chat --model ollama::llama3.2
See Local Models with Ollama for local setup and Providers for other providers.
3. Ask a question¶
In the full-screen chat, type a question such as Explain the difference between a Rust String and &str and press Enter.
Use Ctrl+J for a newline, Page Up / Page Down to scroll, and Esc to exit.
Configured read-only MCP operations are available through /mcp.
For a line-oriented interface:
perspt simple-chat --log-file chat.txt
Type a message and press Enter; Ctrl+D exits. This command takes no positional prompt argument. It reads piped input one non-empty line at a time, and its output includes the banner, input echo, and session messages as well as model responses. For a single piped question:
printf '%s\n' 'Explain Rust ownership in three sentences.' | perspt simple-chat
4. Try a code change¶
Start in an existing project with working local checks. For a Rust project, run cargo test first, then give Perspt a specific task:
perspt agent -w ./my-project \
"Add tests for empty input in the parser. Preserve the public API."
The agent edits a separate copy of the project and runs its build and tests. It uses error messages to try corrections and asks for review before copying the result back. Applying edits does not create a Git commit. Agent mode is experimental; required tools and platform isolation are described in Installation.
Review the diff and the tests before accepting the result. Passing tests can miss bugs or leave requirements untested. If the agent runs out of attempts, it stops and reports the remaining errors.
5. Watch or automate a run¶
# Live local browser view at http://127.0.0.1:3000
perspt agent --dashboard -w ./my-project "Fix the failing parser test"
# Non-interactive run; verification still applies
perspt agent --yes --output-summary summary.json \
-w ./my-project "Add tests for empty parser input"
--yes automatically approves copying a successful result into the project.
It is required for runs without an interactive terminal.
An incomplete or failed run exits with a nonzero status.
The embedded dashboard stops when the agent exits.
Next steps¶
- Agent Mode Tutorial: Follow a complete coding task and inspect the result.
- Configuration Guide: Choose providers, test policies, and verification settings.
- Agent Mode: Review edits, continue interrupted work, and read session history.
- API & SDK Reference: Reuse the Rust SDK.