Skip to contents

Ask Peter

peter()
Run an agent in this R session

Setup and status

gptr_init()
Create the project workspace .gptr/
gptr_config()
Show or change gptr's settings
gptr_env()
Load keys from a .env file
gptr_trust()
Record or read whether a project is trusted
gptr_login() gptr_logout()
Sign in to a model provider or an MCP server
gptr_providers()
List the configured model providers
gptr_models()
List models from the model catalog
gptr_permissions()
Manage permission rules
gptr_scrub()
Find, and optionally remove, registered secrets in persisted files

Discovery and MCP

gptr_skills() gptr_agents()
Discovered skills and agents
gptr_plugins()
Plugins known to this session
gptr_mcp()
List MCP servers and their tools
gptr_mcp_add() gptr_mcp_remove()
Add or remove an MCP server in gptr's configuration
gptr_mcp_serve()
Serve the live R session to other agents over MCP

Documents and artifacts

gptr_doc()
Bind this R process to a history document
gptr_source()
Source a history document, regenerating stale blocks without running the old code
gptr_blocks()
List the agent blocks of a document
gptr_export()
Export a recorded R document as ordinary R or a clean Peter script
gptr_cache()
Inspect, prune or clear gptr's caches
gptr_artifacts()
List, open, relaunch and stop artifacts

Session SDK

gptr_step()
Advance a session
gptr_wait()
Wait for sessions to settle
gptr_steer()
Steer a session
gptr_cancel()
Cancel running sessions
gptr_fork()
Fork a session
gptr_on()
Listen to a session's events
gptr_parallel()
Run several agent calls concurrently
gptr_sessions() gptr_resume() gptr_last()
Stored and live sessions
gptr_jobs()
List or stop gptr's background jobs and child processes
gptr_usage()
Token usage and cost
gptr_rewind() gptr_checkpoints()
Rewind a session: undo turns, restore objects and files, move the conversation

Results and inspection

gptr_return()
Designate the result of an agent run
gptr_describe()
Compact, budgeted description of an R object
gptr_prob()
Probabilities and confidence of System 1 answers
gptr_risk()
Classify the risk of R code without running it
gptr_prompt() print(<gptr_prompt_view>)
Show the frozen system prompt, tool array and first message
gptr_redact()
Redact secrets from text or from a nested list
gptr_preimage()
Tell the object checkpointer how to capture an object

Extension API

gptr_api()
Extension API version and features
gptr_register()
Register a capability spec
gptr_registry()
List the extension registry
gptr_reload()
Reload extensions
gptr_check()
Check an extension for conformance
gptr_fake_provider()
A scripted, offline fake model provider
gptr_tool_result()
Build a tool result
gptr_spec()
Build a spec of any registered kind

Spec constructors

gptr_tool()
Define a tool
gptr_provider()
Define a model provider
gptr_adapter()
Define a wire adapter
gptr_router()
Define a model router
gptr_hook()
Define an event hook
gptr_policy()
Define a permission policy
gptr_agent()
Define a sub-agent
gptr_command()
Define a slash command
gptr_prompt_section()
Define a system-prompt section
gptr_context_block()
Define a context block
gptr_backend()
Define a sub-agent backend

Help topics

gptr_security
Security considerations
gptr_egress
Data egress: what gptr sends to model providers
gptr_options
Options that control gptr
gptr-background background-sessions
Background sessions (experimental)

Methods

as.data.frame(<gptr_session_summary>)
Convert a session summary to a data frame
format(<gptr_risk>) print(<gptr_risk>)
Format a risk classification
format(<gptr_session>) as.character(<gptr_session>)
Format a session as its text
print(<gptr_session>)
Print a session
print(<gptr_session_summary>)
Print a session summary
str(<gptr_session>)
Show a session's structure
summary(<gptr_session>)
Summarize a session as its history